From fd1d80f7191b96b5b57108c912a740a3c1c376d3 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Wed, 5 Aug 2020 16:27:25 +0200 Subject: [PATCH 001/695] API: trying to get OData 4 hell to work (in progress) --- .../Media/MediaFileInfo.cs | 7 +- .../Controllers/OData/CurrenciesController.cs | 10 +- .../Controllers/OData/CustomersController.cs | 7 + .../Controllers/OData/OrdersController.cs | 2 +- .../Controllers/OData/PicturesController.cs | 4 +- .../Controllers/OData/ProductsController.cs | 2 +- .../Extensions/MiscExtensions.cs | 2 +- .../Swagger/SwaggerOdataDocumentFilter.cs | 4 +- .../SmartStore.WebApi.csproj | 36 +- .../WebApiConfigurationProvider.cs | 8 +- src/Plugins/SmartStore.WebApi/packages.config | 22 +- .../SmartStore.Web.Framework.csproj | 28 +- .../WebApiConfigurationBroadcaster.cs | 4 +- .../WebApi/OData/WebApiQueryableAttribute.cs | 6 +- .../WebApi/WebApiEntityController.cs | 1621 ++++++++++++----- .../WebApi/WebApiExtension.cs | 57 +- .../WebApi/WebApiStartupTask.cs | 35 +- .../SmartStore.Web.Framework/packages.config | 23 +- 18 files changed, 1301 insertions(+), 577 deletions(-) diff --git a/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs b/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs index bff031e5bb..5ce0f0657e 100644 --- a/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs +++ b/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs @@ -35,7 +35,12 @@ public MediaFileInfo(MediaFile file, IMediaStorageProvider storageProvider, IMed public MediaFile File { get; } [JsonProperty("id")] - public int Id => File.Id; + public int Id + { + get { return File.Id; } + set { } + } + //public int Id => File.Id; [JsonProperty("folderId")] public int? FolderId => File.FolderId; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs index 72c01b8e8e..c2cdc39ee3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs @@ -1,4 +1,5 @@ -using System.Web.Http; +using System.Linq; +using System.Web.Http; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -28,6 +29,13 @@ protected override void Delete(Currency entity) Service.DeleteCurrency(entity); } + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] + public IQueryable Get() + { + return GetEntitySet(); + } + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] public SingleResult GetCurrency(int key) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 599661b11c..17c9865367 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -52,6 +52,13 @@ protected override void Delete(Customer entity) Service.DeleteCustomer(entity); } + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IQueryable Get() + { + return GetEntitySet(); + } + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] public SingleResult GetCustomer(int key) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index c98d8e5096..eef665f97d 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Net.Http; using System.Web.Http; -using System.Web.Http.OData; +using Microsoft.AspNet.OData; using SmartStore.Core.Domain.Common; using SmartStore.Core.Domain.Customers; using SmartStore.Core.Domain.Orders; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs index 35b6119431..c92054c8ba 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs @@ -4,7 +4,7 @@ using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; -using System.Web.Http.OData; +using Microsoft.AspNet.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Media; using SmartStore.Services.Media; @@ -26,7 +26,7 @@ public MediaController(IMediaService mediaService) public static void Init(WebApiConfigurationBroadcaster configData) { - var entityConfig = configData.ModelBuilder.Entity(); + var entityConfig = configData.ModelBuilder.EntityType(); entityConfig.Collection .Action("FileExists") diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index 5c81703cac..536eb86889 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -5,7 +5,7 @@ using System.Net.Http; using System.Web.Http; using System.Web.Http.ModelBinding; -using System.Web.Http.OData; +using Microsoft.AspNet.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Domain.Discounts; diff --git a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs index 375cb6cdb4..834e98b1cf 100644 --- a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs +++ b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs @@ -1,6 +1,6 @@ using System.Text; -using System.Web.Http.OData; using System.Web.Mvc; +using Microsoft.AspNet.OData; using SmartStore.Core.Infrastructure; using SmartStore.Services.Localization; diff --git a/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs b/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs index d75e592a1a..15359e30eb 100644 --- a/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs +++ b/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs @@ -3,8 +3,8 @@ using System.Reflection; using System.Web.Http; using System.Web.Http.Description; -using System.Web.Http.OData; -using System.Web.Http.OData.Routing; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Routing; using Swashbuckle.Swagger; namespace SmartStore.WebApi.Services.Swagger diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 8fea27bebf..9a4a662f07 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -103,16 +103,32 @@ ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll False + + ..\..\packages\Microsoft.AspNet.OData.7.4.1\lib\net45\Microsoft.AspNet.OData.dll + True + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - - ..\..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll - False + + ..\..\packages\Microsoft.Extensions.DependencyInjection.1.0.0\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll + True - - ..\..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll - False + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.0.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + True + + + ..\..\packages\Microsoft.OData.Core.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll + True + + + ..\..\packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll + True + + + ..\..\packages\Microsoft.Spatial.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll + True ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll @@ -140,10 +156,6 @@ - - ..\..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll - False - @@ -166,10 +178,6 @@ ..\..\packages\Microsoft.AspNet.WebApi.Cors.5.2.7\lib\net45\System.Web.Http.Cors.dll False - - ..\..\packages\Microsoft.AspNet.WebApi.OData.5.7.0\lib\net45\System.Web.Http.OData.dll - False - ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll False diff --git a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs index fe9844ed28..ce90a72f30 100644 --- a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs +++ b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using System.Web.Http.OData.Builder; +using Microsoft.AspNet.OData.Builder; using SmartStore.Core.Domain.Blogs; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Common; @@ -94,9 +94,9 @@ public void Configure(WebApiConfigurationBroadcaster configData) m.EntitySet("UrlRecords"); m.EntitySet("SyncMappings"); - AddActionsToOrder(m.Entity()); - AddActionsToOrderItem(m.Entity()); - AddActionsToProduct(m.Entity()); + AddActionsToOrder(m.EntityType()); + AddActionsToOrderItem(m.EntityType()); + AddActionsToProduct(m.EntityType()); Controllers.OData.MediaController.Init(configData); diff --git a/src/Plugins/SmartStore.WebApi/packages.config b/src/Plugins/SmartStore.WebApi/packages.config index b645dda46e..ff71ebcf50 100644 --- a/src/Plugins/SmartStore.WebApi/packages.config +++ b/src/Plugins/SmartStore.WebApi/packages.config @@ -6,18 +6,32 @@ + - - - + + + + + - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index 4cac4a1212..27cd2a80c5 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -113,14 +113,23 @@ ..\..\packages\LibSassHost.1.2.2\lib\net45\LibSassHost.dll - - ..\..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll + + ..\..\packages\Microsoft.AspNet.OData.7.4.1\lib\net45\Microsoft.AspNet.OData.dll - - ..\..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll + + ..\..\packages\Microsoft.Extensions.DependencyInjection.1.0.0\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll - - ..\..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.0.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\..\packages\Microsoft.OData.Core.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll + + + ..\..\packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll + + + ..\..\packages\Microsoft.Spatial.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll True @@ -145,9 +154,6 @@ - - ..\..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll @@ -165,10 +171,6 @@ ..\..\packages\Microsoft.AspNet.WebApi.Cors.5.2.7\lib\net45\System.Web.Http.Cors.dll - - ..\..\packages\Microsoft.AspNet.WebApi.OData.5.7.0\lib\net45\System.Web.Http.OData.dll - True - ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs index f7b711d78c..36a8fa781f 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Web.Http; -using System.Web.Http.OData.Builder; -using System.Web.Http.OData.Routing.Conventions; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Routing.Conventions; namespace SmartStore.Web.Framework.WebApi.Configuration { diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs index 45dd3f653a..45d2e50481 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs @@ -3,7 +3,7 @@ using System.Net.Http; using System.Web.Http; using System.Web.Http.Filters; -using System.Web.Http.OData; +using Microsoft.AspNet.OData; using SmartStore.Web.Framework.WebApi.Caching; namespace SmartStore.Web.Framework.WebApi.OData @@ -59,8 +59,8 @@ protected virtual bool MissingClientPaging(HttpActionExecutedContext actionExecu public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { - if (MissingClientPaging(actionExecutedContext)) - return; + //if (MissingClientPaging(actionExecutedContext)) + // return; base.OnActionExecuted(actionExecutedContext); } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index 451c727d13..d5b9d88c19 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -1,18 +1,18 @@ using System; using System.Collections.Generic; using System.Data.Entity; -using System.Data.Entity.Core.Metadata.Edm; -using System.Data.Entity.Infrastructure; using System.Linq; using System.Linq.Expressions; using System.Net; using System.Net.Http; using System.Web.Http; -using System.Web.Http.OData; -using System.Web.Http.OData.Extensions; -using System.Web.Http.OData.Formatter; -using System.Web.Http.OData.Routing; +//using System.Web.Http.OData; +//using System.Web.Http.OData.Extensions; +//using System.Web.Http.OData.Formatter; +//using System.Web.Http.OData.Routing; using Autofac; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Formatter; using SmartStore.ComponentModel; using SmartStore.Core; using SmartStore.Core.Data; @@ -22,505 +22,1166 @@ namespace SmartStore.Web.Framework.WebApi { - public abstract class WebApiEntityController : EntitySetController - where TEntity : BaseEntity, new() - { - - protected internal HttpResponseException ExceptionEntityNotFound(TKey key) - { - var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, - WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - - return new HttpResponseException(response); - } - - protected internal HttpResponseException ExceptionNotExpanded(Expression> path) - { - // NotFound cause of nullable properties - var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, - WebApiGlobal.Error.PropertyNotExpanded.FormatInvariant(path.ToString())); - - return new HttpResponseException(response); - } - - public override HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) - { - if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/property") || - odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/cast/property") || - odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/unresolved")) - { - if (Request.Method == HttpMethod.Get || Request.Method == HttpMethod.Post) - { - return UnmappedGetProperty(odataPath); - } - } - else if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation/key")) - { - if (Request.Method == HttpMethod.Get || Request.Method == HttpMethod.Post || Request.Method == HttpMethod.Delete) - { - // we ignore standard odata path cause they differ: - // ~/entityset/key/$links/navigation (odata 3 "link"), ~/entityset/key/navigation/$ref (odata 4 "reference") - - return UnmappedGetNavigation(odataPath); - } - } - else if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation")) - { - if (Request.Method == HttpMethod.Delete) - { - return UnmappedGetNavigation(odataPath); - } - } - - return base.HandleUnmappedRequest(odataPath); - } - - protected virtual internal HttpResponseMessage UnmappedGetProperty(ODataPath odataPath) - { - int key; - - if (!odataPath.GetNormalizedKey(1, out key)) - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoKeyFromPath); - - var entity = GetEntityByKey(key); - - if (entity == null) - return Request.CreateErrorResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - - FastProperty prop = null; - string propertyName = null; - var lastSegment = odataPath.Segments.Last(); - var propertySegment = (lastSegment as PropertyAccessPathSegment); - - if (propertySegment == null) - propertyName = lastSegment.ToString(); - else - propertyName = propertySegment.PropertyName; - - if (propertyName.HasValue()) - prop = FastProperty.GetProperty(entity.GetType(), propertyName); - - if (prop == null) - return UnmappedGetProperty(entity, propertyName ?? ""); - - var propertyValue = prop.GetValue(entity); - - return Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); - } - - protected virtual internal HttpResponseMessage UnmappedGetProperty(TEntity entity, string propertyName) - { - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName)); - } - - protected virtual internal HttpResponseMessage UnmappedGetNavigation(ODataPath odataPath) - { - int key, relatedKey; - - if (!odataPath.GetNormalizedKey(1, out key)) - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoKeyFromPath); - - var navigationProperty = odataPath.GetNavigation(2); - - if (navigationProperty.IsEmpty()) - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoNavigationFromPath); - - if (!odataPath.GetNormalizedKey(3, out relatedKey) && Request.Method != HttpMethod.Delete) - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoRelatedKeyFromPath); - - var methodName = string.Concat("Navigation", navigationProperty); - var methodInfo = GetType().GetMethod(methodName); - - if (methodInfo != null) - { - HttpResponseMessage response = null; - - this.ProcessEntity(() => - { - response = (HttpResponseMessage)methodInfo.Invoke(this, new object[] { key, relatedKey }); - }); - - return response; - } - return base.HandleUnmappedRequest(odataPath); - } - - /// - /// Auto injected by Autofac - /// - public virtual IRepository Repository - { - get; - set; - } - - /// - /// Auto injected by Autofac - /// - public virtual TService Service - { - get; - set; - } - - /// - /// Auto injected by Autofac - /// - public virtual ICommonServices Services - { - get; - set; - } + public abstract class WebApiEntityController : ODataController + where TEntity : BaseEntity, new() + { + // TODO: overrides !!!??? + // public override HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) + // protected override int GetKey(TEntity entity) + // protected override TEntity GetEntityByKey(int key) + // public override HttpResponseMessage Post(TEntity entity) + // protected override TEntity CreateEntity(TEntity entity) + // public override HttpResponseMessage Put(int key, TEntity update) + // protected override TEntity UpdateEntity(int key, TEntity update) + // public override HttpResponseMessage Patch(int key, Delta patch) + // protected override TEntity PatchEntity(int key, Delta patch) + // public override void Delete(int key) + + /// + /// Auto injected by Autofac + /// + public virtual IRepository Repository { get; set; } + + /// + /// Auto injected by Autofac + /// + public virtual TService Service { get; set; } + + /// + /// Auto injected by Autofac + /// + public virtual ICommonServices Services { get; set; } - public override IQueryable Get() - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - return this.GetEntitySet(); - } + protected internal HttpResponseException ExceptionEntityNotFound(TKey key) + { + var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - protected internal virtual IQueryable GetEntitySet() - { - return this.Repository.Table; - } - - protected internal virtual IQueryable GetExpandedEntitySet(Expression> path) - { - var query = GetEntitySet().Expand(path); - return query; - } + return new HttpResponseException(response); + } - protected internal virtual IQueryable GetExpandedEntitySet(string properties) - { - var query = GetEntitySet(); + protected internal HttpResponseException ExceptionNotExpanded(Expression> path) + { + // NotFound cause of nullable properties. + var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.PropertyNotExpanded.FormatInvariant(path.ToString())); - foreach (var property in properties.SplitSafe(",")) - { - query = query.Expand(property.Trim()); - } + return new HttpResponseException(response); + } - return query; - } + protected internal virtual IQueryable GetEntitySet() + { + return this.Repository.Table; + } - protected override int GetKey(TEntity entity) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - return entity.Id; - } - - protected override TEntity GetEntityByKey(int key) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - return this.Repository.GetById(key); - } - - protected internal virtual TEntity GetEntityByKeyNotNull(int key) - { - var entity = GetEntityByKey(key); - - if (entity == null) - throw ExceptionEntityNotFound(key); - - return entity; - } - - protected internal virtual SingleResult GetSingleResult(int key) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - return SingleResult.Create(GetEntitySet().Where(x => x.Id == key)); - } - - protected internal virtual TEntity GetExpandedEntity(int key, Expression> path) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - var query = GetExpandedEntitySet(path); - - var entity = query.FirstOrDefault(x => x.Id == key); - - if (entity == null) - throw ExceptionEntityNotFound(key); - - return entity; - } - protected internal virtual TEntity GetExpandedEntity(int key, string properties) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - var query = GetExpandedEntitySet(properties); - - var entity = query.FirstOrDefault(x => x.Id == key); - - if (entity == null) - throw ExceptionEntityNotFound(key); - - return entity; - } - - protected internal virtual TEntity GetExpandedEntity(int key, SingleResult result, string path) - { - var query = result.Queryable; + protected internal virtual IQueryable GetExpandedEntitySet(Expression> path) + { + var query = GetEntitySet().Expand(path); + return query; + } - foreach (var property in path.SplitSafe(",")) - { - query = query.Expand(property.Trim()); - } + protected internal virtual IQueryable GetExpandedEntitySet(string properties) + { + var query = GetEntitySet(); - var entity = query.FirstOrDefault(x => x.Id == key); + foreach (var property in properties.SplitSafe(",")) + { + query = query.Expand(property.Trim()); + } - if (entity == null) - throw ExceptionEntityNotFound(key); + return query; + } - return entity; - } + protected internal virtual TEntity GetEntityByKeyNotNull(int key) + { + if (!ModelState.IsValid) + throw this.ExceptionInvalidModelState(); - protected internal virtual TProperty GetExpandedProperty(int key, Expression> path) - { - var entity = GetExpandedEntity(key, path); + var entity = this.Repository.GetById(key); - var expression = path.CompileFast(PropertyCachingStrategy.EagerCached); - var property = expression.Invoke(entity); + if (entity == null) + throw ExceptionEntityNotFound(key); - if (property == null) - throw ExceptionNotExpanded(path); + return entity; + } - return property; - } + protected internal virtual SingleResult GetSingleResult(int key) + { + if (!ModelState.IsValid) + throw this.ExceptionInvalidModelState(); - protected internal virtual IQueryable GetRelatedCollection( - int key, - Expression>> navigationProperty) - { - Guard.NotNull(navigationProperty, nameof(navigationProperty)); + return SingleResult.Create(GetEntitySet().Where(x => x.Id == key)); + } - var query = GetEntitySet().Where(x => x.Id.Equals(key)); - return query.SelectMany(navigationProperty); - } + protected internal virtual TEntity GetExpandedEntity(int key, Expression> path) + { + if (!ModelState.IsValid) + throw this.ExceptionInvalidModelState(); - protected internal virtual IQueryable GetRelatedCollection( - int key, - string navigationProperty) - { - Guard.NotEmpty(navigationProperty, nameof(navigationProperty)); + var query = GetExpandedEntitySet(path); + + var entity = query.FirstOrDefault(x => x.Id == key); - var ctx = (DbContext)Repository.Context; - var product = GetEntityByKey(key); - var entry = ctx.Entry(product); - var query = entry.Collection(navigationProperty).Query(); + if (entity == null) + throw ExceptionEntityNotFound(key); + + return entity; + } - return query.Cast(); - } + protected internal virtual TEntity GetExpandedEntity(int key, string properties) + { + if (!ModelState.IsValid) + throw this.ExceptionInvalidModelState(); - protected internal virtual SingleResult GetRelatedEntity( - int key, - Expression> navigationProperty) - { - Guard.NotNull(navigationProperty, nameof(navigationProperty)); + var query = GetExpandedEntitySet(properties); - var query = GetEntitySet().Where(x => x.Id.Equals(key)).Select(navigationProperty); - return SingleResult.Create(query); - } + var entity = query.FirstOrDefault(x => x.Id == key); - protected internal virtual SingleResult GetRelatedEntity( - int key, - string navigationProperty) - { - Guard.NotEmpty(navigationProperty, nameof(navigationProperty)); + if (entity == null) + throw ExceptionEntityNotFound(key); - var ctx = (DbContext)Repository.Context; - var product = GetEntityByKey(key); - var entry = ctx.Entry(product); - var query = entry.Reference(navigationProperty).Query().Cast(); + return entity; + } - return SingleResult.Create(query); - } + protected internal virtual TEntity GetExpandedEntity(int key, SingleResult result, string path) + { + var query = result.Queryable; - public override HttpResponseMessage Post(TEntity entity) - { - var response = Request.CreateResponse(HttpStatusCode.OK, CreateEntity(entity)); + foreach (var property in path.SplitSafe(",")) + { + query = query.Expand(property.Trim()); + } - try - { - var entityUrl = Url.CreateODataLink( - new EntitySetPathSegment(entity.GetType().Name.EnsureEndsWith("s")), - new KeyValuePathSegment(entity.Id.ToString()) - ); + var entity = query.FirstOrDefault(x => x.Id == key); - response.Headers.Location = new Uri(entityUrl); - } - catch { } - - return response; - } - - protected override TEntity CreateEntity(TEntity entity) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - if (entity == null) - throw this.ExceptionBadRequest(WebApiGlobal.Error.NoDataToInsert); - - Insert(FulfillPropertiesOn(entity)); - - return entity; - } - - protected internal virtual void Insert(TEntity entity) - { - Repository.Insert(entity); - } - - public override HttpResponseMessage Put(int key, TEntity update) - { - return Request.CreateResponse(HttpStatusCode.OK, UpdateEntity(key, update)); - } - - protected override TEntity UpdateEntity(int key, TEntity update) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - var originalEntity = GetEntityByKeyNotNull(key); - - var context = ((IObjectContextAdapter)this.Repository.Context).ObjectContext; - var container = context.MetadataWorkspace.GetEntityContainer(context.DefaultContainerName, DataSpace.CSpace); - - string entityName = typeof(TEntity).Name; - string entitySetName = container.BaseEntitySets.First(x => x.ElementType.Name == entityName).Name; - - update.Id = key; - var entity = context.ApplyCurrentValues(entitySetName, update); - - Update(FulfillPropertiesOn(entity)); - - return entity; - } - - protected internal virtual void Update(TEntity entity) - { - Repository.Update(entity); - } - - public override HttpResponseMessage Patch(int key, Delta patch) - { - return Request.CreateResponse(HttpStatusCode.OK, PatchEntity(key, patch)); - } - - protected override TEntity PatchEntity(int key, Delta patch) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - var entity = GetEntityByKeyNotNull(key); - - if (patch != null) - patch.Patch(entity); - - Update(FulfillPropertiesOn(entity)); - - return entity; - } - - public override void Delete(int key) - { - if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); - - var entity = GetEntityByKeyNotNull(key); - - Delete(entity); - } - - protected internal virtual void Delete(TEntity entity) - { - Repository.Delete(entity); - } - - protected internal virtual object FulfillPropertyOn(TEntity entity, string propertyName, string queryValue) - { - var container = Services.Container; - - if (propertyName.IsCaseInsensitiveEqual("Country")) - { - return container.Resolve().GetCountryByTwoOrThreeLetterIsoCode(queryValue); - } - else if (propertyName.IsCaseInsensitiveEqual("StateProvince")) - { - return container.Resolve().GetStateProvinceByAbbreviation(queryValue); - } - else if (propertyName.IsCaseInsensitiveEqual("Language")) - { - return container.Resolve().GetLanguageByCulture(queryValue); - } - else if (propertyName.IsCaseInsensitiveEqual("Currency")) - { - return container.Resolve().GetCurrencyByCode(queryValue); - } - - return null; - } - - protected internal virtual TEntity FulfillPropertiesOn(TEntity entity) - { - try - { - if (entity == null) - return entity; - - var queries = Request.RequestUri.ParseQueryString(); - - if (queries == null || queries.Count <= 0) - return entity; - - foreach (string key in queries.AllKeys.Where(x => x.StartsWith(WebApiGlobal.QueryOption.Fulfill))) - { - string propertyName = key.Substring(WebApiGlobal.QueryOption.Fulfill.Length); - string queryValue = queries.Get(key); - - if (propertyName.HasValue() && queryValue.HasValue()) - { - var prop = FastProperty.GetProperty(entity.GetType(), propertyName); - if (prop != null) - { - var propertyValue = prop.GetValue(entity); - if (propertyValue == null) - { - object value = FulfillPropertyOn(entity, propertyName, queryValue); - - // there's no requirement to set a property value of null - if (value != null) - { - prop.SetValue(entity, value); - } - } - } - } - } - } - catch (Exception ex) - { - throw this.ExceptionUnprocessableEntity(ex.Message); - } - - return entity; - } - - protected internal virtual T ReadContent() - { - var formatters = ODataMediaTypeFormatters.Create() - .Select(formatter => formatter.GetPerRequestFormatterInstance(typeof(T), Request, Request.Content.Headers.ContentType)); - - return Request.Content.ReadAsAsync(formatters).Result; - } - } + if (entity == null) + throw ExceptionEntityNotFound(key); + + return entity; + } + + protected internal virtual TProperty GetExpandedProperty(int key, Expression> path) + { + var entity = GetExpandedEntity(key, path); + + var expression = path.CompileFast(PropertyCachingStrategy.EagerCached); + var property = expression.Invoke(entity); + + if (property == null) + throw ExceptionNotExpanded(path); + + return property; + } + + protected internal virtual IQueryable GetRelatedCollection( + int key, + Expression>> navigationProperty) + { + Guard.NotNull(navigationProperty, nameof(navigationProperty)); + + var query = GetEntitySet().Where(x => x.Id.Equals(key)); + return query.SelectMany(navigationProperty); + } + + protected internal virtual IQueryable GetRelatedCollection( + int key, + string navigationProperty) + { + Guard.NotEmpty(navigationProperty, nameof(navigationProperty)); + + if (!ModelState.IsValid) + throw this.ExceptionInvalidModelState(); + + + var ctx = (DbContext)Repository.Context; + var product = this.Repository.GetById(key); + var entry = ctx.Entry(product); + var query = entry.Collection(navigationProperty).Query(); + + return query.Cast(); + } + + protected internal virtual SingleResult GetRelatedEntity( + int key, + Expression> navigationProperty) + { + Guard.NotNull(navigationProperty, nameof(navigationProperty)); + + var query = GetEntitySet().Where(x => x.Id.Equals(key)).Select(navigationProperty); + return SingleResult.Create(query); + } + + protected internal virtual void Insert(TEntity entity) + { + Repository.Insert(entity); + } + + protected internal virtual void Update(TEntity entity) + { + Repository.Update(entity); + } + + protected internal virtual void Delete(TEntity entity) + { + Repository.Delete(entity); + } + + protected internal virtual object FulfillPropertyOn(TEntity entity, string propertyName, string queryValue) + { + var container = Services.Container; + + if (propertyName.IsCaseInsensitiveEqual("Country")) + { + return container.Resolve().GetCountryByTwoOrThreeLetterIsoCode(queryValue); + } + else if (propertyName.IsCaseInsensitiveEqual("StateProvince")) + { + return container.Resolve().GetStateProvinceByAbbreviation(queryValue); + } + else if (propertyName.IsCaseInsensitiveEqual("Language")) + { + return container.Resolve().GetLanguageByCulture(queryValue); + } + else if (propertyName.IsCaseInsensitiveEqual("Currency")) + { + return container.Resolve().GetCurrencyByCode(queryValue); + } + + return null; + } + + protected internal virtual TEntity FulfillPropertiesOn(TEntity entity) + { + try + { + if (entity == null) + return entity; + + var queries = Request.RequestUri.ParseQueryString(); + + if (queries == null || queries.Count <= 0) + return entity; + + foreach (string key in queries.AllKeys.Where(x => x.StartsWith(WebApiGlobal.QueryOption.Fulfill))) + { + string propertyName = key.Substring(WebApiGlobal.QueryOption.Fulfill.Length); + string queryValue = queries.Get(key); + + if (propertyName.HasValue() && queryValue.HasValue()) + { + var prop = FastProperty.GetProperty(entity.GetType(), propertyName); + if (prop != null) + { + var propertyValue = prop.GetValue(entity); + if (propertyValue == null) + { + object value = FulfillPropertyOn(entity, propertyName, queryValue); + + // there's no requirement to set a property value of null + if (value != null) + { + prop.SetValue(entity, value); + } + } + } + } + } + } + catch (Exception ex) + { + throw this.ExceptionUnprocessableEntity(ex.Message); + } + + return entity; + } + + protected internal virtual T ReadContent() + { + var formatters = ODataMediaTypeFormatters + .Create() + .Select(formatter => formatter.GetPerRequestFormatterInstance(typeof(T), Request, Request.Content.Headers.ContentType)); + + return Request.Content.ReadAsAsync(formatters).Result; + } + } + + #region Old WebApiEntityController + + //public abstract class WebApiEntityController : EntitySetController + // where TEntity : BaseEntity, new() + //{ + + // protected internal HttpResponseException ExceptionEntityNotFound(TKey key) + // { + // var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, + // WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + + // return new HttpResponseException(response); + // } + + // protected internal HttpResponseException ExceptionNotExpanded(Expression> path) + // { + // // NotFound cause of nullable properties + // var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, + // WebApiGlobal.Error.PropertyNotExpanded.FormatInvariant(path.ToString())); + + // return new HttpResponseException(response); + // } + + // public override HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) + // { + // if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/property") || + // odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/cast/property") || + // odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/unresolved")) + // { + // if (Request.Method == HttpMethod.Get || Request.Method == HttpMethod.Post) + // { + // return UnmappedGetProperty(odataPath); + // } + // } + // else if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation/key")) + // { + // if (Request.Method == HttpMethod.Get || Request.Method == HttpMethod.Post || Request.Method == HttpMethod.Delete) + // { + // // we ignore standard odata path cause they differ: + // // ~/entityset/key/$links/navigation (odata 3 "link"), ~/entityset/key/navigation/$ref (odata 4 "reference") + + // return UnmappedGetNavigation(odataPath); + // } + // } + // else if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation")) + // { + // if (Request.Method == HttpMethod.Delete) + // { + // return UnmappedGetNavigation(odataPath); + // } + // } + + // return base.HandleUnmappedRequest(odataPath); + // } + + // protected virtual internal HttpResponseMessage UnmappedGetProperty(ODataPath odataPath) + // { + // int key; + + // if (!odataPath.GetNormalizedKey(1, out key)) + // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoKeyFromPath); + + // var entity = GetEntityByKey(key); + + // if (entity == null) + // return Request.CreateErrorResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + + // FastProperty prop = null; + // string propertyName = null; + // var lastSegment = odataPath.Segments.Last(); + // var propertySegment = (lastSegment as PropertyAccessPathSegment); + + // if (propertySegment == null) + // propertyName = lastSegment.ToString(); + // else + // propertyName = propertySegment.PropertyName; + + // if (propertyName.HasValue()) + // prop = FastProperty.GetProperty(entity.GetType(), propertyName); + + // if (prop == null) + // return UnmappedGetProperty(entity, propertyName ?? ""); + + // var propertyValue = prop.GetValue(entity); + + // return Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); + // } + + // protected virtual internal HttpResponseMessage UnmappedGetProperty(TEntity entity, string propertyName) + // { + // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName)); + // } + + // protected virtual internal HttpResponseMessage UnmappedGetNavigation(ODataPath odataPath) + // { + // int key, relatedKey; + + // if (!odataPath.GetNormalizedKey(1, out key)) + // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoKeyFromPath); + + // var navigationProperty = odataPath.GetNavigation(2); + + // if (navigationProperty.IsEmpty()) + // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoNavigationFromPath); + + // if (!odataPath.GetNormalizedKey(3, out relatedKey) && Request.Method != HttpMethod.Delete) + // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoRelatedKeyFromPath); + + // var methodName = string.Concat("Navigation", navigationProperty); + // var methodInfo = GetType().GetMethod(methodName); + + // if (methodInfo != null) + // { + // HttpResponseMessage response = null; + + // this.ProcessEntity(() => + // { + // response = (HttpResponseMessage)methodInfo.Invoke(this, new object[] { key, relatedKey }); + // }); + + // return response; + // } + // return base.HandleUnmappedRequest(odataPath); + // } + + // /// + // /// Auto injected by Autofac + // /// + // public virtual IRepository Repository + // { + // get; + // set; + // } + + // /// + // /// Auto injected by Autofac + // /// + // public virtual TService Service + // { + // get; + // set; + // } + + // /// + // /// Auto injected by Autofac + // /// + // public virtual ICommonServices Services + // { + // get; + // set; + // } + + // public override IQueryable Get() + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // return this.GetEntitySet(); + // } + + // protected internal virtual IQueryable GetEntitySet() + // { + // return this.Repository.Table; + // } + + // protected internal virtual IQueryable GetExpandedEntitySet(Expression> path) + // { + // var query = GetEntitySet().Expand(path); + // return query; + // } + + // protected internal virtual IQueryable GetExpandedEntitySet(string properties) + // { + // var query = GetEntitySet(); + + // foreach (var property in properties.SplitSafe(",")) + // { + // query = query.Expand(property.Trim()); + // } + + // return query; + // } + + // protected override int GetKey(TEntity entity) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // return entity.Id; + // } + + // protected override TEntity GetEntityByKey(int key) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // return this.Repository.GetById(key); + // } + + // protected internal virtual TEntity GetEntityByKeyNotNull(int key) + // { + // var entity = GetEntityByKey(key); + + // if (entity == null) + // throw ExceptionEntityNotFound(key); + + // return entity; + // } + + // protected internal virtual SingleResult GetSingleResult(int key) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // return SingleResult.Create(GetEntitySet().Where(x => x.Id == key)); + // } + + // protected internal virtual TEntity GetExpandedEntity(int key, Expression> path) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // var query = GetExpandedEntitySet(path); + + // var entity = query.FirstOrDefault(x => x.Id == key); + + // if (entity == null) + // throw ExceptionEntityNotFound(key); + + // return entity; + // } + // protected internal virtual TEntity GetExpandedEntity(int key, string properties) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // var query = GetExpandedEntitySet(properties); + + // var entity = query.FirstOrDefault(x => x.Id == key); + + // if (entity == null) + // throw ExceptionEntityNotFound(key); + + // return entity; + // } + + // protected internal virtual TEntity GetExpandedEntity(int key, SingleResult result, string path) + // { + // var query = result.Queryable; + + // foreach (var property in path.SplitSafe(",")) + // { + // query = query.Expand(property.Trim()); + // } + + // var entity = query.FirstOrDefault(x => x.Id == key); + + // if (entity == null) + // throw ExceptionEntityNotFound(key); + + // return entity; + // } + + // protected internal virtual TProperty GetExpandedProperty(int key, Expression> path) + // { + // var entity = GetExpandedEntity(key, path); + + // var expression = path.CompileFast(PropertyCachingStrategy.EagerCached); + // var property = expression.Invoke(entity); + + // if (property == null) + // throw ExceptionNotExpanded(path); + + // return property; + // } + + // protected internal virtual IQueryable GetRelatedCollection( + // int key, + // Expression>> navigationProperty) + // { + // Guard.NotNull(navigationProperty, nameof(navigationProperty)); + + // var query = GetEntitySet().Where(x => x.Id.Equals(key)); + // return query.SelectMany(navigationProperty); + // } + + // protected internal virtual IQueryable GetRelatedCollection( + // int key, + // string navigationProperty) + // { + // Guard.NotEmpty(navigationProperty, nameof(navigationProperty)); + + // var ctx = (DbContext)Repository.Context; + // var product = GetEntityByKey(key); + // var entry = ctx.Entry(product); + // var query = entry.Collection(navigationProperty).Query(); + + // return query.Cast(); + // } + + // protected internal virtual SingleResult GetRelatedEntity( + // int key, + // Expression> navigationProperty) + // { + // Guard.NotNull(navigationProperty, nameof(navigationProperty)); + + // var query = GetEntitySet().Where(x => x.Id.Equals(key)).Select(navigationProperty); + // return SingleResult.Create(query); + // } + + // protected internal virtual SingleResult GetRelatedEntity( + // int key, + // string navigationProperty) + // { + // Guard.NotEmpty(navigationProperty, nameof(navigationProperty)); + + // var ctx = (DbContext)Repository.Context; + // var product = GetEntityByKey(key); + // var entry = ctx.Entry(product); + // var query = entry.Reference(navigationProperty).Query().Cast(); + + // return SingleResult.Create(query); + // } + + // public override HttpResponseMessage Post(TEntity entity) + // { + // var response = Request.CreateResponse(HttpStatusCode.OK, CreateEntity(entity)); + + // try + // { + // var entityUrl = Url.CreateODataLink( + // new EntitySetPathSegment(entity.GetType().Name.EnsureEndsWith("s")), + // new KeyValuePathSegment(entity.Id.ToString()) + // ); + + // response.Headers.Location = new Uri(entityUrl); + // } + // catch { } + + // return response; + // } + + // protected override TEntity CreateEntity(TEntity entity) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // if (entity == null) + // throw this.ExceptionBadRequest(WebApiGlobal.Error.NoDataToInsert); + + // Insert(FulfillPropertiesOn(entity)); + + // return entity; + // } + + // protected internal virtual void Insert(TEntity entity) + // { + // Repository.Insert(entity); + // } + + // public override HttpResponseMessage Put(int key, TEntity update) + // { + // return Request.CreateResponse(HttpStatusCode.OK, UpdateEntity(key, update)); + // } + + // protected override TEntity UpdateEntity(int key, TEntity update) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // var originalEntity = GetEntityByKeyNotNull(key); + + // var context = ((IObjectContextAdapter)this.Repository.Context).ObjectContext; + // var container = context.MetadataWorkspace.GetEntityContainer(context.DefaultContainerName, DataSpace.CSpace); + + // string entityName = typeof(TEntity).Name; + // string entitySetName = container.BaseEntitySets.First(x => x.ElementType.Name == entityName).Name; + + // update.Id = key; + // var entity = context.ApplyCurrentValues(entitySetName, update); + + // Update(FulfillPropertiesOn(entity)); + + // return entity; + // } + + // protected internal virtual void Update(TEntity entity) + // { + // Repository.Update(entity); + // } + + // public override HttpResponseMessage Patch(int key, Delta patch) + // { + // return Request.CreateResponse(HttpStatusCode.OK, PatchEntity(key, patch)); + // } + + // protected override TEntity PatchEntity(int key, Delta patch) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // var entity = GetEntityByKeyNotNull(key); + + // if (patch != null) + // patch.Patch(entity); + + // Update(FulfillPropertiesOn(entity)); + + // return entity; + // } + + // public override void Delete(int key) + // { + // if (!ModelState.IsValid) + // throw this.ExceptionInvalidModelState(); + + // var entity = GetEntityByKeyNotNull(key); + + // Delete(entity); + // } + + // protected internal virtual void Delete(TEntity entity) + // { + // Repository.Delete(entity); + // } + + // protected internal virtual object FulfillPropertyOn(TEntity entity, string propertyName, string queryValue) + // { + // var container = Services.Container; + + // if (propertyName.IsCaseInsensitiveEqual("Country")) + // { + // return container.Resolve().GetCountryByTwoOrThreeLetterIsoCode(queryValue); + // } + // else if (propertyName.IsCaseInsensitiveEqual("StateProvince")) + // { + // return container.Resolve().GetStateProvinceByAbbreviation(queryValue); + // } + // else if (propertyName.IsCaseInsensitiveEqual("Language")) + // { + // return container.Resolve().GetLanguageByCulture(queryValue); + // } + // else if (propertyName.IsCaseInsensitiveEqual("Currency")) + // { + // return container.Resolve().GetCurrencyByCode(queryValue); + // } + + // return null; + // } + + // protected internal virtual TEntity FulfillPropertiesOn(TEntity entity) + // { + // try + // { + // if (entity == null) + // return entity; + + // var queries = Request.RequestUri.ParseQueryString(); + + // if (queries == null || queries.Count <= 0) + // return entity; + + // foreach (string key in queries.AllKeys.Where(x => x.StartsWith(WebApiGlobal.QueryOption.Fulfill))) + // { + // string propertyName = key.Substring(WebApiGlobal.QueryOption.Fulfill.Length); + // string queryValue = queries.Get(key); + + // if (propertyName.HasValue() && queryValue.HasValue()) + // { + // var prop = FastProperty.GetProperty(entity.GetType(), propertyName); + // if (prop != null) + // { + // var propertyValue = prop.GetValue(entity); + // if (propertyValue == null) + // { + // object value = FulfillPropertyOn(entity, propertyName, queryValue); + + // // there's no requirement to set a property value of null + // if (value != null) + // { + // prop.SetValue(entity, value); + // } + // } + // } + // } + // } + // } + // catch (Exception ex) + // { + // throw this.ExceptionUnprocessableEntity(ex.Message); + // } + + // return entity; + // } + + // protected internal virtual T ReadContent() + // { + // var formatters = ODataMediaTypeFormatters.Create() + // .Select(formatter => formatter.GetPerRequestFormatterInstance(typeof(T), Request, Request.Content.Headers.ContentType)); + + // return Request.Content.ReadAsAsync(formatters).Result; + // } + //} + + #endregion + + #region Old Odata3 EntitySetController + + //[CLSCompliant(false)] + //[ODataNullValue] + //public abstract class EntitySetController : ODataController + //where TEntity : class + //{ + // /// Gets the OData path of the current request. + // public ODataPath ODataPath + // { + // get + // { + // return EntitySetControllerHelpers.GetODataPath(this); + // } + // } + + // /// Gets the OData query options of the current request. + // public ODataQueryOptions QueryOptions + // { + // get + // { + // return EntitySetControllerHelpers.CreateQueryOptions(this); + // } + // } + + // protected EntitySetController() + // { + // } + + // /// This method should be overridden to create a new entity in the entity set. + // /// The created entity. + // /// The entity to add to the entity set. + // protected internal virtual TEntity CreateEntity(TEntity entity) + // { + // throw EntitySetControllerHelpers.CreateEntityNotImplementedResponse(base.get_Request()); + // } + + // /// This method should be overridden to handle POST and PUT requests that attempt to create a link between two entities. + // /// The key of the entity with the navigation property. + // /// The name of the navigation property. + // /// The URI of the entity to link. + // [AcceptVerbs(new string[] { "POST", "PUT" })] + // public virtual void CreateLink([FromODataUri] TKey key, string navigationProperty, [FromBody] Uri link) + // { + // throw EntitySetControllerHelpers.CreateLinkNotImplementedResponse(base.get_Request(), navigationProperty); + // } + + // /// This method should be overriden to handle DELETE requests for deleting existing entities from the entity set. + // /// The entity key of the entity to delete. + // public virtual void Delete([FromODataUri] TKey key) + // { + // throw EntitySetControllerHelpers.DeleteEntityNotImplementedResponse(base.get_Request()); + // } + + // /// This method should be overridden to handle DELETE requests that attempt to break a relationship between two entities. + // /// The key of the entity with the navigation property. + // /// The name of the navigation property. + // /// The URI of the entity to remove from the navigation property. + // public virtual void DeleteLink([FromODataUri] TKey key, string navigationProperty, [FromBody] Uri link) + // { + // throw EntitySetControllerHelpers.DeleteLinkNotImplementedResponse(base.get_Request(), navigationProperty); + // } + + // /// This method should be overridden to handle DELETE requests that attempt to break a relationship between two entities. + // /// The key of the entity with the navigation property. + // /// The key of the related entity. + // /// The name of the navigation property. + // public virtual void DeleteLink([FromODataUri] TKey key, string relatedKey, string navigationProperty) + // { + // throw EntitySetControllerHelpers.DeleteLinkNotImplementedResponse(base.get_Request(), navigationProperty); + // } + + // /// This method should be overridden to handle GET requests that attempt to retrieve entities from the entity set. + // /// The matching entities from the entity set. + // public virtual IQueryable Get() + // { + // throw EntitySetControllerHelpers.GetNotImplementedResponse(base.get_Request()); + // } + + // /// Handles GET requests that attempt to retrieve an individual entity by key from the entity set. + // /// The response message to send back to the client. + // /// The entity key of the entity to retrieve. + // public virtual HttpResponseMessage Get([FromODataUri] TKey key) + // { + // TEntity entityByKey = this.GetEntityByKey(key); + // return EntitySetControllerHelpers.GetByKeyResponse(base.get_Request(), entityByKey); + // } + + // /// This method should be overridden to retrieve an entity by key from the entity set. + // /// The retrieved entity, or null if an entity with the specified entity key cannot be found in the entity set. + // /// The entity key of the entity to retrieve. + // protected internal virtual TEntity GetEntityByKey(TKey key) + // { + // throw EntitySetControllerHelpers.GetEntityByKeyNotImplementedResponse(base.get_Request()); + // } + + // /// This method should be overridden to get the entity key of the specified entity. + // /// The entity key value + // /// The entity. + // protected internal virtual TKey GetKey(TEntity entity) + // { + // throw EntitySetControllerHelpers.GetKeyNotImplementedResponse(base.get_Request()); + // } + + // /// This method should be overridden to handle all unmapped OData requests. + // /// The response message to send back to the client. + // /// The OData path of the request. + // [AcceptVerbs(new string[] { "GET", "POST", "PUT", "PATCH", "MERGE", "DELETE" })] + // public virtual HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) + // { + // throw EntitySetControllerHelpers.UnmappedRequestResponse(base.get_Request(), odataPath); + // } + + // /// Handles PATCH and MERGE requests to partially update a single entity in the entity set. + // /// The response message to send back to the client. + // /// The entity key of the entity to update. + // /// The patch representing the partial update. + // [AcceptVerbs(new string[] { "PATCH", "MERGE" })] + // public virtual HttpResponseMessage Patch([FromODataUri] TKey key, Delta patch) + // { + // TEntity tEntity = this.PatchEntity(key, patch); + // return EntitySetControllerHelpers.PatchResponse(base.get_Request(), tEntity); + // } + + // /// This method should be overridden to apply a partial update to an existing entity in the entity set. + // /// The updated entity. + // /// The entity key of the entity to update. + // /// The patch representing the partial update. + // protected internal virtual TEntity PatchEntity(TKey key, Delta patch) + // { + // throw EntitySetControllerHelpers.PatchEntityNotImplementedResponse(base.get_Request()); + // } + + // /// Handles POST requests that create new entities in the entity set. + // /// The response message to send back to the client. + // /// The entity to insert into the entity set. + // public virtual HttpResponseMessage Post([FromBody] TEntity entity) + // { + // TEntity tEntity = this.CreateEntity(entity); + // return EntitySetControllerHelpers.PostResponse(this, tEntity, this.GetKey(entity)); + // } + + // /// Handles PUT requests that attempt to replace a single entity in the entity set. + // /// The response message to send back to the client. + // /// The entity key of the entity to replace. + // /// The updated entity. + // public virtual HttpResponseMessage Put([FromODataUri] TKey key, [FromBody] TEntity update) + // { + // TEntity tEntity = this.UpdateEntity(key, update); + // return EntitySetControllerHelpers.PutResponse(base.get_Request(), tEntity); + // } + + // /// This method should be overridden to update an existing entity in the entity set. + // /// The updated entity. + // /// The entity key of the entity to update. + // /// The updated entity. + // protected internal virtual TEntity UpdateEntity(TKey key, TEntity update) + // { + // throw EntitySetControllerHelpers.UpdateEntityNotImplementedResponse(base.get_Request()); + // } + //} + + + //internal static class EntitySetControllerHelpers + //{ + // private const string PreferHeaderName = "Prefer"; + + // private const string PreferenceAppliedHeaderName = "Preference-Applied"; + + // private const string ReturnContentHeaderValue = "return-content"; + + // private const string ReturnNoContentHeaderValue = "return-no-content"; + + // public static HttpResponseException CreateEntityNotImplementedResponse(HttpRequestMessage request) + // { + // ODataError oDataError = new ODataError(); + // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedCreate); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; + // object[] objArray = new object[] { "POST" }; + // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static HttpResponseException CreateLinkNotImplementedResponse(HttpRequestMessage request, string navigationProperty) + // { + // ODataError oDataError = new ODataError(); + // string entitySetControllerUnsupportedCreateLink = SRResources.EntitySetControllerUnsupportedCreateLink; + // object[] objArray = new object[] { navigationProperty }; + // oDataError.set_Message(Error.Format(entitySetControllerUnsupportedCreateLink, objArray)); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnsupportedCreateLinkErrorCode); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static ODataQueryOptions CreateQueryOptions(ApiController controller) + // { + // ODataQueryContext oDataQueryContext = new ODataQueryContext(controller.get_Request().ODataProperties().Model, typeof(TEntity)); + // return new ODataQueryOptions(oDataQueryContext, controller.get_Request()); + // } + + // public static HttpResponseException DeleteEntityNotImplementedResponse(HttpRequestMessage request) + // { + // ODataError oDataError = new ODataError(); + // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedDelete); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; + // object[] objArray = new object[] { "DELETE" }; + // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static HttpResponseException DeleteLinkNotImplementedResponse(HttpRequestMessage request, string navigationProperty) + // { + // ODataError oDataError = new ODataError(); + // string entitySetControllerUnsupportedDeleteLink = SRResources.EntitySetControllerUnsupportedDeleteLink; + // object[] objArray = new object[] { navigationProperty }; + // oDataError.set_Message(Error.Format(entitySetControllerUnsupportedDeleteLink, objArray)); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnsupportedDeleteLinkErrorCode); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static HttpResponseMessage GetByKeyResponse(HttpRequestMessage request, TEntity entity) + // { + // if (entity == null) + // { + // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotFound); + // } + // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.OK, entity); + // } + + // public static HttpResponseException GetEntityByKeyNotImplementedResponse(HttpRequestMessage request) + // { + // ODataError oDataError = new ODataError(); + // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedGetByKey); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnsupportedGetByKeyErrorCode); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static HttpResponseException GetKeyNotImplementedResponse(HttpRequestMessage request) + // { + // ODataError oDataError = new ODataError(); + // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedGetKey); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; + // object[] objArray = new object[] { "POST" }; + // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static HttpResponseException GetNotImplementedResponse(HttpRequestMessage request) + // { + // ODataError oDataError = new ODataError(); + // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedGet); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; + // object[] objArray = new object[] { "GET" }; + // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static ODataPath GetODataPath(ApiController controller) + // { + // return controller.get_Request().ODataProperties().Path; + // } + + // public static HttpResponseException PatchEntityNotImplementedResponse(HttpRequestMessage request) + // { + // ODataError oDataError = new ODataError(); + // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedPatch); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; + // object[] objArray = new object[] { "PATCH" }; + // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static HttpResponseMessage PatchResponse(HttpRequestMessage request, TEntity patchedEntity) + // { + // if (!EntitySetControllerHelpers.RequestPrefersReturnContent(request)) + // { + // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NoContent); + // } + // HttpResponseMessage httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.OK, patchedEntity); + // httpResponseMessage.Headers.Add("Preference-Applied", "return-content"); + // return httpResponseMessage; + // } + + // public static HttpResponseMessage PostResponse(ApiController controller, TEntity createdEntity, TKey entityKey) + // { + // HttpResponseMessage httpResponseMessage = null; + // HttpRequestMessage request = controller.get_Request(); + // if (!EntitySetControllerHelpers.RequestPrefersReturnNoContent(request)) + // { + // httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.Created, createdEntity); + // } + // else + // { + // httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NoContent); + // httpResponseMessage.Headers.Add("Preference-Applied", "return-no-content"); + // } + // ODataPath path = request.ODataProperties().Path; + // if (path == null) + // { + // throw Error.InvalidOperation(SRResources.LocationHeaderMissingODataPath, new object[0]); + // } + // EntitySetPathSegment entitySetPathSegment = path.Segments.FirstOrDefault() as EntitySetPathSegment; + // if (entitySetPathSegment == null) + // { + // throw Error.InvalidOperation(SRResources.LocationHeaderDoesNotStartWithEntitySet, new object[0]); + // } + // UrlHelper url = controller.get_Url() ?? new UrlHelper(request); + // HttpResponseHeaders headers = httpResponseMessage.Headers; + // ODataPathSegment[] keyValuePathSegment = new ODataPathSegment[] { entitySetPathSegment, new KeyValuePathSegment(ODataUriUtils.ConvertToUriLiteral(entityKey, 2)) }; + // headers.Location = new Uri(url.CreateODataLink(keyValuePathSegment)); + // return httpResponseMessage; + // } + + // public static HttpResponseMessage PutResponse(HttpRequestMessage request, TEntity updatedEntity) + // { + // if (!EntitySetControllerHelpers.RequestPrefersReturnContent(request)) + // { + // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NoContent); + // } + // HttpResponseMessage httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.OK, updatedEntity); + // httpResponseMessage.Headers.Add("Preference-Applied", "return-content"); + // return httpResponseMessage; + // } + + // internal static bool RequestPrefersReturnContent(HttpRequestMessage request) + // { + // IEnumerable strs = null; + // if (!request.Headers.TryGetValues("Prefer", out strs)) + // { + // return false; + // } + // return strs.Contains("return-content"); + // } + + // internal static bool RequestPrefersReturnNoContent(HttpRequestMessage request) + // { + // IEnumerable strs = null; + // if (!request.Headers.TryGetValues("Prefer", out strs)) + // { + // return false; + // } + // return strs.Contains("return-no-content"); + // } + + // public static HttpResponseException UnmappedRequestResponse(HttpRequestMessage request, ODataPath odataPath) + // { + // ODataError oDataError = new ODataError(); + // string entitySetControllerUnmappedRequest = SRResources.EntitySetControllerUnmappedRequest; + // object[] pathTemplate = new object[] { odataPath.PathTemplate }; + // oDataError.set_Message(Error.Format(entitySetControllerUnmappedRequest, pathTemplate)); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnmappedRequestErrorCode); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + + // public static HttpResponseException UpdateEntityNotImplementedResponse(HttpRequestMessage request) + // { + // ODataError oDataError = new ODataError(); + // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedUpdate); + // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); + // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; + // object[] objArray = new object[] { "PUT" }; + // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); + // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); + // } + //} + + #endregion } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiExtension.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiExtension.cs index 300b11cce0..1813acf708 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiExtension.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiExtension.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; using System.Web.Http; using System.Web.Http.Dependencies; -using System.Web.Http.OData.Routing; using SmartStore.Utilities; namespace SmartStore.Web.Framework.WebApi @@ -144,34 +143,34 @@ public static T GetQueryStringValue(this ApiController apiController, string return defaultValue; } - public static bool GetNormalizedKey(this ODataPath odataPath, int segmentIndex, out int key) - { - if (odataPath.Segments.Count > segmentIndex) - { - string rawKey = (odataPath.Segments[segmentIndex] as KeyValuePathSegment).Value; - if (rawKey.HasValue()) - { - if (rawKey.StartsWith("'")) - rawKey = rawKey.Substring(1, rawKey.Length - 2); - - if (int.TryParse(rawKey, out key)) - return true; - } - } - key = 0; - return false; - } - - public static string GetNavigation(this ODataPath odataPath, int segmentIndex) - { - if (odataPath.Segments.Count > segmentIndex) - { - string navigationProperty = (odataPath.Segments[segmentIndex] as NavigationPathSegment).NavigationPropertyName; - - return navigationProperty; - } - return null; - } + // public static bool GetNormalizedKey(this ODataPath odataPath, int segmentIndex, out int key) + //{ + // if (odataPath.Segments.Count > segmentIndex) + // { + // string rawKey = (odataPath.Segments[segmentIndex] as KeyValuePathSegment).Value; + // if (rawKey.HasValue()) + // { + // if (rawKey.StartsWith("'")) + // rawKey = rawKey.Substring(1, rawKey.Length - 2); + + // if (int.TryParse(rawKey, out key)) + // return true; + // } + // } + // key = 0; + // return false; + //} + + //public static string GetNavigation(this ODataPath odataPath, int segmentIndex) + //{ + // if (odataPath.Segments.Count > segmentIndex) + // { + // string navigationProperty = (odataPath.Segments[segmentIndex] as NavigationPathSegment).NavigationPropertyName; + + // return navigationProperty; + // } + // return null; + //} public static void DeleteLocalFiles(this MultipartFormDataStreamProvider provider) { diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs index 331a2f65a3..034b0001a8 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs @@ -2,10 +2,11 @@ using System.Net.Http.Formatting; using System.Web.Http; using System.Web.Http.Cors; -using System.Web.Http.OData.Builder; -using System.Web.Http.OData.Extensions; -using System.Web.Http.OData.Routing; -using System.Web.Http.OData.Routing.Conventions; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Routing; +using Microsoft.AspNet.OData.Routing.Conventions; using Newtonsoft.Json; using SmartStore.Core.Infrastructure; using SmartStore.Web.Framework.WebApi.Configuration; @@ -26,8 +27,12 @@ public void Start() RoutingConventions = ODataRoutingConventions.CreateDefault() }; + config.EnableDependencyInjection(); config.DependencyResolver = new AutofacWebApiDependencyResolver(); + var odataFormatters = ODataMediaTypeFormatters.Create(); + config.Formatters.InsertRange(0, odataFormatters); + config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new WebApiContractResolver(config.Formatters.JsonFormatter); @@ -44,6 +49,8 @@ public void Start() var configPublisher = (IWebApiConfigurationPublisher)config.DependencyResolver.GetService(typeof(IWebApiConfigurationPublisher)); configPublisher.Configure(configBroadcaster); + config.Select().Expand().Filter().OrderBy().MaxTop(WebApiGlobal.DefaultMaxTop).Count(); + //config.Services.Insert(typeof(ModelBinderProvider), 0, // new SimpleModelBinderProvider(typeof(Address), new AddressModelBinder())); @@ -61,20 +68,20 @@ public void Start() new { version = "v1", controller = "Home", id = RouteParameter.Optional }); } } - catch (Exception) { } + catch { } try { - if (!config.Routes.ContainsKey(WebApiGlobal.RouteNameDefaultOdata)) - { - config.Routes.MapODataServiceRoute(WebApiGlobal.RouteNameDefaultOdata, WebApiGlobal.MostRecentOdataPath, - configBroadcaster.ModelBuilder.GetEdmModel(), new DefaultODataPathHandler(), configBroadcaster.RoutingConventions); - } - } - catch (Exception) { } - } + if (!config.Routes.ContainsKey(WebApiGlobal.RouteNameDefaultOdata)) + { + config.MapODataServiceRoute(WebApiGlobal.RouteNameDefaultOdata, WebApiGlobal.MostRecentOdataPath, + configBroadcaster.ModelBuilder.GetEdmModel(), new DefaultODataPathHandler(), configBroadcaster.RoutingConventions); + } + } + catch { } + } - public int Order + public int Order { get { return 0; } } diff --git a/src/Presentation/SmartStore.Web.Framework/packages.config b/src/Presentation/SmartStore.Web.Framework/packages.config index c678081470..26c77b0ca5 100644 --- a/src/Presentation/SmartStore.Web.Framework/packages.config +++ b/src/Presentation/SmartStore.Web.Framework/packages.config @@ -16,25 +16,38 @@ + - - - - + + + + + + + + + + + + + + + - + + \ No newline at end of file From 83671cad93a49fd5d0397af1fa0c638cadb12221 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Thu, 6 Aug 2020 13:26:31 +0200 Subject: [PATCH 002/695] API: using Microsoft.AspNet.OData 5.10.0 --- .../Controllers/OData/CurrenciesController.cs | 119 +++++++++++++++--- .../Controllers/OData/OrdersController.cs | 2 +- .../Controllers/OData/PicturesController.cs | 2 +- .../Controllers/OData/ProductsController.cs | 2 +- .../Extensions/MiscExtensions.cs | 2 +- .../Swagger/SwaggerOdataDocumentFilter.cs | 4 +- .../SmartStore.WebApi.csproj | 28 ++--- .../WebApiConfigurationProvider.cs | 2 +- src/Plugins/SmartStore.WebApi/packages.config | 22 +--- .../SmartStore.Web.Framework.csproj | 24 ++-- .../WebApiConfigurationBroadcaster.cs | 4 +- .../WebApi/OData/WebApiQueryableAttribute.cs | 16 ++- .../WebApi/WebApiEntityController.cs | 32 +++-- .../WebApi/WebApiStartupTask.cs | 27 ++-- .../SmartStore.Web.Framework/packages.config | 22 +--- 15 files changed, 182 insertions(+), 126 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs index c2cdc39ee3..86b5b2b10b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs @@ -1,5 +1,9 @@ -using System.Linq; +using System.Data.Entity.Infrastructure; +using System.Linq; +using System.Net; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -11,36 +15,115 @@ namespace SmartStore.WebApi.Controllers.OData { public class CurrenciesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Create)] - protected override void Insert(Currency entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] + public IQueryable Get() { - Service.InsertCurrency(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Update)] - protected override void Update(Currency entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] + public SingleResult Get(int key) { - Service.UpdateCurrency(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Delete)] - protected override void Delete(Currency entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Create)] + public IHttpActionResult Post(Currency entity) { - Service.DeleteCurrency(entity); + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + + entity = FulfillPropertiesOn(entity); + Service.InsertCurrency(entity); + + return Created(entity); } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] - public IQueryable Get() + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Update)] + public async Task Put(int key, Currency entity) { - return GetEntitySet(); + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + if (key != entity.Id) + { + return BadRequest(); + } + + entity = FulfillPropertiesOn(entity); + + try + { + Service.UpdateCurrency(entity); + } + catch (DbUpdateConcurrencyException) + { + if (await Repository.GetByIdAsync(key) == null) + { + return NotFound(); + } + else + { + throw; + } + } + + return Updated(entity); } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] - public SingleResult GetCurrency(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Update)] + public async Task Patch(int key, Delta model) { - return GetSingleResult(key); + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + + var entity = await Repository.GetByIdAsync(key); + if (entity == null) + { + return NotFound(); + } + + model?.Patch(entity); + entity = FulfillPropertiesOn(entity); + + try + { + Service.UpdateCurrency(entity); + } + catch (DbUpdateConcurrencyException) + { + if (await Repository.GetByIdAsync(key) == null) + { + return NotFound(); + } + else + { + throw; + } + } + + return Updated(entity); + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Delete)] + public async Task Delete(int key) + { + var entity = await Repository.GetByIdAsync(key); + if (entity == null) + { + return NotFound(); + } + + Service.DeleteCurrency(entity); + + return StatusCode(HttpStatusCode.NoContent); } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index eef665f97d..e9ad7ea3a6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Net.Http; using System.Web.Http; -using Microsoft.AspNet.OData; +using System.Web.OData; using SmartStore.Core.Domain.Common; using SmartStore.Core.Domain.Customers; using SmartStore.Core.Domain.Orders; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs index c92054c8ba..bad29f51be 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs @@ -4,7 +4,7 @@ using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; -using Microsoft.AspNet.OData; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Media; using SmartStore.Services.Media; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index 536eb86889..c606b90257 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -5,7 +5,7 @@ using System.Net.Http; using System.Web.Http; using System.Web.Http.ModelBinding; -using Microsoft.AspNet.OData; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Domain.Discounts; diff --git a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs index 834e98b1cf..2b9a045eff 100644 --- a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs +++ b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs @@ -1,6 +1,6 @@ using System.Text; using System.Web.Mvc; -using Microsoft.AspNet.OData; +using System.Web.OData; using SmartStore.Core.Infrastructure; using SmartStore.Services.Localization; diff --git a/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs b/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs index 15359e30eb..1b5d7065a7 100644 --- a/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs +++ b/src/Plugins/SmartStore.WebApi/Services/Swagger/SwaggerOdataDocumentFilter.cs @@ -3,8 +3,8 @@ using System.Reflection; using System.Web.Http; using System.Web.Http.Description; -using Microsoft.AspNet.OData; -using Microsoft.AspNet.OData.Routing; +using System.Web.OData; +using System.Web.OData.Routing; using Swashbuckle.Swagger; namespace SmartStore.WebApi.Services.Swagger diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 9a4a662f07..ebe283312f 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -103,31 +103,19 @@ ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll False - - ..\..\packages\Microsoft.AspNet.OData.7.4.1\lib\net45\Microsoft.AspNet.OData.dll - True - ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - - ..\..\packages\Microsoft.Extensions.DependencyInjection.1.0.0\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll - True - - - ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.0.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + ..\..\packages\Microsoft.OData.Core.6.15.0\lib\portable-net45+win+wpa81\Microsoft.OData.Core.dll True - - ..\..\packages\Microsoft.OData.Core.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll + + ..\..\packages\Microsoft.OData.Edm.6.15.0\lib\portable-net45+win+wpa81\Microsoft.OData.Edm.dll True - - ..\..\packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll - True - - - ..\..\packages\Microsoft.Spatial.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll + + ..\..\packages\Microsoft.Spatial.6.15.0\lib\portable-net45+win+wpa81\Microsoft.Spatial.dll True @@ -186,6 +174,10 @@ ..\..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll False + + ..\..\packages\Microsoft.AspNet.OData.5.10.0\lib\net45\System.Web.OData.dll + True + ..\..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll False diff --git a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs index ce90a72f30..971baef874 100644 --- a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs +++ b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using Microsoft.AspNet.OData.Builder; +using System.Web.OData.Builder; using SmartStore.Core.Domain.Blogs; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Common; diff --git a/src/Plugins/SmartStore.WebApi/packages.config b/src/Plugins/SmartStore.WebApi/packages.config index ff71ebcf50..df454e7331 100644 --- a/src/Plugins/SmartStore.WebApi/packages.config +++ b/src/Plugins/SmartStore.WebApi/packages.config @@ -6,7 +6,7 @@ - + @@ -14,24 +14,10 @@ - - - - - + + + - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index 27cd2a80c5..7c046c61c1 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -113,23 +113,14 @@ ..\..\packages\LibSassHost.1.2.2\lib\net45\LibSassHost.dll - - ..\..\packages\Microsoft.AspNet.OData.7.4.1\lib\net45\Microsoft.AspNet.OData.dll + + ..\..\packages\Microsoft.OData.Core.6.15.0\lib\portable-net45+win+wpa81\Microsoft.OData.Core.dll - - ..\..\packages\Microsoft.Extensions.DependencyInjection.1.0.0\lib\netstandard1.1\Microsoft.Extensions.DependencyInjection.dll + + ..\..\packages\Microsoft.OData.Edm.6.15.0\lib\portable-net45+win+wpa81\Microsoft.OData.Edm.dll - - ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.0.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\..\packages\Microsoft.OData.Core.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll - - - ..\..\packages\Microsoft.OData.Edm.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll - - - ..\..\packages\Microsoft.Spatial.7.6.1\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll + + ..\..\packages\Microsoft.Spatial.6.15.0\lib\portable-net45+win+wpa81\Microsoft.Spatial.dll True @@ -177,6 +168,9 @@ ..\..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll + + ..\..\packages\Microsoft.AspNet.OData.5.10.0\lib\net45\System.Web.OData.dll + False ..\..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs index 36a8fa781f..2074c164b1 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Configuration/WebApiConfigurationBroadcaster.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Web.Http; -using Microsoft.AspNet.OData.Builder; -using Microsoft.AspNet.OData.Routing.Conventions; +using System.Web.OData.Builder; +using System.Web.OData.Routing.Conventions; namespace SmartStore.Web.Framework.WebApi.Configuration { diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs index 45d2e50481..424f52df82 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs @@ -3,11 +3,15 @@ using System.Net.Http; using System.Web.Http; using System.Web.Http.Filters; -using Microsoft.AspNet.OData; +using System.Web.OData; using SmartStore.Web.Framework.WebApi.Caching; namespace SmartStore.Web.Framework.WebApi.OData { + /// + /// The [EnableQuery] attribute enables clients to modify the query, by using query options such as $filter, $sort, and $page. + /// + /// public class WebApiQueryableAttribute : EnableQueryAttribute { public bool PagingOptional { get; set; } @@ -15,7 +19,9 @@ public class WebApiQueryableAttribute : EnableQueryAttribute protected virtual bool MissingClientPaging(HttpActionExecutedContext actionExecutedContext) { if (PagingOptional) + { return false; + } try { @@ -49,9 +55,9 @@ protected virtual bool MissingClientPaging(HttpActionExecutedContext actionExecu return true; } } - catch (Exception exception) + catch (Exception ex) { - exception.Dump(); + ex.Dump(); } return false; @@ -59,8 +65,8 @@ protected virtual bool MissingClientPaging(HttpActionExecutedContext actionExecu public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { - //if (MissingClientPaging(actionExecutedContext)) - // return; + if (MissingClientPaging(actionExecutedContext)) + return; base.OnActionExecuted(actionExecutedContext); } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index d5b9d88c19..034bdc8ac8 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -6,13 +6,13 @@ using System.Net; using System.Net.Http; using System.Web.Http; +using System.Web.OData; +using System.Web.OData.Formatter; //using System.Web.Http.OData; //using System.Web.Http.OData.Extensions; //using System.Web.Http.OData.Formatter; //using System.Web.Http.OData.Routing; using Autofac; -using Microsoft.AspNet.OData; -using Microsoft.AspNet.OData.Formatter; using SmartStore.ComponentModel; using SmartStore.Core; using SmartStore.Core.Data; @@ -25,10 +25,13 @@ namespace SmartStore.Web.Framework.WebApi public abstract class WebApiEntityController : ODataController where TEntity : BaseEntity, new() { - // TODO: overrides !!!??? + // TODO: Implement custom routing convention(s): // public override HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) + + // TODO: Needs to be handled by the respective controller: // protected override int GetKey(TEntity entity) // protected override TEntity GetEntityByKey(int key) + // public override HttpResponseMessage Post(TEntity entity) // protected override TEntity CreateEntity(TEntity entity) // public override HttpResponseMessage Put(int key, TEntity update) @@ -37,18 +40,21 @@ public abstract class WebApiEntityController : ODataControlle // protected override TEntity PatchEntity(int key, Delta patch) // public override void Delete(int key) + // TODO: + // XML serialization issues. + /// - /// Auto injected by Autofac + /// Auto injected by Autofac. /// public virtual IRepository Repository { get; set; } /// - /// Auto injected by Autofac + /// Auto injected by Autofac. /// public virtual TService Service { get; set; } /// - /// Auto injected by Autofac + /// Auto injected by Autofac. /// public virtual ICommonServices Services { get; set; } @@ -106,9 +112,19 @@ protected internal virtual TEntity GetEntityByKeyNotNull(int key) protected internal virtual SingleResult GetSingleResult(int key) { if (!ModelState.IsValid) + { throw this.ExceptionInvalidModelState(); + } - return SingleResult.Create(GetEntitySet().Where(x => x.Id == key)); + var entity = GetEntitySet().FirstOrDefault(x => x.Id == key); + + return GetSingleResult(entity); + //return SingleResult.Create(GetEntitySet().Where(x => x.Id == key)); + } + + protected internal virtual SingleResult GetSingleResult(TEntity entity) + { + return SingleResult.Create(new[] { entity }.AsQueryable()); } protected internal virtual TEntity GetExpandedEntity(int key, Expression> path) @@ -809,7 +825,7 @@ protected internal virtual T ReadContent() #endregion - #region Old Odata3 EntitySetController + #region Old OData3 EntitySetController //[CLSCompliant(false)] //[ODataNullValue] diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs index 034b0001a8..04edd4fa8c 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs @@ -1,12 +1,11 @@ -using System; -using System.Net.Http.Formatting; +using System.Net.Http.Formatting; using System.Web.Http; using System.Web.Http.Cors; -using Microsoft.AspNet.OData.Builder; -using Microsoft.AspNet.OData.Extensions; -using Microsoft.AspNet.OData.Formatter; -using Microsoft.AspNet.OData.Routing; -using Microsoft.AspNet.OData.Routing.Conventions; +using System.Web.OData.Builder; +using System.Web.OData.Extensions; +using System.Web.OData.Formatter; +using System.Web.OData.Routing; +using System.Web.OData.Routing.Conventions; using Newtonsoft.Json; using SmartStore.Core.Infrastructure; using SmartStore.Web.Framework.WebApi.Configuration; @@ -15,8 +14,10 @@ namespace SmartStore.Web.Framework.WebApi { public class WebApiStartupTask : IApplicationStart - { - public void Start() + { + public int Order => 0; + + public void Start() { var config = GlobalConfiguration.Configuration; @@ -27,7 +28,6 @@ public void Start() RoutingConventions = ODataRoutingConventions.CreateDefault() }; - config.EnableDependencyInjection(); config.DependencyResolver = new AutofacWebApiDependencyResolver(); var odataFormatters = ODataMediaTypeFormatters.Create(); @@ -49,8 +49,6 @@ public void Start() var configPublisher = (IWebApiConfigurationPublisher)config.DependencyResolver.GetService(typeof(IWebApiConfigurationPublisher)); configPublisher.Configure(configBroadcaster); - config.Select().Expand().Filter().OrderBy().MaxTop(WebApiGlobal.DefaultMaxTop).Count(); - //config.Services.Insert(typeof(ModelBinderProvider), 0, // new SimpleModelBinderProvider(typeof(Address), new AddressModelBinder())); @@ -80,10 +78,5 @@ public void Start() } catch { } } - - public int Order - { - get { return 0; } - } } } diff --git a/src/Presentation/SmartStore.Web.Framework/packages.config b/src/Presentation/SmartStore.Web.Framework/packages.config index 26c77b0ca5..d2da9a8e5e 100644 --- a/src/Presentation/SmartStore.Web.Framework/packages.config +++ b/src/Presentation/SmartStore.Web.Framework/packages.config @@ -16,7 +16,7 @@ - + @@ -24,30 +24,16 @@ - - - - - + + + - - - - - - - - - - - - \ No newline at end of file From a8e958383722b45530ee0b12bbc50584236bf8ad Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Thu, 6 Aug 2020 16:14:43 +0200 Subject: [PATCH 003/695] API: CurrenciesController now shows a simple OData4 implementation --- .../Controllers/OData/CurrenciesController.cs | 89 ++--------------- .../WebApi/WebApiEntityController.cs | 97 +++++++++++++++++++ 2 files changed, 106 insertions(+), 80 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs index 86b5b2b10b..6abbd30456 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs @@ -1,6 +1,4 @@ -using System.Data.Entity.Infrastructure; -using System.Linq; -using System.Net; +using System.Linq; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -32,98 +30,29 @@ public SingleResult Get(int key) [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Create)] public IHttpActionResult Post(Currency entity) { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - entity = FulfillPropertiesOn(entity); - Service.InsertCurrency(entity); - - return Created(entity); + var result = Insert(entity, () => Service.InsertCurrency(entity)); + return result; } [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Update)] public async Task Put(int key, Currency entity) { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - if (key != entity.Id) - { - return BadRequest(); - } - - entity = FulfillPropertiesOn(entity); - - try - { - Service.UpdateCurrency(entity); - } - catch (DbUpdateConcurrencyException) - { - if (await Repository.GetByIdAsync(key) == null) - { - return NotFound(); - } - else - { - throw; - } - } - - return Updated(entity); + var result = await UpdateAsync(entity, key, () => Service.UpdateCurrency(entity)); + return result; } [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Update)] public async Task Patch(int key, Delta model) { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - var entity = await Repository.GetByIdAsync(key); - if (entity == null) - { - return NotFound(); - } - - model?.Patch(entity); - entity = FulfillPropertiesOn(entity); - - try - { - Service.UpdateCurrency(entity); - } - catch (DbUpdateConcurrencyException) - { - if (await Repository.GetByIdAsync(key) == null) - { - return NotFound(); - } - else - { - throw; - } - } - - return Updated(entity); + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateCurrency(entity)); + return result; } [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Delete)] public async Task Delete(int key) { - var entity = await Repository.GetByIdAsync(key); - if (entity == null) - { - return NotFound(); - } - - Service.DeleteCurrency(entity); - - return StatusCode(HttpStatusCode.NoContent); + var result = await DeleteAsync(key, entity => Service.DeleteCurrency(entity)); + return result; } } } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index 034bdc8ac8..25a77960fc 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; using System.Data.Entity; +using System.Data.Entity.Infrastructure; using System.Linq; using System.Linq.Expressions; using System.Net; using System.Net.Http; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using System.Web.OData.Formatter; @@ -240,6 +242,101 @@ protected internal virtual void Delete(TEntity entity) Repository.Delete(entity); } + protected internal virtual IHttpActionResult Insert(TEntity entity, Action insert) + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + + entity = FulfillPropertiesOn(entity); + insert(); + + return Created(entity); + } + + protected internal virtual async Task UpdateAsync(TEntity entity, int key, Action update) + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + if (key != entity.Id) + { + return BadRequest($"Missing or differing key {key}."); + } + + entity = FulfillPropertiesOn(entity); + + try + { + update(); + } + catch (DbUpdateConcurrencyException) + { + if (await Repository.GetByIdAsync(key) == null) + { + return NotFound(); + } + else + { + throw; + } + } + + // Returns HTTP 204 No Content by default. + // Consumers can choose response through "Prefer" header. + return Updated(entity); + } + + protected internal virtual async Task PartiallyUpdateAsync(int key, Delta model, Action update) + { + if (!ModelState.IsValid) + { + return BadRequest(ModelState); + } + + var entity = await Repository.GetByIdAsync(key); + if (entity == null) + { + return NotFound(); + } + + model?.Patch(entity); + entity = FulfillPropertiesOn(entity); + + try + { + update(entity); + } + catch (DbUpdateConcurrencyException) + { + if (await Repository.GetByIdAsync(key) == null) + { + return NotFound(); + } + else + { + throw; + } + } + + return Updated(entity); + } + + protected internal virtual async Task DeleteAsync(int key, Action delete) + { + var entity = await Repository.GetByIdAsync(key); + if (entity == null) + { + return NotFound(); + } + + delete(entity); + + return StatusCode(HttpStatusCode.NoContent); + } + protected internal virtual object FulfillPropertyOn(TEntity entity, string propertyName, string queryValue) { var container = Services.Container; From 707d07823c10ab4b1c7ec1e56b6a0115dc94c840 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Thu, 6 Aug 2020 21:38:53 +0200 Subject: [PATCH 004/695] API: Allow OData actions and functions without the need for namespaces (backward compatibility) --- .../SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs index 04edd4fa8c..c938463ecd 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs @@ -46,6 +46,9 @@ public void Start() config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; + // Allow OData actions and functions without the need for namespaces (OData V3 backward compatibility). + config.EnableUnqualifiedNameCall(true); + var configPublisher = (IWebApiConfigurationPublisher)config.DependencyResolver.GetService(typeof(IWebApiConfigurationPublisher)); configPublisher.Configure(configBroadcaster); From f53b2f55d48ce67b3e2568a2f2c25681ff5f2007 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Fri, 7 Aug 2020 16:35:27 +0200 Subject: [PATCH 005/695] API: CRUD endpoints refactoring due to removal of EntitySetController (in progress) --- .../Controllers/OData/AddressesController.cs | 106 ++++++++++++------ .../OData/BlogCommentsController.cs | 93 ++++++++++----- .../Controllers/OData/BlogPostsController.cs | 82 ++++++++++---- .../Controllers/OData/CategoriesController.cs | 80 +++++++++---- .../Controllers/OData/CountriesController.cs | 49 +++++--- .../OData/CustomerRoleMappingsController.cs | 42 +++++-- .../OData/CustomerRolesController.cs | 77 +++++++++---- .../Controllers/OData/CustomersController.cs | 87 +++++++++----- .../OData/DeliveryTimesController.cs | 48 +++++--- .../Controllers/OData/DiscountsController.cs | 49 +++++--- .../Controllers/OData/DownloadsController.cs | 48 +++++--- .../OData/GenericAttributesController.cs | 38 +++++-- .../Controllers/OData/LanguagesController.cs | 48 +++++--- .../OData/LocalizedPropertiesController.cs | 41 ++++++- .../OData/ManufacturersController.cs | 76 +++++++++---- .../OData/MeasureDimensionsController.cs | 48 +++++--- .../OData/MeasureWeightsController.cs | 42 ++++++- .../NewsLetterSubscriptionsController.cs | 80 +++++++++---- .../Controllers/OData/OrderItemsController.cs | 53 ++++++--- .../Controllers/OData/OrderNotesController.cs | 59 +++++++++- .../Controllers/OData/OrdersController.cs | 44 +++++--- .../OData/PaymentMethodsController.cs | 51 ++++++--- .../ProductAttributeOptionsController.cs | 54 ++++++--- .../ProductAttributeOptionsSetsController.cs | 51 ++++++--- .../OData/ProductAttributesController.cs | 51 ++++++--- .../OData/ProductBundleItemsController.cs | 54 ++++++--- .../OData/ProductCategoriesController.cs | 57 +++++++--- .../OData/ProductManufacturersController.cs | 57 +++++++--- .../OData/ProductPicturesController.cs | 57 +++++++--- .../Controllers/OData/ProductsController.cs | 85 ++++++++++---- .../Extensions/MiscExtensions.cs | 23 ++-- .../WebApi/WebApiEntityController.cs | 1 + .../WebApi/WebApiStartupTask.cs | 2 + 33 files changed, 1350 insertions(+), 483 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs index 10d8ef940c..1eef895022 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs @@ -1,6 +1,8 @@ using System; using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Data; using SmartStore.Core.Domain.Common; using SmartStore.Core.Domain.Directory; @@ -28,55 +30,71 @@ public AddressesController( _eventPublisher = eventPublisher; } - private void PublishOrderUpdated(int addressId) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IQueryable
Get() { - this.ProcessEntity(() => - { - if (addressId != 0) - { - var orders = _orderRepository.Value.TableUntracked - .Where(x => x.BillingAddressId == addressId || x.ShippingAddressId == addressId) - .ToList(); - - foreach (var order in orders) - { - _eventPublisher.Value.PublishOrderUpdated(order); - } - } - }); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Customer.Create)] - protected override void Insert(Address entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public SingleResult
Get(int key) { - Service.InsertAddress(entity); - PublishOrderUpdated(entity.Id); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Customer.Update)] - protected override void Update(Address entity) + [WebApiAuthenticate(Permission = Permissions.Customer.Create)] + public IHttpActionResult Post(Address entity) { - Service.UpdateAddress(entity); - PublishOrderUpdated(entity.Id); + var result = Insert(entity, () => + { + Service.InsertAddress(entity); + PublishOrderUpdated(entity.Id); + }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Customer.Delete)] - protected override void Delete(Address entity) + [WebApiAuthenticate(Permission = Permissions.Customer.Update)] + public async Task Put(int key, Address entity) { - int entityId = (entity == null ? 0 : entity.Id); + var result = await UpdateAsync(entity, key, () => + { + Service.UpdateAddress(entity); + PublishOrderUpdated(entity.Id); + }); - Service.DeleteAddress(entity); - PublishOrderUpdated(entityId); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult
GetAddress(int key) + [WebApiAuthenticate(Permission = Permissions.Customer.Update)] + public async Task Patch(int key, Delta
model) { - return GetSingleResult(key); + var result = await PartiallyUpdateAsync(key, model, entity => + { + Service.UpdateAddress(entity); + PublishOrderUpdated(entity.Id); + }); + + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Customer.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => + { + var entityId = entity?.Id ?? 0; + + Service.DeleteAddress(entity); + PublishOrderUpdated(entityId); + }); + + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] @@ -91,5 +109,27 @@ public SingleResult GetStateProvince(int key) { return GetRelatedEntity(key, x => x.StateProvince); } + + #endregion + + private void PublishOrderUpdated(int addressId) + { + if (addressId == 0) + { + return; + } + + this.ProcessEntity(() => + { + var orders = _orderRepository.Value.TableUntracked + .Where(x => x.BillingAddressId == addressId || x.ShippingAddressId == addressId) + .ToList(); + + foreach (var order in orders) + { + _eventPublisher.Value.PublishOrderUpdated(order); + } + }); + } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs index fb05076f75..7fbdcc6651 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs @@ -1,6 +1,8 @@ using System; using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Data; using SmartStore.Core.Domain.Blogs; using SmartStore.Core.Domain.Customers; @@ -26,16 +28,6 @@ public BlogCommentsController( _blogService = blogService; } - private void FulfillCrudOperation(BlogComment entity) - { - this.ProcessEntity(() => - { - var blogPost = _blogService.Value.GetBlogPostById(entity.BlogPostId); - - _blogService.Value.UpdateCommentTotals(blogPost); - }); - } - protected override IQueryable GetEntitySet() { var query = _contentRepository.Table @@ -45,38 +37,73 @@ protected override IQueryable GetEntitySet() return query; } - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Create)] - protected override void Insert(BlogComment entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] + public IQueryable Get() { - Service.InsertCustomerContent(entity); + return GetEntitySet(); + } - FulfillCrudOperation(entity); + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Update)] - protected override void Update(BlogComment entity) + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Create)] + public IHttpActionResult Post(BlogComment entity) { - Service.UpdateCustomerContent(entity); + var result = Insert(entity, () => + { + Service.InsertCustomerContent(entity); + UpdateCommentTotals(entity); + }); - FulfillCrudOperation(entity); + return result; } - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Delete)] - protected override void Delete(BlogComment entity) + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Update)] + public async Task Put(int key, BlogComment entity) { - Service.DeleteCustomerContent(entity); + var result = await UpdateAsync(entity, key, () => + { + Service.UpdateCustomerContent(entity); + + // Actually not necessary, but does not hurt in terms of synchronization. + UpdateCommentTotals(entity); + }); - FulfillCrudOperation(entity); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public SingleResult GetBlogComment(int key) + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Update)] + public async Task Patch(int key, Delta model) { - return GetSingleResult(key); + var result = await PartiallyUpdateAsync(key, model, entity => + { + Service.UpdateCustomerContent(entity); + + // Actually not necessary, but does not hurt in terms of synchronization. + UpdateCommentTotals(entity); + }); + + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => + { + Service.DeleteCustomerContent(entity); + UpdateCommentTotals(entity); + }); + + return result; } - // Navigation properties. + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] @@ -84,5 +111,17 @@ public SingleResult GetBlogPost(int key) { return GetRelatedEntity(key, x => x.BlogPost); } + + #endregion + + private void UpdateCommentTotals(BlogComment entity) + { + this.ProcessEntity(() => + { + var blogPost = _blogService.Value.GetBlogPostById(entity.BlogPostId); + + _blogService.Value.UpdateCommentTotals(blogPost); + }); + } } } \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs index 1f01560194..2f5c151f3e 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs @@ -1,6 +1,8 @@ using System; using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Blogs; using SmartStore.Core.Domain.Localization; using SmartStore.Core.Security; @@ -31,42 +33,80 @@ orderby x.CreatedOnUtc descending return query; } - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Create)] - protected override void Insert(BlogPost entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] + public IQueryable Get() { - Service.InsertBlogPost(entity); + return GetEntitySet(); + } - this.ProcessEntity(() => + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Create)] + public IHttpActionResult Post(BlogPost entity) + { + var result = Insert(entity, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Title); + Service.InsertBlogPost(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Title); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Update)] - protected override void Update(BlogPost entity) + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Update)] + public async Task Put(int key, BlogPost entity) { - Service.UpdateBlogPost(entity); - - this.ProcessEntity(() => + var result = await UpdateAsync(entity, key, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Title); + Service.UpdateBlogPost(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Title); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Delete)] - protected override void Delete(BlogPost entity) + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Update)] + public async Task Patch(int key, Delta model) { - Service.DeleteBlogPost(entity); + var result = await PartiallyUpdateAsync(key, model, entity => + { + Service.UpdateBlogPost(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Title); + }); + }); + + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public SingleResult GetBlogPost(int key) + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Delete)] + public async Task Delete(int key) { - return GetSingleResult(key); + var result = await DeleteAsync(key, entity => + { + Service.DeleteBlogPost(entity); + }); + + return result; } - // Navigation properties. + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] @@ -81,5 +121,7 @@ public IQueryable GetBlogComments(int key) { return GetRelatedCollection(key, x => x.BlogComments); } - } + + #endregion + } } \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs index c81a3d9937..da335af975 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs @@ -1,6 +1,8 @@ using System; using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Discounts; using SmartStore.Core.Security; @@ -31,42 +33,80 @@ from x in this.Repository.Table return query; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Create)] - protected override void Insert(Category entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] + public IQueryable Get() { - Service.InsertCategory(entity); + return GetEntitySet(); + } - this.ProcessEntity(() => + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Create)] + public IHttpActionResult Post(Category entity) + { + var result = Insert(entity, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Name); + Service.InsertCategory(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Update)] - protected override void Update(Category entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Update)] + public async Task Put(int key, Category entity) { - Service.UpdateCategory(entity); - - this.ProcessEntity(() => + var result = await UpdateAsync(entity, key, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Name); + Service.UpdateCategory(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Delete)] - protected override void Delete(Category entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Update)] + public async Task Patch(int key, Delta model) { - Service.DeleteCategory(entity); + var result = await PartiallyUpdateAsync(key, model, entity => + { + Service.UpdateCategory(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); + }); + + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] - public SingleResult GetCategory(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Delete)] + public async Task Delete(int key) { - return GetSingleResult(key); + var result = await DeleteAsync(key, entity => + { + Service.DeleteCategory(entity); + }); + + return result; } - // Navigation properties. + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] @@ -74,5 +114,7 @@ public IQueryable GetAppliedDiscounts(int key) { return GetRelatedCollection(key, x => x.AppliedDiscounts); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs index 3d96ae6b87..0c0599a620 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -11,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class CountriesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Create)] - protected override void Insert(Country entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] + public IQueryable Get() { - Service.InsertCountry(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Update)] - protected override void Update(Country entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] + public SingleResult Get(int key) { - Service.UpdateCountry(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Delete)] - protected override void Delete(Country entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Create)] + public IHttpActionResult Post(Country entity) { - Service.DeleteCountry(entity); + var result = Insert(entity, () => Service.InsertCountry(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public SingleResult GetCountry(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Update)] + public async Task Put(int key, Country entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateCountry(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateCountry(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteCountry(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] @@ -44,5 +63,7 @@ public IQueryable GetStateProvinces(int key) { return GetRelatedCollection(key, x => x.StateProvinces); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs index aaaafb42e0..9c21dc55cf 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Customers; using SmartStore.Core.Security; using SmartStore.Services.Customers; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class CustomerRoleMappingsController : WebApiEntityController { + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] + public IQueryable Get() + { + return GetEntitySet(); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + [WebApiAuthenticate(Permission = Permissions.Customer.EditRole)] - protected override void Insert(CustomerRoleMapping entity) + public IHttpActionResult Post(CustomerRoleMapping entity) { - Service.InsertCustomerRoleMapping(entity); + var result = Insert(entity, () => Service.InsertCustomerRoleMapping(entity)); + return result; } [WebApiAuthenticate(Permission = Permissions.Customer.EditRole)] - protected override void Update(CustomerRoleMapping entity) + public async Task Put(int key, CustomerRoleMapping entity) { - Service.UpdateCustomerRoleMapping(entity); + var result = await UpdateAsync(entity, key, () => Service.UpdateCustomerRoleMapping(entity)); + return result; } [WebApiAuthenticate(Permission = Permissions.Customer.EditRole)] - protected override void Delete(CustomerRoleMapping entity) + public async Task Patch(int key, Delta model) { - Service.DeleteCustomerRoleMapping(entity); + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateCustomerRoleMapping(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public SingleResult GetCustomerRoleMapping(int key) + [WebApiAuthenticate(Permission = Permissions.Customer.EditRole)] + public async Task Delete(int key) { - return GetSingleResult(key); + var result = await DeleteAsync(key, entity => Service.DeleteCustomerRoleMapping(entity)); + return result; } #region Navigation properties diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs index 9d52e76410..8bf7acbd14 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Customers; using SmartStore.Core.Security; using SmartStore.Services.Customers; @@ -10,39 +13,73 @@ namespace SmartStore.WebApi.Controllers.OData { public class CustomerRolesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Customer.Role.Create)] - protected override void Insert(CustomerRole entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] + public IQueryable Get() + { + return GetEntitySet(); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Create)] + public IHttpActionResult Post(CustomerRole entity) { - Service.InsertCustomerRole(entity); + var result = Insert(entity, () => Service.InsertCustomerRole(entity)); + return result; } - [WebApiAuthenticate(Permission = Permissions.Customer.Role.Update)] - protected override void Update(CustomerRole entity) + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Update)] + public async Task Put(int key, CustomerRole entity) { - if (entity != null && entity.IsSystemRole) + var result = await UpdateAsync(entity, key, () => { - throw this.ExceptionForbidden(); - } + if (entity != null && entity.IsSystemRole) + { + throw this.ExceptionForbidden(); + } + + Service.UpdateCustomerRole(entity); + }); - Service.UpdateCustomerRole(entity); + return result; } - [WebApiAuthenticate(Permission = Permissions.Customer.Role.Delete)] - protected override void Delete(CustomerRole entity) + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Update)] + public async Task Patch(int key, Delta model) { - if (entity != null && entity.IsSystemRole) + var result = await PartiallyUpdateAsync(key, model, entity => { - throw this.ExceptionForbidden(); - } + if (entity != null && entity.IsSystemRole) + { + throw this.ExceptionForbidden(); + } + + Service.UpdateCustomerRole(entity); + }); - Service.DeleteCustomerRole(entity); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public SingleResult GetCustomerRole(int key) + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Delete)] + public async Task Delete(int key) { - return GetSingleResult(key); + var result = await DeleteAsync(key, entity => + { + if (entity != null && entity.IsSystemRole) + { + throw this.ExceptionForbidden(); + } + + Service.DeleteCustomerRole(entity); + }); + + return result; } } } \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 17c9865367..68c14283e2 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -2,7 +2,9 @@ using System.Linq; using System.Net; using System.Net.Http; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Common; using SmartStore.Core.Domain.Customers; using SmartStore.Core.Domain.Orders; @@ -34,47 +36,82 @@ from x in this.Repository.Table return query; } - [WebApiAuthenticate(Permission = Permissions.Customer.Create)] - protected override void Insert(Customer entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IQueryable Get() { - Service.InsertCustomer(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Customer.Update)] - protected override void Update(Customer entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public SingleResult Get(int key) { - Service.UpdateCustomer(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Customer.Delete)] - protected override void Delete(Customer entity) + [WebApiAuthenticate(Permission = Permissions.Customer.Create)] + public IHttpActionResult Post(Customer entity) { - Service.DeleteCustomer(entity); + var result = Insert(entity, () => Service.InsertCustomer(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public IQueryable Get() + [WebApiAuthenticate(Permission = Permissions.Customer.Update)] + public async Task Put(int key, Customer entity) { - return GetEntitySet(); + var result = await UpdateAsync(entity, key, () => + { + if (entity != null && entity.IsSystemAccount) + { + throw this.ExceptionForbidden(); + } + + Service.UpdateCustomer(entity); + }); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult GetCustomer(int key) + [WebApiAuthenticate(Permission = Permissions.Customer.Update)] + public async Task Patch(int key, Delta model) { - return GetSingleResult(key); + var result = await PartiallyUpdateAsync(key, model, entity => + { + if (entity != null && entity.IsSystemAccount) + { + throw this.ExceptionForbidden(); + } + + Service.UpdateCustomer(entity); + }); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Customer.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => + { + if (entity != null && entity.IsSystemAccount) + { + throw this.ExceptionForbidden(); + } + + Service.DeleteCustomer(entity); + }); + + return result; } - #region Navigation properties + #region Navigation properties - /// - /// Handle address assignments - /// - /// Customer id - /// Address id - /// Address - [WebApiAuthenticate(Permission = Permissions.Customer.EditAddress)] + /// + /// Handle address assignments + /// + /// Customer id + /// Address id + /// Address + [WebApiAuthenticate(Permission = Permissions.Customer.EditAddress)] public HttpResponseMessage NavigationAddresses(int key, int relatedKey) { Address address = null; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs index 673dbff19b..649ce3194f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class DeliveryTimesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Create)] - protected override void Insert(DeliveryTime entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] + public IQueryable Get() { - Service.InsertDeliveryTime(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Update)] - protected override void Update(DeliveryTime entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] + public SingleResult Get(int key) { - Service.UpdateDeliveryTime(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Delete)] - protected override void Delete(DeliveryTime entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Create)] + public IHttpActionResult Post(DeliveryTime entity) { - Service.DeleteDeliveryTime(entity); + var result = Insert(entity, () => Service.InsertDeliveryTime(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] - public SingleResult GetDeliveryTime(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Update)] + public async Task Put(int key, DeliveryTime entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateDeliveryTime(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateDeliveryTime(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteDeliveryTime(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs index 535600062f..1dd70f414f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Discounts; using SmartStore.Core.Security; @@ -12,32 +14,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class DiscountsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Create)] - protected override void Insert(Discount entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Read)] + public IQueryable Get() + { + return GetEntitySet(); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Read)] + public SingleResult Get(int key) { - Service.InsertDiscount(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Update)] - protected override void Update(Discount entity) + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Create)] + public IHttpActionResult Post(Discount entity) { - Service.UpdateDiscount(entity); + var result = Insert(entity, () => Service.InsertDiscount(entity)); + return result; } - [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Delete)] - protected override void Delete(Discount entity) + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Update)] + public async Task Put(int key, Discount entity) { - Service.DeleteDiscount(entity); + var result = await UpdateAsync(entity, key, () => Service.UpdateDiscount(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Read)] - public SingleResult GetDiscount(int key) + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Update)] + public async Task Patch(int key, Delta model) { - return GetSingleResult(key); + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateDiscount(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteDiscount(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] @@ -59,5 +78,7 @@ public IQueryable GetAppliedToProducts(int key) { return GetRelatedCollection(key, x => x.AppliedToProducts); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs index 09f8eb365b..ea82ca2836 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Media; using SmartStore.Core.Security; using SmartStore.Services.Media; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class DownloadsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Media.Download.Create)] - protected override void Insert(Download entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] + public IQueryable Get() { - Service.InsertDownload(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Media.Download.Update)] - protected override void Update(Download entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] + public SingleResult Get(int key) { - Service.UpdateDownload(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Media.Download.Delete)] - protected override void Delete(Download entity) + [WebApiAuthenticate(Permission = Permissions.Media.Download.Create)] + public IHttpActionResult Post(Download entity) { - Service.DeleteDownload(entity); + var result = Insert(entity, () => Service.InsertDownload(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] - public SingleResult GetDownload(int key) + [WebApiAuthenticate(Permission = Permissions.Media.Download.Update)] + public async Task Put(int key, Download entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateDownload(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Media.Download.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateDownload(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Media.Download.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteDownload(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs index 32587f6620..7aedad51ae 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Common; using SmartStore.Services.Common; using SmartStore.Web.Framework.WebApi; @@ -10,25 +13,40 @@ namespace SmartStore.WebApi.Controllers.OData [WebApiAuthenticate] public class GenericAttributesController : WebApiEntityController { - protected override void Insert(GenericAttribute entity) + [WebApiQueryable] + public IQueryable Get() { - Service.InsertAttribute(entity); + return GetEntitySet(); } - protected override void Update(GenericAttribute entity) + [WebApiQueryable] + public SingleResult Get(int key) { - Service.UpdateAttribute(entity); + return GetSingleResult(key); } - protected override void Delete(GenericAttribute entity) + public IHttpActionResult Post(GenericAttribute entity) { - Service.DeleteAttribute(entity); + var result = Insert(entity, () => Service.InsertAttribute(entity)); + return result; } - [WebApiQueryable] - public SingleResult GetGenericAttribute(int key) + public async Task Put(int key, GenericAttribute entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateAttribute(entity)); + return result; + } + + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateAttribute(entity)); + return result; + } + + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteAttribute(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs index 98030b83fb..2d1f4afaf6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Localization; using SmartStore.Core.Security; using SmartStore.Services.Localization; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class LanguagesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Create)] - protected override void Insert(Language entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Read)] + public IQueryable Get() { - Service.InsertLanguage(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Update)] - protected override void Update(Language entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Read)] + public SingleResult Get(int key) { - Service.UpdateLanguage(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Delete)] - protected override void Delete(Language entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Create)] + public IHttpActionResult Post(Language entity) { - Service.DeleteLanguage(entity); + var result = Insert(entity, () => Service.InsertLanguage(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Read)] - public SingleResult GetLanguage(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Update)] + public async Task Put(int key, Language entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateLanguage(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateLanguage(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteLanguage(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs index 28f434b207..46b522d7af 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Localization; using SmartStore.Services.Localization; using SmartStore.Web.Framework.WebApi; @@ -24,17 +27,49 @@ protected override void Delete(LocalizedProperty entity) } [WebApiQueryable] - public SingleResult GetLocalizedProperty(int key) + public IQueryable Get() + { + return GetEntitySet(); + } + + [WebApiQueryable] + public SingleResult Get(int key) { return GetSingleResult(key); } - // Navigation properties. + public IHttpActionResult Post(LocalizedProperty entity) + { + var result = Insert(entity, () => Service.InsertLocalizedProperty(entity)); + return result; + } + + public async Task Put(int key, LocalizedProperty entity) + { + var result = await UpdateAsync(entity, key, () => Service.UpdateLocalizedProperty(entity)); + return result; + } + + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateLocalizedProperty(entity)); + return result; + } + + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteLocalizedProperty(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] public SingleResult GetLanguage(int key) { return GetRelatedEntity(key, x => x.Language); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs index 78be6a75e1..67d7a85b59 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs @@ -1,6 +1,8 @@ using System; using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Discounts; using SmartStore.Core.Security; @@ -31,42 +33,76 @@ from x in this.Repository.Table return query; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Create)] - protected override void Insert(Manufacturer entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IQueryable Get() { - Service.InsertManufacturer(entity); + return GetEntitySet(); + } - this.ProcessEntity(() => + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Create)] + public IHttpActionResult Post(Manufacturer entity) + { + var result = Insert(entity, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Name); + Service.InsertManufacturer(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Update)] - protected override void Update(Manufacturer entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Update)] + public async Task Put(int key, Manufacturer entity) { - Service.UpdateManufacturer(entity); - - this.ProcessEntity(() => + var result = await UpdateAsync(entity, key, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Name); + Service.UpdateManufacturer(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Delete)] - protected override void Delete(Manufacturer entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Update)] + public async Task Patch(int key, Delta model) { - Service.DeleteManufacturer(entity); + var result = await PartiallyUpdateAsync(key, model, entity => + { + Service.UpdateManufacturer(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); + }); + + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] - public SingleResult GetManufacturer(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Delete)] + public async Task Delete(int key) { - return GetSingleResult(key); + var result = await DeleteAsync(key, entity => Service.DeleteManufacturer(entity)); + return result; } - // Navigation properties. + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] @@ -74,5 +110,7 @@ public IQueryable GetAppliedDiscounts(int key) { return GetRelatedCollection(key, x => x.AppliedDiscounts); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs index 3abee6ab41..10e83615f7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class MeasureDimensionsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] - protected override void Insert(MeasureDimension entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IQueryable Get() { - Service.InsertMeasureDimension(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] - protected override void Update(MeasureDimension entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] + public SingleResult Get(int key) { - Service.UpdateMeasureDimension(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Delete)] - protected override void Delete(MeasureDimension entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] + public IHttpActionResult Post(MeasureDimension entity) { - Service.DeleteMeasureDimension(entity); + var result = Insert(entity, () => Service.InsertMeasureDimension(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult GetMeasureDimension(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] + public async Task Put(int key, MeasureDimension entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateMeasureDimension(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateMeasureDimension(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteMeasureDimension(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs index df9c159fe2..df850a51c1 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -28,11 +31,46 @@ protected override void Delete(MeasureWeight entity) Service.DeleteMeasureWeight(entity); } + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IQueryable Get() + { + return GetEntitySet(); + } + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult GetMeasureWeight(int key) + public SingleResult Get(int key) { return GetSingleResult(key); } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] + public IHttpActionResult Post(MeasureWeight entity) + { + var result = Insert(entity, () => Service.InsertMeasureWeight(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] + public async Task Put(int key, MeasureWeight entity) + { + var result = await UpdateAsync(entity, key, () => Service.UpdateMeasureWeight(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateMeasureWeight(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteMeasureWeight(entity)); + return result; + } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs index 0eb4c944d2..e950390cce 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Messages; using SmartStore.Core.Security; using SmartStore.Services.Messages; @@ -10,33 +13,64 @@ namespace SmartStore.WebApi.Controllers.OData { public class NewsLetterSubscriptionsController : WebApiEntityController { - // There is no insert permission because a subscription is always created by customer. - [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Update)] - protected override void Insert(NewsLetterSubscription entity) - { - var publishEvent = this.GetQueryStringValue("publishevent", true); - - Service.InsertNewsLetterSubscription(entity, publishEvent); - } - - [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Update)] - protected override void Update(NewsLetterSubscription entity) - { - var publishEvent = this.GetQueryStringValue("publishevent", true); - - Service.UpdateNewsLetterSubscription(entity, publishEvent); - } - - [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Delete)] - protected override void Delete(NewsLetterSubscription entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IQueryable Get() { - Service.DeleteNewsLetterSubscription(entity); + return GetEntitySet(); } [WebApiQueryable] - public SingleResult GetNewsLetterSubscription(int key) + public SingleResult Get(int key) { return GetSingleResult(key); } - } + + // There is no insert permission because a subscription is always created by customer. + [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Update)] + public IHttpActionResult Post(NewsLetterSubscription entity) + { + var result = Insert(entity, () => + { + var publishEvent = this.GetQueryStringValue("publishevent", true); + + Service.InsertNewsLetterSubscription(entity, publishEvent); + }); + + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Update)] + public async Task Put(int key, NewsLetterSubscription entity) + { + var result = await UpdateAsync(entity, key, () => + { + var publishEvent = this.GetQueryStringValue("publishevent", true); + + Service.UpdateNewsLetterSubscription(entity, publishEvent); + }); + + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => + { + var publishEvent = this.GetQueryStringValue("publishevent", true); + + Service.UpdateNewsLetterSubscription(entity, publishEvent); + }); + + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteNewsLetterSubscription(entity)); + return result; + } + } } \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs index 9a039ba14a..b730f70293 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; @@ -16,38 +18,53 @@ public class OrderItemsController : WebApiEntityController GetEntitySet() { var query = - from x in this.Repository.Table + from x in Repository.Table + where !x.Order.Deleted select x; return query; } - - [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] - protected override void Insert(OrderItem entity) + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public IQueryable Get() + { + return GetEntitySet(); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + + [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] + public IHttpActionResult Post(OrderItem entity) { throw this.ExceptionNotImplemented(); } - [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] - protected override void Update(OrderItem entity) + [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] + public IHttpActionResult Put(int key, OrderItem entity) { throw this.ExceptionNotImplemented(); } - [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] - protected override void Delete(OrderItem entity) + [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] + public IHttpActionResult Patch(int key, Delta model) { - Service.DeleteOrderItem(entity); + throw this.ExceptionNotImplemented(); } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult GetOrderItem(int key) + [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] + public async Task Delete(int key) { - return GetSingleResult(key); + var result = await DeleteAsync(key, entity => Service.DeleteOrderItem(entity)); + return result; } - // Navigation properties. + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] @@ -63,7 +80,11 @@ public SingleResult GetProduct(int key) return GetRelatedEntity(key, x => x.Product); } - [HttpPost] + #endregion + + #region Actions + + [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Read)] public OrderItemInfo Infos(int key) { @@ -82,5 +103,7 @@ public OrderItemInfo Infos(int key) return result; } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs index 84a96321c0..5e7af7704b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; using SmartStore.Services.Orders; @@ -10,10 +13,11 @@ namespace SmartStore.WebApi.Controllers.OData { public class OrderNotesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Order.Update)] - protected override void Delete(OrderNote entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public IQueryable Get() { - Service.DeleteOrderNote(entity); + return GetEntitySet(); } [WebApiQueryable] @@ -23,7 +27,48 @@ public SingleResult GetOrderNote(int key) return GetSingleResult(key); } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Order.Update)] + public IHttpActionResult Post(OrderNote entity) + { + var result = Insert(entity, () => + { + var order = Service.GetOrderById(entity.OrderId); + if (order == null || order.Deleted) + { + throw ExceptionEntityNotFound(entity.OrderId); + } + + Service.AddOrderNote(order, entity.Note, entity.DisplayToCustomer); + + if (entity.DisplayToCustomer && this.GetQueryStringValue("customernotification", true)) + { + Services.MessageFactory.SendNewOrderNoteAddedCustomerNotification(entity, order.CustomerLanguageId); + } + }); + + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Order.Update)] + public IHttpActionResult Put(int key, OrderNote entity) + { + throw this.ExceptionNotImplemented(); + } + + [WebApiAuthenticate(Permission = Permissions.Order.Update)] + public IHttpActionResult Patch(int key, Delta model) + { + throw this.ExceptionNotImplemented(); + } + + [WebApiAuthenticate(Permission = Permissions.Order.Update)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteOrderNote(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] @@ -31,5 +76,7 @@ public SingleResult GetOrder(int key) { return GetRelatedEntity(key, x => x.Order); } - } + + #endregion + } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index e9ad7ea3a6..408e301735 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Net.Http; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Common; @@ -41,29 +42,46 @@ from x in Repository.Table return query; } - [WebApiAuthenticate(Permission = Permissions.Order.Create)] - protected override void Insert(Order entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public IQueryable Get() { - Service.InsertOrder(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Order.Update)] - protected override void Update(Order entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public SingleResult Get(int key) { - Service.UpdateOrder(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Order.Delete)] - protected override void Delete(Order entity) + [WebApiAuthenticate(Permission = Permissions.Order.Create)] + public IHttpActionResult Post(Order entity) { - Service.DeleteOrder(entity); + var result = Insert(entity, () => Service.InsertOrder(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult GetOrder(int key) + [WebApiAuthenticate(Permission = Permissions.Order.Update)] + public async Task Put(int key, Order entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateOrder(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Order.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateOrder(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Order.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteOrder(entity)); + return result; } #region Navigation properties diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs index 27a7c96ba4..507a13e230 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Payments; using SmartStore.Core.Security; using SmartStore.Services.Payments; @@ -10,30 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class PaymentMethodsController : WebApiEntityController { - // Update permission sufficient here. - [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Update)] - protected override void Insert(PaymentMethod entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] + public IQueryable Get() { - Service.InsertPaymentMethod(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Update)] - protected override void Update(PaymentMethod entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] + public SingleResult Get(int key) { - Service.UpdatePaymentMethod(entity); + return GetSingleResult(key); } - [WebApiAuthenticate] - protected override void Delete(PaymentMethod entity) + // Update permission sufficient here. + [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Update)] + public IHttpActionResult Post(PaymentMethod entity) { - throw this.ExceptionForbidden(); - } + var result = Insert(entity, () => Service.InsertPaymentMethod(entity)); + return result; + } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] - public SingleResult GetPaymentMethod(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Update)] + public async Task Put(int key, PaymentMethod entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdatePaymentMethod(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdatePaymentMethod(entity)); + return result; + } + + [WebApiAuthenticate] + public IHttpActionResult Delete(int key) + { + throw this.ExceptionForbidden(); } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs index 15344399d9..a820cf0e27 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductAttributeOptionsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] - protected override void Insert(ProductAttributeOption entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public IQueryable Get() { - Service.InsertProductAttributeOption(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] - protected override void Update(ProductAttributeOption entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public SingleResult Get(int key) { - Service.UpdateProductAttributeOption(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] - protected override void Delete(ProductAttributeOption entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public IHttpActionResult Post(ProductAttributeOption entity) { - Service.DeleteProductAttributeOption(entity); + var result = Insert(entity, () => Service.InsertProductAttributeOption(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult GetProductAttributeOption(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public async Task Put(int key, ProductAttributeOption entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateProductAttributeOption(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductAttributeOption(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductAttributeOption(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] @@ -43,5 +63,7 @@ public SingleResult GetProductAttributeOptionsSet(in { return GetRelatedEntity(key, x => x.ProductAttributeOptionsSet); } - } + + #endregion + } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs index 530218147f..c5dbdc8e7b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -11,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductAttributeOptionsSetsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] - protected override void Insert(ProductAttributeOptionsSet entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public IQueryable Get() { - Service.InsertProductAttributeOptionsSet(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] - protected override void Update(ProductAttributeOptionsSet entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public SingleResult Get(int key) { - Service.UpdateProductAttributeOptionsSet(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] - protected override void Delete(ProductAttributeOptionsSet entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public IHttpActionResult Post(ProductAttributeOptionsSet entity) { - Service.DeleteProductAttributeOptionsSet(entity); + var result = Insert(entity, () => Service.InsertProductAttributeOptionsSet(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult GetProductAttributeOptionsSet(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public async Task Put(int key, ProductAttributeOptionsSet entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateProductAttributeOptionsSet(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductAttributeOptionsSet(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductAttributeOptionsSet(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] @@ -51,5 +70,7 @@ public IQueryable GetProductAttributeOptions(int key) { return GetRelatedCollection(key, x => x.ProductAttributeOptions); } - } + + #endregion + } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs index f212c6c039..fc828f1e23 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -11,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductAttributesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Create)] - protected override void Insert(ProductAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public IQueryable Get() { - Service.InsertProductAttribute(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Update)] - protected override void Update(ProductAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public SingleResult Get(int key) { - Service.UpdateProductAttribute(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Delete)] - protected override void Delete(ProductAttribute entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Create)] + public IHttpActionResult Post(ProductAttribute entity) { - Service.DeleteProductAttribute(entity); + var result = Insert(entity, () => Service.InsertProductAttribute(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult GetProductAttribute(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Update)] + public async Task Put(int key, ProductAttribute entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateProductAttribute(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductAttribute(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductAttribute(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] @@ -44,5 +63,7 @@ public IQueryable GetProductAttributeOptionsSets(int { return GetRelatedCollection(key, x => x.ProductAttributeOptionsSets); } - } + + #endregion + } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs index 77ea055753..b70f6ce115 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductBundleItemsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] - protected override void Insert(ProductBundleItem entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertBundleItem(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] - protected override void Update(ProductBundleItem entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateBundleItem(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] - protected override void Delete(ProductBundleItem entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] + public IHttpActionResult Post(ProductBundleItem entity) { - Service.DeleteBundleItem(entity); + var result = Insert(entity, () => Service.InsertBundleItem(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProductBundleItem(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] + public async Task Put(int key, ProductBundleItem entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateBundleItem(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateBundleItem(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteBundleItem(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] @@ -50,5 +70,7 @@ public SingleResult GetBundleProduct(int key) { return GetRelatedEntity(key, x => x.BundleProduct); } - } + + #endregion + } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs index a76cc55d5f..2dad9fb4ac 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,27 +13,51 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductCategoriesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] - protected override void Insert(ProductCategory entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProductCategory(entity); - } + return GetEntitySet(); + } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] - protected override void Update(ProductCategory entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateProductCategory(entity); - } + return GetSingleResult(key); + } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] - protected override void Delete(ProductCategory entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] + public IHttpActionResult Post(ProductCategory entity) { - Service.DeleteProductCategory(entity); + var result = Insert(entity, () => Service.InsertProductCategory(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] + public async Task Put(int key, ProductCategory entity) + { + var result = await UpdateAsync(entity, key, () => Service.UpdateProductCategory(entity)); + return result; + } - [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductCategory(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductCategory(entity)); + return result; + } + + #region Navigation properties + + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] public SingleResult GetCategory(int key) { @@ -43,5 +70,7 @@ public SingleResult GetProduct(int key) { return GetRelatedEntity(key, x => x.Product); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs index 65a5246db3..d56460f60e 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,27 +13,51 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductManufacturersController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] - protected override void Insert(ProductManufacturer entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProductManufacturer(entity); - } + return GetEntitySet(); + } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] - protected override void Update(ProductManufacturer entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateProductManufacturer(entity); - } + return GetSingleResult(key); + } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] - protected override void Delete(ProductManufacturer entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] + public IHttpActionResult Post(ProductManufacturer entity) { - Service.DeleteProductManufacturer(entity); + var result = Insert(entity, () => Service.InsertProductManufacturer(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] + public async Task Put(int key, ProductManufacturer entity) + { + var result = await UpdateAsync(entity, key, () => Service.UpdateProductManufacturer(entity)); + return result; + } - [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductManufacturer(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductManufacturer(entity)); + return result; + } + + #region Navigation properties + + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] public SingleResult GetManufacturer(int key) { @@ -43,5 +70,7 @@ public SingleResult GetProduct(int key) { return GetRelatedEntity(key, x => x.Product); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs index c2036ee392..3203b4f6fe 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Media; using SmartStore.Core.Security; @@ -11,27 +14,51 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductPicturesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] - protected override void Insert(ProductMediaFile entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProductPicture(entity); - } + return GetEntitySet(); + } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] - protected override void Update(ProductMediaFile entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateProductPicture(entity); - } + return GetSingleResult(key); + } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] - protected override void Delete(ProductMediaFile entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] + public IHttpActionResult Post(ProductMediaFile entity) { - Service.DeleteProductPicture(entity); + var result = Insert(entity, () => Service.InsertProductPicture(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] + public async Task Put(int key, ProductMediaFile entity) + { + var result = await UpdateAsync(entity, key, () => Service.UpdateProductPicture(entity)); + return result; + } - [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductPicture(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductPicture(entity)); + return result; + } + + #region Navigation properties + + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] public SingleResult GetPicture(int key) { @@ -44,5 +71,7 @@ public SingleResult GetProduct(int key) { return GetRelatedEntity(key, x => x.Product); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index c606b90257..455d85a113 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Net; using System.Net.Http; +using System.Threading.Tasks; using System.Web.Http; using System.Web.Http.ModelBinding; using System.Web.OData; @@ -53,51 +54,85 @@ public ProductsController( protected override IQueryable GetEntitySet() { var query = - from x in this.Repository.Table + from x in Repository.Table where !x.Deleted && !x.IsSystemProduct select x; return query; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Create)] - protected override void Insert(Product entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProduct(entity); + return GetEntitySet(); + } - this.ProcessEntity(() => + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Create)] + public IHttpActionResult Post(Product entity) + { + var result = Insert(entity, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Name); + Service.InsertProduct(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Update)] - protected override void Update(Product entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Update)] + public async Task Put(int key, Product entity) { - Service.UpdateProduct(entity); - - this.ProcessEntity(() => + var result = await UpdateAsync(entity, key, () => { - _urlRecordService.Value.SaveSlug(entity, x => x.Name); + Service.UpdateProduct(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); }); + + return result; } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Delete)] - protected override void Delete(Product entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Update)] + public async Task Patch(int key, Delta model) { - Service.DeleteProduct(entity); + var result = await PartiallyUpdateAsync(key, model, entity => + { + Service.UpdateProduct(entity); + + this.ProcessEntity(() => + { + _urlRecordService.Value.SaveSlug(entity, x => x.Name); + }); + }); + + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProduct(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Delete)] + public async Task Delete(int key) { - return GetSingleResult(key); + var result = await DeleteAsync(key, entity => Service.DeleteProduct(entity)); + return result; } - // Navigation properties. + #region Navigation properties - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] public HttpResponseMessage NavigationProductCategories(int key, int relatedKey) { ProductCategory productCategory = null; @@ -312,7 +347,9 @@ public IQueryable GetProductBundleItems(int key) return GetRelatedCollection(key, x => x.ProductBundleItems); } - // Actions. + #endregion + + #region Actions [HttpPost, WebApiQueryable(PagingOptional = true)] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] @@ -515,5 +552,7 @@ public IQueryable ManageAttributes(int key, ODataAction return entity.ProductVariantAttributes.AsQueryable(); } - } + + #endregion + } } diff --git a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs index 2b9a045eff..50a75bd6e9 100644 --- a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs +++ b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs @@ -35,16 +35,6 @@ public static string GridApiInfo(this HtmlHelper helper) return sb.ToString(); } - - public static T GetValueSafe(this ODataActionParameters parameters, string key) - { - if (parameters != null && key.HasValue() && parameters.TryGetValue(key, out var value)) - { - return value.Convert(); - } - - return default(T); - } } internal static class MiscExtensions @@ -54,9 +44,22 @@ public static string ToUnquoted(this string value) if (value.HasValue() && value.Length > 1) { if ((value.StartsWith("\"") && value.EndsWith("\"")) || (value.StartsWith("'") && value.EndsWith("'"))) + { return value.Substring(1, value.Length - 2); + } } + return value; } + + public static T GetValueSafe(this ODataActionParameters parameters, string key) + { + if (parameters != null && key.HasValue() && parameters.TryGetValue(key, out var value)) + { + return value.Convert(); + } + + return default; + } } } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index 25a77960fc..afb1e39d8e 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -44,6 +44,7 @@ public abstract class WebApiEntityController : ODataControlle // TODO: // XML serialization issues. + // Don't use service models like MediaFileInfo. API must encapsulate and model independently. /// /// Auto injected by Autofac. diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs index c938463ecd..88d58be4bb 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs @@ -47,6 +47,8 @@ public void Start() config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; // Allow OData actions and functions without the need for namespaces (OData V3 backward compatibility). + // A namespace URL world be for example: /Products(123)/ProductService.FinalPrice + // Note: the dot in this URL will cause IIS to return error 404. See ExtensionlessUrlHandler-Integrated-4.0. config.EnableUnqualifiedNameCall(true); var configPublisher = (IWebApiConfigurationPublisher)config.DependencyResolver.GetService(typeof(IWebApiConfigurationPublisher)); From a967ffe7057b5f03d2669b813ebc061d0b2e41ad Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 7 Aug 2020 19:41:40 +0200 Subject: [PATCH 006/695] Updated Newtonsoft.Json package to 12.0.3 --- src/Libraries/SmartStore.Core/Plugins/PluginManager.cs | 2 +- src/Libraries/SmartStore.Core/SmartStore.Core.csproj | 2 +- src/Libraries/SmartStore.Core/packages.config | 2 +- src/Libraries/SmartStore.Data/SmartStore.Data.csproj | 2 +- src/Libraries/SmartStore.Data/packages.config | 2 +- .../SmartStore.Services/SmartStore.Services.csproj | 2 +- src/Libraries/SmartStore.Services/app.config | 3 +-- src/Libraries/SmartStore.Services/packages.config | 2 +- .../SmartStore.AmazonPay/SmartStore.AmazonPay.csproj | 3 ++- src/Plugins/SmartStore.AmazonPay/packages.config | 2 +- .../SmartStore.Clickatell/SmartStore.Clickatell.csproj | 3 ++- src/Plugins/SmartStore.Clickatell/packages.config | 2 +- .../SmartStore.DevTools/SmartStore.DevTools.csproj | 3 ++- src/Plugins/SmartStore.DevTools/packages.config | 2 +- .../SmartStore.FacebookAuth.csproj | 3 ++- src/Plugins/SmartStore.FacebookAuth/packages.config | 2 +- .../SmartStore.GoogleAnalytics.csproj | 1 + .../SmartStore.GoogleMerchantCenter.csproj | 3 ++- .../SmartStore.GoogleMerchantCenter/packages.config | 2 +- .../SmartStore.OfflinePayment.csproj | 3 ++- src/Plugins/SmartStore.OfflinePayment/packages.config | 2 +- src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj | 3 ++- src/Plugins/SmartStore.PayPal/packages.config | 2 +- .../SmartStore.Shipping/SmartStore.Shipping.csproj | 1 + .../SmartStore.ShippingByWeight.csproj | 1 + src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj | 3 ++- src/Plugins/SmartStore.Tax/packages.config | 2 +- src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj | 3 ++- src/Plugins/SmartStore.WebApi/packages.config | 2 +- .../SmartStore.Web.Framework.csproj | 2 +- src/Presentation/SmartStore.Web.Framework/packages.config | 2 +- .../SmartStore.Web/Administration/SmartStore.Admin.csproj | 2 +- .../SmartStore.Web/Administration/packages.config | 2 +- src/Presentation/SmartStore.Web/SmartStore.Web.csproj | 2 +- src/Presentation/SmartStore.Web/Web.config | 8 +------- src/Presentation/SmartStore.Web/packages.config | 2 +- .../SmartStore.Core.Tests/SmartStore.Core.Tests.csproj | 2 +- src/Tests/SmartStore.Core.Tests/packages.config | 2 +- .../SmartStore.WebApi.Client.csproj | 2 +- src/Tools/SmartStore.WebApi.Client/packages.config | 2 +- 40 files changed, 49 insertions(+), 44 deletions(-) diff --git a/src/Libraries/SmartStore.Core/Plugins/PluginManager.cs b/src/Libraries/SmartStore.Core/Plugins/PluginManager.cs index 86fe45ff3c..f0ed27ac57 100644 --- a/src/Libraries/SmartStore.Core/Plugins/PluginManager.cs +++ b/src/Libraries/SmartStore.Core/Plugins/PluginManager.cs @@ -231,7 +231,7 @@ void FinalizePlugin(PluginDescriptor p) } if (firstFailedAssembly != null) { - Logger.ErrorFormat("Assembly probing failed for '{0}': {1}", firstFailedAssembly.File.Name, firstFailedAssembly.ActivationException.Message); + Logger.ErrorFormat("Assembly probing failed for '{0}': {1}", firstFailedAssembly.File?.Name.EmptyNull(), firstFailedAssembly.ActivationException.Message); p.Incompatible = true; incompatiblePlugins.Add(p.SystemName); } diff --git a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj index a86991b79e..3a58c137f2 100644 --- a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj +++ b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj @@ -95,7 +95,7 @@ ..\..\packages\Microsoft.Web.Xdt.3.0.0\lib\net40\Microsoft.Web.XmlTransform.dll - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll ..\..\packages\NuGet.Core.2.14.0\lib\net40-Client\NuGet.Core.dll diff --git a/src/Libraries/SmartStore.Core/packages.config b/src/Libraries/SmartStore.Core/packages.config index 19d5cd9737..d796fbd153 100644 --- a/src/Libraries/SmartStore.Core/packages.config +++ b/src/Libraries/SmartStore.Core/packages.config @@ -12,7 +12,7 @@ - + diff --git a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj index 3f8eee232b..bd87aae610 100644 --- a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj +++ b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj @@ -95,7 +95,7 @@ ..\..\packages\Microsoft.SqlServer.Scripting.11.0.2100.61\lib\Microsoft.SqlServer.Smo.dll - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Libraries/SmartStore.Data/packages.config b/src/Libraries/SmartStore.Data/packages.config index a063941a5e..caaa2b6499 100644 --- a/src/Libraries/SmartStore.Data/packages.config +++ b/src/Libraries/SmartStore.Data/packages.config @@ -5,6 +5,6 @@ - + \ No newline at end of file diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index ca2e36862d..2ac1065af7 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -116,7 +116,7 @@ True - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll ..\..\packages\NReco.PdfGenerator.1.1.15\lib\net20\NReco.PdfGenerator.dll diff --git a/src/Libraries/SmartStore.Services/app.config b/src/Libraries/SmartStore.Services/app.config index 463e354afb..16aef9ec68 100644 --- a/src/Libraries/SmartStore.Services/app.config +++ b/src/Libraries/SmartStore.Services/app.config @@ -9,8 +9,7 @@ - + http://ec.europa.eu/taxation_customs/vies/services/checkVatService diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index be5db3727d..c879853538 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -17,7 +17,7 @@ - + diff --git a/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj b/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj index 8d6b74f6b6..01baf98b7b 100644 --- a/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj +++ b/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj @@ -95,13 +95,14 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.AmazonPay/packages.config b/src/Plugins/SmartStore.AmazonPay/packages.config index a8d00c17d2..d6e63a10cf 100644 --- a/src/Plugins/SmartStore.AmazonPay/packages.config +++ b/src/Plugins/SmartStore.AmazonPay/packages.config @@ -10,5 +10,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj b/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj index 6a96ac359a..3a1b76bde7 100644 --- a/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj +++ b/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj @@ -87,13 +87,14 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.Clickatell/packages.config b/src/Plugins/SmartStore.Clickatell/packages.config index b00b3cc8dc..dfe5e2740a 100644 --- a/src/Plugins/SmartStore.Clickatell/packages.config +++ b/src/Plugins/SmartStore.Clickatell/packages.config @@ -5,5 +5,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj index 8c43d89520..730aad63ee 100644 --- a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj +++ b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj @@ -102,6 +102,7 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll @@ -117,7 +118,7 @@ True - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.DevTools/packages.config b/src/Plugins/SmartStore.DevTools/packages.config index ca9ebcd893..57a42b5851 100644 --- a/src/Plugins/SmartStore.DevTools/packages.config +++ b/src/Plugins/SmartStore.DevTools/packages.config @@ -12,5 +12,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj b/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj index 5a2774492f..b9f6bfbf81 100644 --- a/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj +++ b/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj @@ -125,13 +125,14 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.FacebookAuth/packages.config b/src/Plugins/SmartStore.FacebookAuth/packages.config index d1171484d7..c30173272e 100644 --- a/src/Plugins/SmartStore.FacebookAuth/packages.config +++ b/src/Plugins/SmartStore.FacebookAuth/packages.config @@ -16,5 +16,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj b/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj index 0bc3b5871b..9f985db672 100644 --- a/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj +++ b/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj @@ -87,6 +87,7 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj index b8bfd5df32..2cdba3d2d3 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj @@ -107,13 +107,14 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config b/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config index 1b8cbc1400..fdc270f9cd 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config @@ -9,5 +9,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj b/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj index a84ef07ca4..1a8e7b55a5 100644 --- a/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj +++ b/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj @@ -95,13 +95,14 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.OfflinePayment/packages.config b/src/Plugins/SmartStore.OfflinePayment/packages.config index 2b077bf78c..940a1c2036 100644 --- a/src/Plugins/SmartStore.OfflinePayment/packages.config +++ b/src/Plugins/SmartStore.OfflinePayment/packages.config @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj b/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj index 0154ac2f43..a13e30fcb4 100644 --- a/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj +++ b/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj @@ -73,13 +73,14 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.PayPal/packages.config b/src/Plugins/SmartStore.PayPal/packages.config index dab5fcfca2..5294b5ff78 100644 --- a/src/Plugins/SmartStore.PayPal/packages.config +++ b/src/Plugins/SmartStore.PayPal/packages.config @@ -9,5 +9,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj index 25f253f043..fa68da3247 100644 --- a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj +++ b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj @@ -103,6 +103,7 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll diff --git a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj index 3f85cc8b9d..09e985e9e9 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj +++ b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj @@ -103,6 +103,7 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll diff --git a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj index b7306247a7..9da2507797 100644 --- a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj +++ b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj @@ -99,13 +99,14 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.Tax/packages.config b/src/Plugins/SmartStore.Tax/packages.config index 2c185251cc..c2904f28a5 100644 --- a/src/Plugins/SmartStore.Tax/packages.config +++ b/src/Plugins/SmartStore.Tax/packages.config @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 8fea27bebf..5403bc55ca 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -105,6 +105,7 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + False ..\..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll @@ -119,7 +120,7 @@ False - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Plugins/SmartStore.WebApi/packages.config b/src/Plugins/SmartStore.WebApi/packages.config index b645dda46e..24b7e62ffc 100644 --- a/src/Plugins/SmartStore.WebApi/packages.config +++ b/src/Plugins/SmartStore.WebApi/packages.config @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index 4cac4a1212..a98aa5d8d1 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -127,7 +127,7 @@ ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Presentation/SmartStore.Web.Framework/packages.config b/src/Presentation/SmartStore.Web.Framework/packages.config index c678081470..0f2ee8c5c1 100644 --- a/src/Presentation/SmartStore.Web.Framework/packages.config +++ b/src/Presentation/SmartStore.Web.Framework/packages.config @@ -28,7 +28,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj index fc810cdf6c..cad98fd581 100644 --- a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj +++ b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj @@ -97,7 +97,7 @@ ..\..\..\packages\Microsoft.Web.Xdt.3.0.0\lib\net40\Microsoft.Web.XmlTransform.dll - ..\..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NuGet.Core.2.14.0\lib\net40-Client\NuGet.Core.dll diff --git a/src/Presentation/SmartStore.Web/Administration/packages.config b/src/Presentation/SmartStore.Web/Administration/packages.config index 5c76fbfdc0..a6b9edf1e5 100644 --- a/src/Presentation/SmartStore.Web/Administration/packages.config +++ b/src/Presentation/SmartStore.Web/Administration/packages.config @@ -15,7 +15,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj index ab4cd628bf..efaa1658b3 100644 --- a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj +++ b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj @@ -148,7 +148,7 @@ ..\..\packages\MsieJavaScriptEngine.3.0.1\lib\net45\MsieJavaScriptEngine.dll - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll ..\..\packages\NUglify.1.5.14\lib\net40\NUglify.dll diff --git a/src/Presentation/SmartStore.Web/Web.config b/src/Presentation/SmartStore.Web/Web.config index f9f35331fe..8a981478ff 100644 --- a/src/Presentation/SmartStore.Web/Web.config +++ b/src/Presentation/SmartStore.Web/Web.config @@ -445,13 +445,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/packages.config b/src/Presentation/SmartStore.Web/packages.config index f4eb818521..c2ebf7619d 100644 --- a/src/Presentation/SmartStore.Web/packages.config +++ b/src/Presentation/SmartStore.Web/packages.config @@ -31,7 +31,7 @@ - + diff --git a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj index ccc78925cc..b95df39b91 100644 --- a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj +++ b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj @@ -72,7 +72,7 @@ ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll False diff --git a/src/Tests/SmartStore.Core.Tests/packages.config b/src/Tests/SmartStore.Core.Tests/packages.config index f4baf1e494..078c3a2cff 100644 --- a/src/Tests/SmartStore.Core.Tests/packages.config +++ b/src/Tests/SmartStore.Core.Tests/packages.config @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj b/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj index 556fa2a9d4..9bd1f1cf9f 100644 --- a/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj +++ b/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj @@ -61,7 +61,7 @@ - ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Tools/SmartStore.WebApi.Client/packages.config b/src/Tools/SmartStore.WebApi.Client/packages.config index 466ab7648c..8ab13a9023 100644 --- a/src/Tools/SmartStore.WebApi.Client/packages.config +++ b/src/Tools/SmartStore.WebApi.Client/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file From a392f5a89d3ee6044bd928c52b3b8adaa8a11cf6 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 7 Aug 2020 19:44:09 +0200 Subject: [PATCH 007/695] Updated CommonServiceLocator package to v2.0.5 --- .../SmartStore.Web.Framework/SmartStore.Web.Framework.csproj | 4 ++-- src/Presentation/SmartStore.Web.Framework/packages.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index a98aa5d8d1..1af2838abd 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -90,8 +90,8 @@ ..\..\packages\BundleTransformer.SassAndScss.1.10.0\lib\net40\BundleTransformer.SassAndScss.dll - - ..\..\packages\CommonServiceLocator.2.0.4\lib\net46\CommonServiceLocator.dll + + ..\..\packages\CommonServiceLocator.2.0.5\lib\net46\CommonServiceLocator.dll ..\..\packages\DotLiquid.2.0.254\lib\net45\DotLiquid.dll diff --git a/src/Presentation/SmartStore.Web.Framework/packages.config b/src/Presentation/SmartStore.Web.Framework/packages.config index 0f2ee8c5c1..8bba36e6b6 100644 --- a/src/Presentation/SmartStore.Web.Framework/packages.config +++ b/src/Presentation/SmartStore.Web.Framework/packages.config @@ -8,7 +8,7 @@ - + From 0e2d48f66b46b33020b46495f1f7cb9b4a8107fc Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 7 Aug 2020 20:02:27 +0200 Subject: [PATCH 008/695] Updated MaxMind.Db package to v2.6.1 --- .../SmartStore.Services/Directory/GeoCountryLookup.cs | 3 ++- src/Libraries/SmartStore.Services/SmartStore.Services.csproj | 2 +- src/Libraries/SmartStore.Services/packages.config | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs index 33bd851f16..c2dfaeac4e 100644 --- a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs +++ b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs @@ -1,5 +1,6 @@ using System; using System.Net; +using MaxMind.Db; using MaxMind.GeoIP2; using SmartStore.Core; using SmartStore.Core.Caching; @@ -16,7 +17,7 @@ public GeoCountryLookup() { // Old database not usable anymore due to US (Florida?) legal issues from 01 Jan 2020 on. //_reader = new DatabaseReader(CommonHelper.MapPath("~/App_Data/GeoLite2/GeoLite2-Country.mmdb")); - + _reader = new DatabaseReader(CommonHelper.MapPath("~/App_Data/Geo/dbip-country-lite.mmdb")); } diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 2ac1065af7..52114ebc15 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -98,7 +98,7 @@ ..\..\packages\LumenWorksCsvReader.4.0.0\lib\net461\LumenWorks.Framework.IO.dll - ..\..\packages\MaxMind.Db.2.4.0\lib\net45\MaxMind.Db.dll + ..\..\packages\MaxMind.Db.2.6.1\lib\net45\MaxMind.Db.dll ..\..\packages\MaxMind.GeoIP2.3.0.0\lib\net45\MaxMind.GeoIP2.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index c879853538..7f4458b0d6 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -8,7 +8,7 @@ - + From 1ac98190bb14abaddb1e8c610c76c7815e257285 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 7 Aug 2020 20:25:31 +0200 Subject: [PATCH 009/695] Updated MaxMind.GeoIP2 package to v3.2.0 --- .../SmartStore.Services/Directory/GeoCountryLookup.cs | 4 ---- src/Libraries/SmartStore.Services/SmartStore.Services.csproj | 2 +- src/Libraries/SmartStore.Services/packages.config | 4 ++-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs index c2dfaeac4e..3926d52189 100644 --- a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs +++ b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs @@ -1,11 +1,7 @@ using System; using System.Net; -using MaxMind.Db; using MaxMind.GeoIP2; -using SmartStore.Core; -using SmartStore.Core.Caching; using SmartStore.Utilities; -using SmDir = SmartStore.Core.Domain.Directory; namespace SmartStore.Services.Directory { diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 52114ebc15..5144725707 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -101,7 +101,7 @@ ..\..\packages\MaxMind.Db.2.6.1\lib\net45\MaxMind.Db.dll - ..\..\packages\MaxMind.GeoIP2.3.0.0\lib\net45\MaxMind.GeoIP2.dll + ..\..\packages\MaxMind.GeoIP2.3.2.0\lib\net45\MaxMind.GeoIP2.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index 7f4458b0d6..3967b92824 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -9,11 +9,11 @@ - + - + From 3497127dff66e95527704e3172bf846bc730fc2d Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 7 Aug 2020 20:28:41 +0200 Subject: [PATCH 010/695] Reverse commit --- src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs | 2 +- src/Libraries/SmartStore.Services/SmartStore.Services.csproj | 2 +- src/Libraries/SmartStore.Services/packages.config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs index 3926d52189..0c0d3f7764 100644 --- a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs +++ b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs @@ -13,7 +13,7 @@ public GeoCountryLookup() { // Old database not usable anymore due to US (Florida?) legal issues from 01 Jan 2020 on. //_reader = new DatabaseReader(CommonHelper.MapPath("~/App_Data/GeoLite2/GeoLite2-Country.mmdb")); - + _reader = new DatabaseReader(CommonHelper.MapPath("~/App_Data/Geo/dbip-country-lite.mmdb")); } diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 5144725707..b5b5c8f087 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -98,7 +98,7 @@ ..\..\packages\LumenWorksCsvReader.4.0.0\lib\net461\LumenWorks.Framework.IO.dll - ..\..\packages\MaxMind.Db.2.6.1\lib\net45\MaxMind.Db.dll + ..\..\packages\MaxMind.Db.2.4.0\lib\net45\MaxMind.Db.dll ..\..\packages\MaxMind.GeoIP2.3.2.0\lib\net45\MaxMind.GeoIP2.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index 3967b92824..2a22157f8c 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -8,7 +8,7 @@ - + From 6e55460acad60cfccb111f7bd131c7d30fbdf8a2 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 7 Aug 2020 20:30:51 +0200 Subject: [PATCH 011/695] Reverse commit --- .../SmartStore.Services/Directory/GeoCountryLookup.cs | 4 ++++ src/Libraries/SmartStore.Services/SmartStore.Services.csproj | 2 +- src/Libraries/SmartStore.Services/packages.config | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs index 0c0d3f7764..45f7d35241 100644 --- a/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs +++ b/src/Libraries/SmartStore.Services/Directory/GeoCountryLookup.cs @@ -1,7 +1,11 @@ using System; using System.Net; +using MaxMind.Db; using MaxMind.GeoIP2; +using SmartStore.Core; +using SmartStore.Core.Caching; using SmartStore.Utilities; +using SmDir = SmartStore.Core.Domain.Directory; namespace SmartStore.Services.Directory { diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index b5b5c8f087..2ac1065af7 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -101,7 +101,7 @@ ..\..\packages\MaxMind.Db.2.4.0\lib\net45\MaxMind.Db.dll - ..\..\packages\MaxMind.GeoIP2.3.2.0\lib\net45\MaxMind.GeoIP2.dll + ..\..\packages\MaxMind.GeoIP2.3.0.0\lib\net45\MaxMind.GeoIP2.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index 2a22157f8c..c879853538 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -9,11 +9,11 @@ - + - + From a3c8a15b8ee3c3f7370a228dde1704a93200dd90 Mon Sep 17 00:00:00 2001 From: Marcel Schmidt Date: Fri, 7 Aug 2020 21:36:42 +0200 Subject: [PATCH 012/695] pb > gallery block: GalleryMediaFile --- .../Domain/Catalog/ProductMediaFile.cs | 12 ++++++++++-- .../Scripts/smartstore.dropzoneWrapper.js | 5 ++++- .../Views/Shared/Components/FileUploader.cshtml | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs b/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs index 630f5cf754..bbf8b12cf1 100644 --- a/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs +++ b/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs @@ -19,11 +19,19 @@ public interface IMediaFile /// MediaFile MediaFile { get; set; } } - + + public class GalleryMediaFile : IMediaFile + { + public int MediaFileId { get; set; } + public string Title { get; set; } + public int DisplayOrder { get; set; } + public MediaFile MediaFile { get; set; } + } + /// /// Represents a product media file mapping /// - [DataContract] + [DataContract] public partial class ProductMediaFile : BaseEntity, IMediaFile { /// diff --git a/src/Presentation/SmartStore.Web/Scripts/smartstore.dropzoneWrapper.js b/src/Presentation/SmartStore.Web/Scripts/smartstore.dropzoneWrapper.js index 40fb415f4b..30d0b92be4 100644 --- a/src/Presentation/SmartStore.Web/Scripts/smartstore.dropzoneWrapper.js +++ b/src/Presentation/SmartStore.Web/Scripts/smartstore.dropzoneWrapper.js @@ -451,9 +451,11 @@ entityId: $el.data('entity-id') }, success: function (response) { + console.log(response.response); $.each(response.response, function (i, value) { + console.log("adasdsa"); var file = assignableFiles.find(x => x.media.id === value.MediaFileId); - + console.log(file); if (!file) { // Try get renamed file. var name = value.Name; @@ -519,6 +521,7 @@ entityId: $el.data('entity-id') }, success: function (response) { + console.log(response); // Set EntityMediaId & current DisplayOrder. $.each(response.response, function (index, value) { var preview = $(".dz-image-preview[data-media-id='" + value.MediaFileId + "']"); diff --git a/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml index 41db0b280b..6159bdb862 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml @@ -108,7 +108,7 @@ - +
From 82debbbb367667b22543cc71434372e5e6e23333 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Sat, 8 Aug 2020 01:10:26 +0200 Subject: [PATCH 013/695] Updated target .NET Framework to 4.7.2 (!!!) --- .../SmartStore.Core/SmartStore.Core.csproj | 5 +- src/Libraries/SmartStore.Core/app.config | 2 +- src/Libraries/SmartStore.Core/packages.config | 1 - .../SmartStore.Data/SmartStore.Data.csproj | 5 +- src/Libraries/SmartStore.Data/app.config | 2 +- src/Libraries/SmartStore.Data/packages.config | 1 - .../Properties/Settings.Designer.cs | 8 +- .../SmartStore.Services.csproj | 5 +- .../EuropeCheckVatService/Reference.cs | 10 +- src/Libraries/SmartStore.Services/app.config | 2 +- .../SmartStore.Services/packages.config | 1 - .../SmartStore.AmazonPay.csproj | 4 +- src/Plugins/SmartStore.AmazonPay/web.config | 18 +- .../SmartStore.Clickatell.csproj | 4 +- src/Plugins/SmartStore.Clickatell/web.config | 18 +- .../SmartStore.DevTools.csproj | 4 +- src/Plugins/SmartStore.DevTools/Web.config | 18 +- .../SmartStore.FacebookAuth.csproj | 4 +- .../SmartStore.FacebookAuth/web.config | 18 +- .../SmartStore.GoogleAnalytics.csproj | 4 +- .../SmartStore.GoogleAnalytics/web.config | 18 +- .../SmartStore.GoogleMerchantCenter.csproj | 4 +- .../web.config | 18 +- .../SmartStore.OfflinePayment.csproj | 4 +- .../SmartStore.OfflinePayment/web.config | 18 +- .../Properties/Settings.Designer.cs | 2 +- .../SmartStore.PayPal.csproj | 2 +- .../Web References/PayPalSvc/Reference.cs | 1052 ++++++++--------- src/Plugins/SmartStore.PayPal/web.config | 18 +- .../SmartStore.Shipping.csproj | 4 +- src/Plugins/SmartStore.Shipping/web.config | 18 +- .../SmartStore.ShippingByWeight.csproj | 4 +- .../SmartStore.ShippingByWeight/web.config | 18 +- .../SmartStore.Tax/SmartStore.Tax.csproj | 4 +- src/Plugins/SmartStore.Tax/web.config | 18 +- .../SmartStore.WebApi.csproj | 2 +- src/Plugins/SmartStore.WebApi/web.config | 23 +- .../SmartStore.Web.Framework.csproj | 29 +- .../SmartStore.Web.Framework/app.config | 10 +- .../SmartStore.Web.Framework/packages.config | 13 +- .../Administration/SmartStore.Admin.csproj | 5 +- .../SmartStore.Web/Administration/Web.config | 20 +- .../Administration/packages.config | 1 - .../EditorLocalization.designer.cs | 2 +- .../GridLocalization.designer.cs | 2 +- .../MvcLocalization.Designer.cs | 2 +- .../SmartStore.Web/SmartStore.Web.csproj | 67 +- src/Presentation/SmartStore.Web/Web.config | 368 +++--- .../SmartStore.Web/packages.config | 29 +- src/Tests/SmartStore.Core.Tests/App.config | 2 +- .../SmartStore.Core.Tests.csproj | 2 +- src/Tests/SmartStore.Data.Tests/App.config | 4 +- .../SmartStore.Data.Tests.csproj | 2 +- .../SmartStore.Services.Tests/App.config | 2 +- .../SmartStore.Services.Tests.csproj | 2 +- src/Tests/SmartStore.Tests/App.config | 2 +- .../SmartStore.Tests/SmartStore.Tests.csproj | 2 +- src/Tests/SmartStore.Web.MVC.Tests/App.config | 16 +- .../SmartStore.Web.MVC.Tests.csproj | 5 +- .../SmartStore.Web.MVC.Tests/packages.config | 1 - src/Tools/SmartStore.Packager/App.config | 2 +- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Settings.Designer.cs | 2 +- .../SmartStore.Packager.csproj | 2 +- src/Tools/SmartStore.WebApi.Client/App.config | 2 +- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Settings.Designer.cs | 2 +- .../SmartStore.WebApi.Client.csproj | 2 +- 68 files changed, 1001 insertions(+), 964 deletions(-) diff --git a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj index 3a58c137f2..130f467935 100644 --- a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj +++ b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Core SmartStore.Core - v4.6.1 + v4.7.2 512 @@ -119,9 +119,6 @@ - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll diff --git a/src/Libraries/SmartStore.Core/app.config b/src/Libraries/SmartStore.Core/app.config index f9acd6487c..1e2654dc0e 100644 --- a/src/Libraries/SmartStore.Core/app.config +++ b/src/Libraries/SmartStore.Core/app.config @@ -20,4 +20,4 @@ - + diff --git a/src/Libraries/SmartStore.Core/packages.config b/src/Libraries/SmartStore.Core/packages.config index d796fbd153..e43ef279d7 100644 --- a/src/Libraries/SmartStore.Core/packages.config +++ b/src/Libraries/SmartStore.Core/packages.config @@ -15,5 +15,4 @@ - \ No newline at end of file diff --git a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj index bd87aae610..b1c7331ec9 100644 --- a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj +++ b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Data SmartStore.Data - v4.6.1 + v4.7.2 512 @@ -105,9 +105,6 @@ ..\..\packages\Microsoft.SqlServer.Compact.4.0.8876.1\lib\net40\System.Data.SqlServerCe.dll - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - diff --git a/src/Libraries/SmartStore.Data/app.config b/src/Libraries/SmartStore.Data/app.config index 63141836b9..a89e0781b5 100644 --- a/src/Libraries/SmartStore.Data/app.config +++ b/src/Libraries/SmartStore.Data/app.config @@ -20,4 +20,4 @@ - + diff --git a/src/Libraries/SmartStore.Data/packages.config b/src/Libraries/SmartStore.Data/packages.config index caaa2b6499..a7e5d59fea 100644 --- a/src/Libraries/SmartStore.Data/packages.config +++ b/src/Libraries/SmartStore.Data/packages.config @@ -6,5 +6,4 @@ - \ No newline at end of file diff --git a/src/Libraries/SmartStore.Services/Properties/Settings.Designer.cs b/src/Libraries/SmartStore.Services/Properties/Settings.Designer.cs index 499ab870a5..89246c6f2e 100644 --- a/src/Libraries/SmartStore.Services/Properties/Settings.Designer.cs +++ b/src/Libraries/SmartStore.Services/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 2ac1065af7..df8e4ecff7 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Services SmartStore.Services - v4.6.1 + v4.7.2 512 @@ -144,9 +144,6 @@ - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll diff --git a/src/Libraries/SmartStore.Services/Web References/EuropeCheckVatService/Reference.cs b/src/Libraries/SmartStore.Services/Web References/EuropeCheckVatService/Reference.cs index 83c2471430..ce14537202 100644 --- a/src/Libraries/SmartStore.Services/Web References/EuropeCheckVatService/Reference.cs +++ b/src/Libraries/SmartStore.Services/Web References/EuropeCheckVatService/Reference.cs @@ -1,15 +1,15 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ // -// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.42000. +// Der Quellcode wurde automatisch mit Microsoft.VSDesigner generiert. Version 4.0.30319.42000. // #pragma warning disable 1591 diff --git a/src/Libraries/SmartStore.Services/app.config b/src/Libraries/SmartStore.Services/app.config index 16aef9ec68..10ff5d2982 100644 --- a/src/Libraries/SmartStore.Services/app.config +++ b/src/Libraries/SmartStore.Services/app.config @@ -48,4 +48,4 @@ - + diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index c879853538..618d223d67 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -22,6 +22,5 @@ - \ No newline at end of file diff --git a/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj b/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj index 01baf98b7b..7365b57355 100644 --- a/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj +++ b/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj @@ -18,7 +18,7 @@ Properties SmartStore.AmazonPay SmartStore.AmazonPay - v4.6.1 + v4.7.2 512 @@ -113,9 +113,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.AmazonPay/web.config b/src/Plugins/SmartStore.AmazonPay/web.config index 0982081bf2..803ea9b9aa 100644 --- a/src/Plugins/SmartStore.AmazonPay/web.config +++ b/src/Plugins/SmartStore.AmazonPay/web.config @@ -14,7 +14,7 @@ --> - + @@ -84,10 +84,6 @@ - - - - @@ -126,7 +122,7 @@ - + @@ -160,6 +156,14 @@ + + + + + + + + @@ -167,4 +171,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj b/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj index 3a1b76bde7..01628968ed 100644 --- a/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj +++ b/src/Plugins/SmartStore.Clickatell/SmartStore.Clickatell.csproj @@ -20,7 +20,7 @@ Properties SmartStore.Clickatell SmartStore.Clickatell - v4.6.1 + v4.7.2 512 @@ -106,9 +106,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.Clickatell/web.config b/src/Plugins/SmartStore.Clickatell/web.config index 81f0867c5c..552e56025b 100644 --- a/src/Plugins/SmartStore.Clickatell/web.config +++ b/src/Plugins/SmartStore.Clickatell/web.config @@ -15,7 +15,7 @@ --> - + @@ -81,10 +81,6 @@ - - - - @@ -111,7 +107,7 @@ - + @@ -145,6 +141,14 @@ + + + + + + + + @@ -152,4 +156,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj index 730aad63ee..3a0ad889a8 100644 --- a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj +++ b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj @@ -20,7 +20,7 @@ Properties SmartStore.DevTools SmartStore.DevTools - v4.6.1 + v4.7.2 512 ..\..\ @@ -128,9 +128,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.DevTools/Web.config b/src/Plugins/SmartStore.DevTools/Web.config index 21a2c8be1f..936ba70d6f 100644 --- a/src/Plugins/SmartStore.DevTools/Web.config +++ b/src/Plugins/SmartStore.DevTools/Web.config @@ -15,7 +15,7 @@ --> - + @@ -85,10 +85,6 @@ - - - - @@ -119,7 +115,7 @@ - + @@ -153,6 +149,14 @@ + + + + + + + + @@ -160,4 +164,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj b/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj index b9f6bfbf81..8045732912 100644 --- a/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj +++ b/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj @@ -20,7 +20,7 @@ Properties SmartStore.FacebookAuth SmartStore.FacebookAuth - v4.6.1 + v4.7.2 512 @@ -152,9 +152,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.FacebookAuth/web.config b/src/Plugins/SmartStore.FacebookAuth/web.config index 5e5393a498..d3ef8d4db1 100644 --- a/src/Plugins/SmartStore.FacebookAuth/web.config +++ b/src/Plugins/SmartStore.FacebookAuth/web.config @@ -15,7 +15,7 @@ --> - + @@ -85,10 +85,6 @@ - - - - @@ -119,7 +115,7 @@ - + @@ -153,6 +149,14 @@ + + + + + + + + @@ -160,4 +164,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj b/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj index 9f985db672..bc12815ad2 100644 --- a/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj +++ b/src/Plugins/SmartStore.GoogleAnalytics/SmartStore.GoogleAnalytics.csproj @@ -20,7 +20,7 @@ Properties SmartStore.GoogleAnalytics SmartStore.GoogleAnalytics - v4.6.1 + v4.7.2 512 @@ -99,9 +99,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.GoogleAnalytics/web.config b/src/Plugins/SmartStore.GoogleAnalytics/web.config index 63451742ac..21fe12fec3 100644 --- a/src/Plugins/SmartStore.GoogleAnalytics/web.config +++ b/src/Plugins/SmartStore.GoogleAnalytics/web.config @@ -14,7 +14,7 @@ --> - + @@ -80,10 +80,6 @@ - - - - @@ -110,7 +106,7 @@ - + @@ -144,6 +140,14 @@ + + + + + + + + @@ -151,4 +155,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj index 2cdba3d2d3..56ad46f35a 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj @@ -20,7 +20,7 @@ Properties SmartStore.GoogleMerchantCenter SmartStore.GoogleMerchantCenter - v4.6.1 + v4.7.2 512 @@ -124,9 +124,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/web.config b/src/Plugins/SmartStore.GoogleMerchantCenter/web.config index 81f0867c5c..552e56025b 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/web.config +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/web.config @@ -15,7 +15,7 @@ --> - + @@ -81,10 +81,6 @@ - - - - @@ -111,7 +107,7 @@ - + @@ -145,6 +141,14 @@ + + + + + + + + @@ -152,4 +156,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj b/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj index 1a8e7b55a5..5b6689d041 100644 --- a/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj +++ b/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj @@ -20,7 +20,7 @@ Properties SmartStore.OfflinePayment SmartStore.OfflinePayment - v4.6.1 + v4.7.2 512 @@ -112,9 +112,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.OfflinePayment/web.config b/src/Plugins/SmartStore.OfflinePayment/web.config index 81f0867c5c..552e56025b 100644 --- a/src/Plugins/SmartStore.OfflinePayment/web.config +++ b/src/Plugins/SmartStore.OfflinePayment/web.config @@ -15,7 +15,7 @@ --> - + @@ -81,10 +81,6 @@ - - - - @@ -111,7 +107,7 @@ - + @@ -145,6 +141,14 @@ + + + + + + + + @@ -152,4 +156,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.PayPal/Properties/Settings.Designer.cs b/src/Plugins/SmartStore.PayPal/Properties/Settings.Designer.cs index 919a54792a..7f4015c5da 100644 --- a/src/Plugins/SmartStore.PayPal/Properties/Settings.Designer.cs +++ b/src/Plugins/SmartStore.PayPal/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SmartStore.PayPal.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj b/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj index a13e30fcb4..5e49a320b9 100644 --- a/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj +++ b/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj @@ -20,7 +20,7 @@ Properties SmartStore.PayPal SmartStore.PayPal - v4.6.1 + v4.7.2 512 ..\..\ diff --git a/src/Plugins/SmartStore.PayPal/Web References/PayPalSvc/Reference.cs b/src/Plugins/SmartStore.PayPal/Web References/PayPalSvc/Reference.cs index cc0825153e..fce0b55bb7 100644 --- a/src/Plugins/SmartStore.PayPal/Web References/PayPalSvc/Reference.cs +++ b/src/Plugins/SmartStore.PayPal/Web References/PayPalSvc/Reference.cs @@ -23,7 +23,7 @@ namespace SmartStore.PayPal.PayPalSvc { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="PayPalAPISoapBinding", Namespace="urn:ebay:api:PayPalAPI")] @@ -1000,7 +1000,7 @@ private bool IsLocalFileSystemWebService(string url) { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="PayPalAPIAASoapBinding", Namespace="urn:ebay:api:PayPalAPI")] @@ -2229,7 +2229,7 @@ private bool IsLocalFileSystemWebService(string url) { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2275,7 +2275,7 @@ public UserIdPasswordType Credentials { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2380,7 +2380,7 @@ public string AuthToken { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2414,7 +2414,7 @@ public string Status { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2435,7 +2435,7 @@ public string ProfileID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2456,7 +2456,7 @@ public string ProfileID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2477,7 +2477,7 @@ public string ProfileID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2596,7 +2596,7 @@ public BasicAmountType LastPaymentAmount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -2631,7 +2631,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum CurrencyCodeType { @@ -3163,7 +3163,7 @@ public enum CurrencyCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -3377,7 +3377,7 @@ public bool FinalPaymentDueDateSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum RecurringPaymentsProfileStatusType { @@ -3399,7 +3399,7 @@ public enum RecurringPaymentsProfileStatusType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AutoBillType { @@ -3412,7 +3412,7 @@ public enum AutoBillType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -3469,7 +3469,7 @@ public string ProfileReference { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -3734,7 +3734,7 @@ public bool AddressNormalizationStatusSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum CountryCodeType { @@ -4500,7 +4500,7 @@ public enum CountryCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AddressOwnerCodeType { @@ -4516,7 +4516,7 @@ public enum AddressOwnerCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AddressStatusCodeType { @@ -4532,7 +4532,7 @@ public enum AddressStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AddressNormalizationStatusCodeType { @@ -4551,7 +4551,7 @@ public enum AddressNormalizationStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -4645,7 +4645,7 @@ public BasicAmountType TaxAmount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BillingPeriodType { @@ -4670,7 +4670,7 @@ public enum BillingPeriodType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -4864,7 +4864,7 @@ public ThreeDSecureRequestType ThreeDSecureRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum CreditCardTypeType { @@ -4892,7 +4892,7 @@ public enum CreditCardTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5047,7 +5047,7 @@ public EnhancedPayerInfoType EnhancedPayerInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PayPalUserStatusCodeType { @@ -5060,7 +5060,7 @@ public enum PayPalUserStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5129,7 +5129,7 @@ public string Suffix { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5162,7 +5162,7 @@ public string TaxId { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5171,7 +5171,7 @@ public partial class EnhancedPayerInfoType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5240,7 +5240,7 @@ public string AuthStatus3ds { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5322,7 +5322,7 @@ public string DCCReturnCode { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5355,7 +5355,7 @@ public string TransactionID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5460,7 +5460,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -5990,7 +5990,7 @@ public string BinEligibility { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentTransactionCodeType { @@ -6066,7 +6066,7 @@ public enum PaymentTransactionCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentCodeType { @@ -6082,7 +6082,7 @@ public enum PaymentCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum RefundSourceCodeType { @@ -6101,7 +6101,7 @@ public enum RefundSourceCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentStatusCodeType { @@ -6163,7 +6163,7 @@ public enum PaymentStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PendingStatusCodeType { @@ -6212,7 +6212,7 @@ public enum PendingStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ReversalReasonCodeType { @@ -6238,7 +6238,7 @@ public enum ReversalReasonCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum POSTransactionCodeType { @@ -6251,7 +6251,7 @@ public enum POSTransactionCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6333,7 +6333,7 @@ public string SecureMerchantAccountID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6394,7 +6394,7 @@ public RiskFilterDetailsType[] ReportFilters { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6439,7 +6439,7 @@ public string Description { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6448,7 +6448,7 @@ public partial class EnhancedPaymentInfoType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6519,7 +6519,7 @@ public ErrorParameterType[] ErrorParameters { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum SeverityCodeType { @@ -6538,7 +6538,7 @@ public enum SeverityCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6572,7 +6572,7 @@ public string ParamID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6605,7 +6605,7 @@ public string InstrumentID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6638,7 +6638,7 @@ public BMLOfferInfoType BMLOfferInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6659,7 +6659,7 @@ public string OfferTrackingID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6692,7 +6692,7 @@ public AddressType BillingAddress { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6749,7 +6749,7 @@ public PaymentInfoType PaymentInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6819,7 +6819,7 @@ public string ProtectionEligibilityType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6876,7 +6876,7 @@ public string PartnerFundingSourceID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -6909,7 +6909,7 @@ public string CoupledPaymentID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7016,7 +7016,7 @@ public CoupledPaymentInfoType[] CoupledPaymentInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7085,7 +7085,7 @@ public string ShippingOptionName { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7131,7 +7131,7 @@ public string ImmutableID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7165,7 +7165,7 @@ public string ExternalRememberMeID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7210,7 +7210,7 @@ public ErrorType PaymentError { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7279,7 +7279,7 @@ public string SubType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7388,7 +7388,7 @@ public IncentiveAppliedDetailsType[] IncentiveAppliedDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum IncentiveSiteAppliedOnType { @@ -7407,7 +7407,7 @@ public enum IncentiveSiteAppliedOnType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum IncentiveAppliedStatusType { @@ -7422,7 +7422,7 @@ public enum IncentiveAppliedStatusType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -7736,7 +7736,7 @@ public RefreshTokenStatusDetailsType RefreshTokenStatusDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8246,7 +8246,7 @@ public bool PaymentReasonSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentCategoryType { @@ -8259,7 +8259,7 @@ public enum PaymentCategoryType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ShippingServiceCodeType { @@ -8314,7 +8314,7 @@ public enum ShippingServiceCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8542,7 +8542,7 @@ public bool ItemCategorySpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8599,7 +8599,7 @@ public string CartID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ProductCategoryType { @@ -8675,7 +8675,7 @@ public enum ProductCategoryType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8710,7 +8710,7 @@ public double Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8719,7 +8719,7 @@ public partial class EnhancedItemDataType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ItemCategoryType { @@ -8732,7 +8732,7 @@ public enum ItemCategoryType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AllowedPaymentMethodType { @@ -8751,7 +8751,7 @@ public enum AllowedPaymentMethodType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8760,7 +8760,7 @@ public partial class EnhancedPaymentDataType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentActionCodeType { @@ -8779,7 +8779,7 @@ public enum PaymentActionCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum RecurringFlagType { @@ -8792,7 +8792,7 @@ public enum RecurringFlagType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentReasonType { @@ -8808,7 +8808,7 @@ public enum PaymentReasonType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8842,7 +8842,7 @@ public ErrorType[] AuthorizationError { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AckCodeType { @@ -8870,7 +8870,7 @@ public enum AckCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8917,7 +8917,7 @@ public ErrorType[] SetDataError { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -8950,7 +8950,7 @@ public AuthorizationResponseType AuthorizationResponse { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9007,7 +9007,7 @@ public string SubType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9126,7 +9126,7 @@ public string ErrorCode { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum IncentiveTypeCodeType { @@ -9151,7 +9151,7 @@ public enum IncentiveTypeCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9185,7 +9185,7 @@ public string RequestId { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9268,7 +9268,7 @@ public string PayerID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9325,7 +9325,7 @@ public string PayerID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9394,7 +9394,7 @@ public APIAuthenticationType Type { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum APIAuthenticationType { @@ -9411,7 +9411,7 @@ public enum APIAuthenticationType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9613,7 +9613,7 @@ public string BankAccountVerificationStatus { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BoardingStatusType { @@ -9632,7 +9632,7 @@ public enum BoardingStatusType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum UserWithdrawalLimitTypeType { @@ -9648,7 +9648,7 @@ public enum UserWithdrawalLimitTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9741,7 +9741,7 @@ public AddressType BillingAddress { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum MerchantPullStatusCodeType { @@ -9754,7 +9754,7 @@ public enum MerchantPullStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9883,7 +9883,7 @@ public BasicAmountType NetAmount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -9976,7 +9976,7 @@ public string PaymentSourceID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10021,7 +10021,7 @@ public MerchantPullInfoType MerchantPullInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10054,7 +10054,7 @@ public string EciSubmitted3DS { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10087,7 +10087,7 @@ public ThreeDSecureResponseType ThreeDSecureResponse { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10144,7 +10144,7 @@ public string AmountCurrency { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10203,7 +10203,7 @@ public string multiItem { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10237,7 +10237,7 @@ public string period { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10408,7 +10408,7 @@ public string recurring { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10443,7 +10443,7 @@ public string value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10633,7 +10633,7 @@ public OptionType[] Options { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -10937,7 +10937,7 @@ public string StyleNumber { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum UnitOfMeasure { @@ -11017,7 +11017,7 @@ public enum UnitOfMeasure { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11099,7 +11099,7 @@ public string RedeemedOfferID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum RedeemedOfferType { @@ -11118,7 +11118,7 @@ public enum RedeemedOfferType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11151,7 +11151,7 @@ public BasicAmountType Amount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11245,7 +11245,7 @@ public AuctionInfoType Auction { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11290,7 +11290,7 @@ public string ReceiverID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11480,7 +11480,7 @@ public string[] SurveyChoiceSelected { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11489,7 +11489,7 @@ public partial class EnhancedCompleteRecoupResponseDetailsType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11548,7 +11548,7 @@ public bool PendingReasonSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11675,7 +11675,7 @@ public bool ModifyDateSpecified { [System.Xml.Serialization.XmlIncludeAttribute(typeof(BMManageButtonStatusResponseType))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(BMUpdateButtonResponseType))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(BMCreateButtonResponseType))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11776,7 +11776,7 @@ public string Build { } /// - [System.Xml.Serialization.XmlIgnoreAttribute()] + [System.Xml.Serialization.XmlAnyElementAttribute(Order=6)] public System.Xml.XmlElement Any { get { return this.anyField; @@ -11788,7 +11788,7 @@ public System.Xml.XmlElement Any { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11797,7 +11797,7 @@ public partial class ExternalRememberMeOptOutResponseType : AbstractResponseType } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11819,7 +11819,7 @@ public ReverseTransactionResponseDetailsType ReverseTransactionResponseDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11854,7 +11854,7 @@ public string Locale { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11876,7 +11876,7 @@ public UpdateRecurringPaymentsProfileResponseDetailsType UpdateRecurringPayments } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11898,7 +11898,7 @@ public BillOutstandingAmountResponseDetailsType BillOutstandingAmountResponseDet } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11920,7 +11920,7 @@ public ManageRecurringPaymentsProfileStatusResponseDetailsType ManageRecurringPa } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11942,7 +11942,7 @@ public GetRecurringPaymentsProfileDetailsResponseDetailsType GetRecurringPayment } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11964,7 +11964,7 @@ public CreateRecurringPaymentsProfileResponseDetailsType CreateRecurringPayments } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -11986,7 +11986,7 @@ public DoNonReferencedCreditResponseDetailsType DoNonReferencedCreditResponseDet } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12021,7 +12021,7 @@ public FMFDetailsType FMFDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12043,7 +12043,7 @@ public string BillingAgreementID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12065,7 +12065,7 @@ public GetBillingAgreementCustomerDetailsResponseDetailsType GetBillingAgreement } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12087,7 +12087,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12135,7 +12135,7 @@ public BasicAmountType[] BalanceHoldings { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12157,7 +12157,7 @@ public DoMobileCheckoutPaymentResponseDetailsType DoMobileCheckoutPaymentRespons } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12179,7 +12179,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12227,7 +12227,7 @@ public string PaymentPending { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12236,7 +12236,7 @@ public partial class CreateMobilePaymentResponseType : AbstractResponseType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12272,7 +12272,7 @@ public AuthorizationInfoType AuthorizationInfo { /// [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoUATPAuthorizationResponseType))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12333,7 +12333,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12394,7 +12394,7 @@ public string MsgSubID1 { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12439,7 +12439,7 @@ public int ExpYear { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12474,7 +12474,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12522,7 +12522,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12544,7 +12544,7 @@ public DoCaptureResponseDetailsType DoCaptureResponseDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12566,7 +12566,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12718,7 +12718,7 @@ public string PaymentAdviceCode { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12754,7 +12754,7 @@ public string Status { /// [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoUATPExpressCheckoutPaymentResponseType))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12789,7 +12789,7 @@ public FMFDetailsType FMFDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12811,7 +12811,7 @@ public UATPDetailsType UATPDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12833,7 +12833,7 @@ public GetExpressCheckoutDetailsResponseDetailsType GetExpressCheckoutDetailsRes } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12855,7 +12855,7 @@ public ExecuteCheckoutOperationsResponseDetailsType ExecuteCheckoutOperationsRes } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12877,7 +12877,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12899,7 +12899,7 @@ public GetIncentiveEvaluationResponseDetailsType GetIncentiveEvaluationResponseD } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12921,7 +12921,7 @@ public GetAccessPermissionDetailsResponseDetailsType GetAccessPermissionDetailsR } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12943,7 +12943,7 @@ public string Status { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12965,7 +12965,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -12987,7 +12987,7 @@ public GetAuthDetailsResponseDetailsType GetAuthDetailsResponseDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13009,7 +13009,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13031,7 +13031,7 @@ public GetBoardingDetailsResponseDetailsType GetBoardingDetailsResponseDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13053,7 +13053,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13153,7 +13153,7 @@ public string PayPalToken { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum MatchStatusCodeType { @@ -13169,7 +13169,7 @@ public enum MatchStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13191,7 +13191,7 @@ public BAUpdateResponseDetailsType BAUpdateResponseDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13200,7 +13200,7 @@ public partial class MassPayResponseType : AbstractResponseType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13222,7 +13222,7 @@ public PaymentTransactionSearchResultType[] PaymentTransactions { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13257,7 +13257,7 @@ public FMFDetailsType FMFDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13292,7 +13292,7 @@ public ThreeDSecureInfoType ThreeDSecureDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13301,7 +13301,7 @@ public partial class CancelRecoupResponseType : AbstractResponseType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13323,7 +13323,7 @@ public EnhancedCompleteRecoupResponseDetailsType EnhancedCompleteRecoupResponseD } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13332,7 +13332,7 @@ public partial class InitiateRecoupResponseType : AbstractResponseType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13445,7 +13445,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13467,7 +13467,7 @@ public ButtonSearchResultType[] ButtonSearchResult { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13593,7 +13593,7 @@ public string[] DigitalDownloadKeys { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13662,7 +13662,7 @@ public string ItemCost { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13743,7 +13743,7 @@ public string OptionCost { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -13752,7 +13752,7 @@ public partial class BMSetInventoryResponseType : AbstractResponseType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14060,7 +14060,7 @@ public string ButtonLanguage { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ButtonTypeType { @@ -14097,7 +14097,7 @@ public enum ButtonTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ButtonCodeType { @@ -14116,7 +14116,7 @@ public enum ButtonCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ButtonSubTypeType { @@ -14129,7 +14129,7 @@ public enum ButtonSubTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14163,7 +14163,7 @@ public OptionSelectionDetailsType[] OptionSelectionDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14234,7 +14234,7 @@ public InstallmentDetailsType[] PaymentPeriod { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum OptionTypeListType { @@ -14253,7 +14253,7 @@ public enum OptionTypeListType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14373,7 +14373,7 @@ public string TaxAmount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ButtonImageType { @@ -14389,7 +14389,7 @@ public enum ButtonImageType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BuyNowTextType { @@ -14402,7 +14402,7 @@ public enum BuyNowTextType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum SubscribeTextType { @@ -14415,7 +14415,7 @@ public enum SubscribeTextType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14424,7 +14424,7 @@ public partial class BMManageButtonStatusResponseType : AbstractResponseType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14485,7 +14485,7 @@ public string HostedButtonID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14546,7 +14546,7 @@ public string HostedButtonID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14567,7 +14567,7 @@ public string TransactionID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14687,7 +14687,7 @@ public BasicAmountType TaxAmount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14952,7 +14952,7 @@ public BillingPeriodDetailsType_Update PaymentPeriod { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -14997,7 +14997,7 @@ public string Note { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15042,7 +15042,7 @@ public string Note { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum StatusChangeActionType { @@ -15058,7 +15058,7 @@ public enum StatusChangeActionType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15104,7 +15104,7 @@ public bool FailedInitialAmountActionSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum FailedPaymentActionType { @@ -15117,7 +15117,7 @@ public enum FailedPaymentActionType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15224,7 +15224,7 @@ public bool AutoBillOutstandingAmountSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15294,7 +15294,7 @@ public PaymentDetailsItemType[] PaymentDetailsItem { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15387,7 +15387,7 @@ public string Comment { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15408,7 +15408,7 @@ public string DeviceID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15429,7 +15429,7 @@ public DeviceDetailsType DeviceDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15475,7 +15475,7 @@ public string CreditCardNumber { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15644,7 +15644,7 @@ public string IssueNumber { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15798,7 +15798,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum MerchantPullPaymentCodeType { @@ -15814,7 +15814,7 @@ public enum MerchantPullPaymentCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -15959,7 +15959,7 @@ public string ReqBillingAddress { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16029,7 +16029,7 @@ public string BillingAgreementCustom { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BillingCodeType { @@ -16051,7 +16051,7 @@ public enum BillingCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16254,7 +16254,7 @@ public string BuyerEmail { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16299,7 +16299,7 @@ public string Extension { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16320,7 +16320,7 @@ public PhoneNumberType Phone { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16511,7 +16511,7 @@ public string ShareHomeAddress { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum MobilePaymentCodeType { @@ -16530,7 +16530,7 @@ public enum MobilePaymentCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum MobileRecipientCodeType { @@ -16543,7 +16543,7 @@ public enum MobileRecipientCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16576,7 +16576,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16670,7 +16670,7 @@ public bool ReturnFMFDetailsSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -16883,7 +16883,7 @@ public string EndorsementOrRestrictions { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17061,7 +17061,7 @@ public FlightDetailsType[] FlightDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17082,7 +17082,7 @@ public AirlineItineraryType AirlineItinerary { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17360,7 +17360,7 @@ public CoupledBucketsType[] CoupledBuckets { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17419,7 +17419,7 @@ public string[] PaymentRequestID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum CoupleType { @@ -17429,7 +17429,7 @@ public enum CoupleType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17450,7 +17450,7 @@ public bool IsRequested { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17471,7 +17471,7 @@ public string ReqBillingAddress { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17492,7 +17492,7 @@ public IdentificationInfoType IdentificationInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17537,7 +17537,7 @@ public IdentityTokenInfoType IdentityTokenInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17558,7 +17558,7 @@ public string SessionToken { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17579,7 +17579,7 @@ public string ExternalRememberMeID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17600,7 +17600,7 @@ public string AccessToken { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17634,7 +17634,7 @@ public bool PaymentTypeSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17667,7 +17667,7 @@ public BasicAmountType MaxAmount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17749,7 +17749,7 @@ public string Custom { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ApprovalTypeType { @@ -17762,7 +17762,7 @@ public enum ApprovalTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ApprovalSubTypeType { @@ -17781,7 +17781,7 @@ public enum ApprovalSubTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17927,7 +17927,7 @@ public ExternalPartnerTrackingDetailsType ExternalPartnerTrackingDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum UserChannelCodeType { @@ -17958,7 +17958,7 @@ public enum UserChannelCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -17979,7 +17979,7 @@ public string ExternalPartnerSegmentID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18024,7 +18024,7 @@ public AuthorizationRequestType AuthorizationRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18045,7 +18045,7 @@ public string InContextPaymentButtonImage { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18078,7 +18078,7 @@ public string InContextReturnURL { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18111,7 +18111,7 @@ public string ExternalRememberMeOwnerID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18144,7 +18144,7 @@ public ExternalRememberMeOwnerDetailsType ExternalRememberMeOwnerDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18178,7 +18178,7 @@ public IncentiveApplyIndicationType[] ApplyIndication { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18211,7 +18211,7 @@ public string ItemId { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18256,7 +18256,7 @@ public string ShippingOptionName { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18338,7 +18338,7 @@ public IdentificationInfoType IdentificationInfo { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18456,7 +18456,7 @@ public bool OtherPaymentMethodHideLabelSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18465,7 +18465,7 @@ public partial class EnhancedCheckoutDataType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -18511,7 +18511,7 @@ public bool UserSelectedFundingSourceSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum UserSelectedFundingSourceType { @@ -18530,7 +18530,7 @@ public enum UserSelectedFundingSourceType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -19461,7 +19461,7 @@ public CoupledBucketsType[] CoupledBuckets { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum SolutionTypeType { @@ -19474,7 +19474,7 @@ public enum SolutionTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum LandingPageType { @@ -19490,7 +19490,7 @@ public enum LandingPageType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ChannelType { @@ -19503,7 +19503,7 @@ public enum ChannelType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum TotalType { @@ -19516,7 +19516,7 @@ public enum TotalType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -19587,7 +19587,7 @@ public bool RequestDetailLevelSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum IncentiveRequestCodeType { @@ -19600,7 +19600,7 @@ public enum IncentiveRequestCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum IncentiveRequestDetailLevelCodeType { @@ -19613,7 +19613,7 @@ public enum IncentiveRequestDetailLevelCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -19696,7 +19696,7 @@ public string ItemQuantity { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -19814,7 +19814,7 @@ public BasicAmountType BucketTotalAmt { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -19898,7 +19898,7 @@ public IncentiveRequestDetailsType RequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -20105,7 +20105,7 @@ public AddressType Address { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -20334,7 +20334,7 @@ public AddressType Address { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -20391,7 +20391,7 @@ public string AccountNumber { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BankAccountTypeType { @@ -20404,7 +20404,7 @@ public enum BankAccountTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -20461,7 +20461,7 @@ public string SSN { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -20742,7 +20742,7 @@ public string CustomerServicePhone { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BusinessTypeType { @@ -20770,7 +20770,7 @@ public enum BusinessTypeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BusinessCategoryType { @@ -20890,7 +20890,7 @@ public enum BusinessCategoryType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum BusinessSubCategoryType { @@ -21965,7 +21965,7 @@ public enum BusinessSubCategoryType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AverageTransactionPriceType { @@ -22016,7 +22016,7 @@ public enum AverageTransactionPriceType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum AverageMonthlyVolumeType { @@ -22051,7 +22051,7 @@ public enum AverageMonthlyVolumeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum SalesVenueType { @@ -22074,7 +22074,7 @@ public enum SalesVenueType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PercentageRevenueFromOnlineSalesType { @@ -22101,7 +22101,7 @@ public enum PercentageRevenueFromOnlineSalesType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22219,7 +22219,7 @@ public BankAccountDetailsType BankAccount { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum MarketingCategoryType { @@ -22310,7 +22310,7 @@ public enum MarketingCategoryType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22391,7 +22391,7 @@ public string Note { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22581,7 +22581,7 @@ public string SoftDescriptor { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22590,7 +22590,7 @@ public partial class EnhancedCancelRecoupRequestDetailsType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22599,7 +22599,7 @@ public partial class EnhancedCompleteRecoupRequestDetailsType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22608,7 +22608,7 @@ public partial class EnhancedInitiateRecoupRequestDetailsType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22698,7 +22698,7 @@ public string TerminalID { [System.Xml.Serialization.XmlIncludeAttribute(typeof(BMManageButtonStatusRequestType))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(BMUpdateButtonRequestType))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(BMCreateButtonRequestType))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22745,7 +22745,7 @@ public string Version { } /// - [System.Xml.Serialization.XmlIgnoreAttribute()] + [System.Xml.Serialization.XmlAnyElementAttribute()] public System.Xml.XmlElement Any { get { return this.anyField; @@ -22757,7 +22757,7 @@ public System.Xml.XmlElement Any { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum DetailLevelCodeType { @@ -22773,7 +22773,7 @@ public enum DetailLevelCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22806,7 +22806,7 @@ public ExternalRememberMeOwnerDetailsType ExternalRememberMeOwnerDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22828,7 +22828,7 @@ public ReverseTransactionRequestDetailsType ReverseTransactionRequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22837,7 +22837,7 @@ public partial class GetPalDetailsRequestType : AbstractRequestType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22859,7 +22859,7 @@ public UpdateRecurringPaymentsProfileRequestDetailsType UpdateRecurringPaymentsP } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22881,7 +22881,7 @@ public BillOutstandingAmountRequestDetailsType BillOutstandingAmountRequestDetai } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22903,7 +22903,7 @@ public ManageRecurringPaymentsProfileStatusRequestDetailsType ManageRecurringPay } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22924,7 +22924,7 @@ public string ProfileID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22946,7 +22946,7 @@ public CreateRecurringPaymentsProfileRequestDetailsType CreateRecurringPaymentsP } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -22968,7 +22968,7 @@ public DoNonReferencedCreditRequestDetailsType DoNonReferencedCreditRequestDetai } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23015,7 +23015,7 @@ public bool ReturnFMFDetailsSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23036,7 +23036,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23057,7 +23057,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23079,7 +23079,7 @@ public SetCustomerBillingAgreementRequestDetailsType SetCustomerBillingAgreement } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23100,7 +23100,7 @@ public string ReturnAllCurrencies { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23121,7 +23121,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23143,7 +23143,7 @@ public SetMobileCheckoutRequestDetailsType SetMobileCheckoutRequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23165,7 +23165,7 @@ public GetMobileStatusRequestDetailsType GetMobileStatusRequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23187,7 +23187,7 @@ public CreateMobilePaymentRequestDetailsType CreateMobilePaymentRequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23270,7 +23270,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum TransactionEntityType { @@ -23292,7 +23292,7 @@ public enum TransactionEntityType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23338,7 +23338,7 @@ public string IPAddress { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23542,7 +23542,7 @@ public string IPAddress { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23587,7 +23587,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23632,7 +23632,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23765,7 +23765,7 @@ public TupleType[] MerchantData { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum CompleteCodeType { @@ -23778,7 +23778,7 @@ public enum CompleteCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23823,7 +23823,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum APIType { @@ -23836,7 +23836,7 @@ public enum APIType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23883,7 +23883,7 @@ public bool ReturnFMFDetailsSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23916,7 +23916,7 @@ public FMFPendingTransactionActionType Action { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum FMFPendingTransactionActionType { @@ -23930,7 +23930,7 @@ public enum FMFPendingTransactionActionType { /// [System.Xml.Serialization.XmlIncludeAttribute(typeof(DoUATPExpressCheckoutPaymentRequestType))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23977,7 +23977,7 @@ public bool ReturnFMFDetailsSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -23986,7 +23986,7 @@ public partial class DoUATPExpressCheckoutPaymentRequestType : DoExpressCheckout } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24007,7 +24007,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24029,7 +24029,7 @@ public ExecuteCheckoutOperationsRequestDetailsType ExecuteCheckoutOperationsRequ } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24051,7 +24051,7 @@ public SetExpressCheckoutRequestDetailsType SetExpressCheckoutRequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24073,7 +24073,7 @@ public GetIncentiveEvaluationRequestDetailsType GetIncentiveEvaluationRequestDet } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24094,7 +24094,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24115,7 +24115,7 @@ public string PayerID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24137,7 +24137,7 @@ public SetAccessPermissionsRequestDetailsType SetAccessPermissionsRequestDetails } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24158,7 +24158,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24180,7 +24180,7 @@ public SetAuthFlowParamRequestDetailsType SetAuthFlowParamRequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24201,7 +24201,7 @@ public string Token { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24223,7 +24223,7 @@ public EnterBoardingRequestDetailsType EnterBoardingRequestDetails { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24268,7 +24268,7 @@ public string Zip { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24338,7 +24338,7 @@ public string BillingAgreementCustom { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24409,7 +24409,7 @@ public MassPayRequestItemType[] MassPayItem { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ReceiverInfoCodeType { @@ -24425,7 +24425,7 @@ public enum ReceiverInfoCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24666,7 +24666,7 @@ public bool StatusSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentTransactionClassCodeType { @@ -24739,7 +24739,7 @@ public enum PaymentTransactionClassCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum PaymentTransactionStatusCodeType { @@ -24761,7 +24761,7 @@ public enum PaymentTransactionStatusCodeType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24808,7 +24808,7 @@ public bool ReturnFMFDetailsSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24829,7 +24829,7 @@ public string TransactionID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24851,7 +24851,7 @@ public EnhancedCancelRecoupRequestDetailsType EnhancedCancelRecoupRequestDetails } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24873,7 +24873,7 @@ public EnhancedCompleteRecoupRequestDetailsType EnhancedCompleteRecoupRequestDet } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -24895,7 +24895,7 @@ public EnhancedInitiateRecoupRequestDetailsType EnhancedInitiateRecoupRequestDet } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25102,7 +25102,7 @@ public string MsgSubID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum RefundType { @@ -25121,7 +25121,7 @@ public enum RefundType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25180,7 +25180,7 @@ public bool EndDateSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25201,7 +25201,7 @@ public string HostedButtonID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25333,7 +25333,7 @@ public string[] DigitalDownloadKeys { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25354,7 +25354,7 @@ public string HostedButtonID { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25400,7 +25400,7 @@ public bool ButtonStatusSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:ebay:apis:eBLBaseComponents")] public enum ButtonStatusType { @@ -25410,7 +25410,7 @@ public enum ButtonStatusType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25669,7 +25669,7 @@ public string ButtonLanguage { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25916,7 +25916,7 @@ public string ButtonLanguage { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25937,7 +25937,7 @@ public RefundTransactionRequestType RefundTransactionRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25958,7 +25958,7 @@ public InitiateRecoupRequestType InitiateRecoupRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -25979,7 +25979,7 @@ public CompleteRecoupRequestType CompleteRecoupRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26000,7 +26000,7 @@ public CancelRecoupRequestType CancelRecoupRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26021,7 +26021,7 @@ public GetTransactionDetailsRequestType GetTransactionDetailsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26042,7 +26042,7 @@ public BMCreateButtonRequestType BMCreateButtonRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26063,7 +26063,7 @@ public BMUpdateButtonRequestType BMUpdateButtonRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26084,7 +26084,7 @@ public BMManageButtonStatusRequestType BMManageButtonStatusRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26105,7 +26105,7 @@ public BMGetButtonDetailsRequestType BMGetButtonDetailsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26126,7 +26126,7 @@ public BMSetInventoryRequestType BMSetInventoryRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26147,7 +26147,7 @@ public BMGetInventoryRequestType BMGetInventoryRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26168,7 +26168,7 @@ public BMButtonSearchRequestType BMButtonSearchRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26189,7 +26189,7 @@ public BillUserRequestType BillUserRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26210,7 +26210,7 @@ public TransactionSearchRequestType TransactionSearchRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26231,7 +26231,7 @@ public MassPayRequestType MassPayRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26252,7 +26252,7 @@ public BAUpdateRequestType BAUpdateRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26273,7 +26273,7 @@ public AddressVerifyRequestType AddressVerifyRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26294,7 +26294,7 @@ public EnterBoardingRequestType EnterBoardingRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26315,7 +26315,7 @@ public GetBoardingDetailsRequestType GetBoardingDetailsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26336,7 +26336,7 @@ public CreateMobilePaymentRequestType CreateMobilePaymentRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26357,7 +26357,7 @@ public GetMobileStatusRequestType GetMobileStatusRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26378,7 +26378,7 @@ public SetMobileCheckoutRequestType SetMobileCheckoutRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26399,7 +26399,7 @@ public DoMobileCheckoutPaymentRequestType DoMobileCheckoutPaymentRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26420,7 +26420,7 @@ public GetBalanceRequestType GetBalanceRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26441,7 +26441,7 @@ public GetPalDetailsRequestType GetPalDetailsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26462,7 +26462,7 @@ public DoExpressCheckoutPaymentRequestType DoExpressCheckoutPaymentRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26483,7 +26483,7 @@ public DoUATPExpressCheckoutPaymentRequestType DoUATPExpressCheckoutPaymentReque } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26504,7 +26504,7 @@ public SetAuthFlowParamRequestType SetAuthFlowParamRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26525,7 +26525,7 @@ public GetAuthDetailsRequestType GetAuthDetailsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26546,7 +26546,7 @@ public SetAccessPermissionsRequestType SetAccessPermissionsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26567,7 +26567,7 @@ public UpdateAccessPermissionsRequestType UpdateAccessPermissionsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26588,7 +26588,7 @@ public GetAccessPermissionDetailsRequestType GetAccessPermissionDetailsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26609,7 +26609,7 @@ public GetIncentiveEvaluationRequestType GetIncentiveEvaluationRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26630,7 +26630,7 @@ public SetExpressCheckoutRequestType SetExpressCheckoutRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26651,7 +26651,7 @@ public ExecuteCheckoutOperationsRequestType ExecuteCheckoutOperationsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26672,7 +26672,7 @@ public GetExpressCheckoutDetailsRequestType GetExpressCheckoutDetailsRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26693,7 +26693,7 @@ public DoDirectPaymentRequestType DoDirectPaymentRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26714,7 +26714,7 @@ public ManagePendingTransactionStatusRequestType ManagePendingTransactionStatusR } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26735,7 +26735,7 @@ public DoCancelRequestType DoCancelRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26756,7 +26756,7 @@ public DoCaptureRequestType DoCaptureRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26777,7 +26777,7 @@ public DoReauthorizationRequestType DoReauthorizationRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26798,7 +26798,7 @@ public DoVoidRequestType DoVoidRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26819,7 +26819,7 @@ public DoAuthorizationRequestType DoAuthorizationRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26840,7 +26840,7 @@ public UpdateAuthorizationRequestType UpdateAuthorizationRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26861,7 +26861,7 @@ public SetCustomerBillingAgreementRequestType SetCustomerBillingAgreementRequest } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26882,7 +26882,7 @@ public GetBillingAgreementCustomerDetailsRequestType GetBillingAgreementCustomer } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26903,7 +26903,7 @@ public CreateBillingAgreementRequestType CreateBillingAgreementRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26924,7 +26924,7 @@ public DoReferenceTransactionRequestType DoReferenceTransactionRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26945,7 +26945,7 @@ public DoNonReferencedCreditRequestType DoNonReferencedCreditRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26966,7 +26966,7 @@ public DoUATPAuthorizationRequestType DoUATPAuthorizationRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -26987,7 +26987,7 @@ public CreateRecurringPaymentsProfileRequestType CreateRecurringPaymentsProfileR } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -27008,7 +27008,7 @@ public GetRecurringPaymentsProfileDetailsRequestType GetRecurringPaymentsProfile } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -27029,7 +27029,7 @@ public ManageRecurringPaymentsProfileStatusRequestType ManageRecurringPaymentsPr } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -27050,7 +27050,7 @@ public BillOutstandingAmountRequestType BillOutstandingAmountRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -27071,7 +27071,7 @@ public UpdateRecurringPaymentsProfileRequestType UpdateRecurringPaymentsProfileR } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -27092,7 +27092,7 @@ public ReverseTransactionRequestType ReverseTransactionRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.6.1064.2")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.8.3752.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -27113,11 +27113,11 @@ public ExternalRememberMeOptOutRequestType ExternalRememberMeOptOutRequest { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void RefundTransactionCompletedEventHandler(object sender, RefundTransactionCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class RefundTransactionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27139,11 +27139,11 @@ public RefundTransactionResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void InitiateRecoupCompletedEventHandler(object sender, InitiateRecoupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class InitiateRecoupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27165,11 +27165,11 @@ public InitiateRecoupResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void CompleteRecoupCompletedEventHandler(object sender, CompleteRecoupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CompleteRecoupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27191,11 +27191,11 @@ public CompleteRecoupResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void CancelRecoupCompletedEventHandler(object sender, CancelRecoupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CancelRecoupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27217,11 +27217,11 @@ public CancelRecoupResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetTransactionDetailsCompletedEventHandler(object sender, GetTransactionDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetTransactionDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27243,11 +27243,11 @@ public GetTransactionDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BMCreateButtonCompletedEventHandler(object sender, BMCreateButtonCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BMCreateButtonCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27269,11 +27269,11 @@ public BMCreateButtonResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BMUpdateButtonCompletedEventHandler(object sender, BMUpdateButtonCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BMUpdateButtonCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27295,11 +27295,11 @@ public BMUpdateButtonResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BMManageButtonStatusCompletedEventHandler(object sender, BMManageButtonStatusCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BMManageButtonStatusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27321,11 +27321,11 @@ public BMManageButtonStatusResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BMGetButtonDetailsCompletedEventHandler(object sender, BMGetButtonDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BMGetButtonDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27347,11 +27347,11 @@ public BMGetButtonDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BMSetInventoryCompletedEventHandler(object sender, BMSetInventoryCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BMSetInventoryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27373,11 +27373,11 @@ public BMSetInventoryResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BMGetInventoryCompletedEventHandler(object sender, BMGetInventoryCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BMGetInventoryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27399,11 +27399,11 @@ public BMGetInventoryResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BMButtonSearchCompletedEventHandler(object sender, BMButtonSearchCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BMButtonSearchCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27425,11 +27425,11 @@ public BMButtonSearchResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BillUserCompletedEventHandler(object sender, BillUserCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BillUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27451,11 +27451,11 @@ public BillUserResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void TransactionSearchCompletedEventHandler(object sender, TransactionSearchCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class TransactionSearchCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27477,11 +27477,11 @@ public TransactionSearchResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void MassPayCompletedEventHandler(object sender, MassPayCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class MassPayCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27503,11 +27503,11 @@ public MassPayResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BillAgreementUpdateCompletedEventHandler(object sender, BillAgreementUpdateCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BillAgreementUpdateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27529,11 +27529,11 @@ public BAUpdateResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void AddressVerifyCompletedEventHandler(object sender, AddressVerifyCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class AddressVerifyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27555,11 +27555,11 @@ public AddressVerifyResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void EnterBoardingCompletedEventHandler(object sender, EnterBoardingCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class EnterBoardingCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27581,11 +27581,11 @@ public EnterBoardingResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetBoardingDetailsCompletedEventHandler(object sender, GetBoardingDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetBoardingDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27607,11 +27607,11 @@ public GetBoardingDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void CreateMobilePaymentCompletedEventHandler(object sender, CreateMobilePaymentCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CreateMobilePaymentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27633,11 +27633,11 @@ public CreateMobilePaymentResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetMobileStatusCompletedEventHandler(object sender, GetMobileStatusCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetMobileStatusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27659,11 +27659,11 @@ public GetMobileStatusResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void SetMobileCheckoutCompletedEventHandler(object sender, SetMobileCheckoutCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetMobileCheckoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27685,11 +27685,11 @@ public SetMobileCheckoutResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoMobileCheckoutPaymentCompletedEventHandler(object sender, DoMobileCheckoutPaymentCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoMobileCheckoutPaymentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27711,11 +27711,11 @@ public DoMobileCheckoutPaymentResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetBalanceCompletedEventHandler(object sender, GetBalanceCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetBalanceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27737,11 +27737,11 @@ public GetBalanceResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetPalDetailsCompletedEventHandler(object sender, GetPalDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetPalDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27763,11 +27763,11 @@ public GetPalDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoExpressCheckoutPaymentCompletedEventHandler(object sender, DoExpressCheckoutPaymentCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoExpressCheckoutPaymentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27789,11 +27789,11 @@ public DoExpressCheckoutPaymentResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoUATPExpressCheckoutPaymentCompletedEventHandler(object sender, DoUATPExpressCheckoutPaymentCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoUATPExpressCheckoutPaymentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27815,11 +27815,11 @@ public DoUATPExpressCheckoutPaymentResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void SetAuthFlowParamCompletedEventHandler(object sender, SetAuthFlowParamCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetAuthFlowParamCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27841,11 +27841,11 @@ public SetAuthFlowParamResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetAuthDetailsCompletedEventHandler(object sender, GetAuthDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetAuthDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27867,11 +27867,11 @@ public GetAuthDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void SetAccessPermissionsCompletedEventHandler(object sender, SetAccessPermissionsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetAccessPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27893,11 +27893,11 @@ public SetAccessPermissionsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void UpdateAccessPermissionsCompletedEventHandler(object sender, UpdateAccessPermissionsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class UpdateAccessPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27919,11 +27919,11 @@ public UpdateAccessPermissionsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetAccessPermissionDetailsCompletedEventHandler(object sender, GetAccessPermissionDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetAccessPermissionDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27945,11 +27945,11 @@ public GetAccessPermissionDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetIncentiveEvaluationCompletedEventHandler(object sender, GetIncentiveEvaluationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetIncentiveEvaluationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27971,11 +27971,11 @@ public GetIncentiveEvaluationResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void SetExpressCheckoutCompletedEventHandler(object sender, SetExpressCheckoutCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetExpressCheckoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -27997,11 +27997,11 @@ public SetExpressCheckoutResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void ExecuteCheckoutOperationsCompletedEventHandler(object sender, ExecuteCheckoutOperationsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ExecuteCheckoutOperationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28023,11 +28023,11 @@ public ExecuteCheckoutOperationsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetExpressCheckoutDetailsCompletedEventHandler(object sender, GetExpressCheckoutDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetExpressCheckoutDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28049,11 +28049,11 @@ public GetExpressCheckoutDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoDirectPaymentCompletedEventHandler(object sender, DoDirectPaymentCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoDirectPaymentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28075,11 +28075,11 @@ public DoDirectPaymentResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void ManagePendingTransactionStatusCompletedEventHandler(object sender, ManagePendingTransactionStatusCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ManagePendingTransactionStatusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28101,11 +28101,11 @@ public ManagePendingTransactionStatusResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoCancelCompletedEventHandler(object sender, DoCancelCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoCancelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28127,11 +28127,11 @@ public DoCancelResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoCaptureCompletedEventHandler(object sender, DoCaptureCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoCaptureCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28153,11 +28153,11 @@ public DoCaptureResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoReauthorizationCompletedEventHandler(object sender, DoReauthorizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoReauthorizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28179,11 +28179,11 @@ public DoReauthorizationResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoVoidCompletedEventHandler(object sender, DoVoidCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoVoidCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28205,11 +28205,11 @@ public DoVoidResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoAuthorizationCompletedEventHandler(object sender, DoAuthorizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoAuthorizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28231,11 +28231,11 @@ public DoAuthorizationResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void UpdateAuthorizationCompletedEventHandler(object sender, UpdateAuthorizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class UpdateAuthorizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28257,11 +28257,11 @@ public UpdateAuthorizationResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void SetCustomerBillingAgreementCompletedEventHandler(object sender, SetCustomerBillingAgreementCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetCustomerBillingAgreementCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28283,11 +28283,11 @@ public SetCustomerBillingAgreementResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetBillingAgreementCustomerDetailsCompletedEventHandler(object sender, GetBillingAgreementCustomerDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetBillingAgreementCustomerDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28309,11 +28309,11 @@ public GetBillingAgreementCustomerDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void CreateBillingAgreementCompletedEventHandler(object sender, CreateBillingAgreementCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CreateBillingAgreementCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28335,11 +28335,11 @@ public CreateBillingAgreementResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoReferenceTransactionCompletedEventHandler(object sender, DoReferenceTransactionCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoReferenceTransactionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28361,11 +28361,11 @@ public DoReferenceTransactionResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoNonReferencedCreditCompletedEventHandler(object sender, DoNonReferencedCreditCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoNonReferencedCreditCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28387,11 +28387,11 @@ public DoNonReferencedCreditResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void DoUATPAuthorizationCompletedEventHandler(object sender, DoUATPAuthorizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DoUATPAuthorizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28413,11 +28413,11 @@ public DoUATPAuthorizationResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void CreateRecurringPaymentsProfileCompletedEventHandler(object sender, CreateRecurringPaymentsProfileCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CreateRecurringPaymentsProfileCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28439,11 +28439,11 @@ public CreateRecurringPaymentsProfileResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void GetRecurringPaymentsProfileDetailsCompletedEventHandler(object sender, GetRecurringPaymentsProfileDetailsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetRecurringPaymentsProfileDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28465,11 +28465,11 @@ public GetRecurringPaymentsProfileDetailsResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void ManageRecurringPaymentsProfileStatusCompletedEventHandler(object sender, ManageRecurringPaymentsProfileStatusCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ManageRecurringPaymentsProfileStatusCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28491,11 +28491,11 @@ public ManageRecurringPaymentsProfileStatusResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void BillOutstandingAmountCompletedEventHandler(object sender, BillOutstandingAmountCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class BillOutstandingAmountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28517,11 +28517,11 @@ public BillOutstandingAmountResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void UpdateRecurringPaymentsProfileCompletedEventHandler(object sender, UpdateRecurringPaymentsProfileCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class UpdateRecurringPaymentsProfileCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28543,11 +28543,11 @@ public UpdateRecurringPaymentsProfileResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void ReverseTransactionCompletedEventHandler(object sender, ReverseTransactionCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ReverseTransactionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -28569,11 +28569,11 @@ public ReverseTransactionResponseType Result { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] public delegate void ExternalRememberMeOptOutCompletedEventHandler(object sender, ExternalRememberMeOptOutCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.3752.0")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ExternalRememberMeOptOutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { diff --git a/src/Plugins/SmartStore.PayPal/web.config b/src/Plugins/SmartStore.PayPal/web.config index f0e8bf3314..d5de44336a 100644 --- a/src/Plugins/SmartStore.PayPal/web.config +++ b/src/Plugins/SmartStore.PayPal/web.config @@ -27,7 +27,7 @@ --> - + @@ -97,10 +97,6 @@ - - - - @@ -139,7 +135,7 @@ - + @@ -173,6 +169,14 @@ + + + + + + + + @@ -180,4 +184,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj index fa68da3247..d6cefba6be 100644 --- a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj +++ b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj @@ -20,7 +20,7 @@ Properties SmartStore.Shipping SmartStore.Shipping - v4.6.1 + v4.7.2 512 @@ -116,9 +116,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.Shipping/web.config b/src/Plugins/SmartStore.Shipping/web.config index 63451742ac..21fe12fec3 100644 --- a/src/Plugins/SmartStore.Shipping/web.config +++ b/src/Plugins/SmartStore.Shipping/web.config @@ -14,7 +14,7 @@ --> - + @@ -80,10 +80,6 @@ - - - - @@ -110,7 +106,7 @@ - + @@ -144,6 +140,14 @@ + + + + + + + + @@ -151,4 +155,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj index 09e985e9e9..a36d46d41f 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj +++ b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj @@ -20,7 +20,7 @@ Properties SmartStore.ShippingByWeight SmartStore.ShippingByWeight - v4.6.1 + v4.7.2 512 @@ -116,9 +116,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.ShippingByWeight/web.config b/src/Plugins/SmartStore.ShippingByWeight/web.config index 63451742ac..21fe12fec3 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/web.config +++ b/src/Plugins/SmartStore.ShippingByWeight/web.config @@ -14,7 +14,7 @@ --> - + @@ -80,10 +80,6 @@ - - - - @@ -110,7 +106,7 @@ - + @@ -144,6 +140,14 @@ + + + + + + + + @@ -151,4 +155,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj index 9da2507797..10615a9aa4 100644 --- a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj +++ b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj @@ -20,7 +20,7 @@ Properties SmartStore.Tax SmartStore.Tax - v4.6.1 + v4.7.2 512 @@ -116,9 +116,9 @@ - + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll False diff --git a/src/Plugins/SmartStore.Tax/web.config b/src/Plugins/SmartStore.Tax/web.config index 81f0867c5c..552e56025b 100644 --- a/src/Plugins/SmartStore.Tax/web.config +++ b/src/Plugins/SmartStore.Tax/web.config @@ -15,7 +15,7 @@ --> - + @@ -81,10 +81,6 @@ - - - - @@ -111,7 +107,7 @@ - + @@ -145,6 +141,14 @@ + + + + + + + + @@ -152,4 +156,4 @@ - + \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 5403bc55ca..a7f6111bfd 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -27,7 +27,7 @@ Properties SmartStore.WebApi SmartStore.WebApi - v4.6.1 + v4.7.2 512 diff --git a/src/Plugins/SmartStore.WebApi/web.config b/src/Plugins/SmartStore.WebApi/web.config index 04c57de4ac..9eb24d4874 100644 --- a/src/Plugins/SmartStore.WebApi/web.config +++ b/src/Plugins/SmartStore.WebApi/web.config @@ -6,16 +6,8 @@ - - + @@ -53,10 +45,6 @@ - - - - @@ -117,9 +105,16 @@ + + + + + + + + - diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index 1af2838abd..0a2848140c 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Web.Framework SmartStore.Web.Framework - v4.6.1 + v4.7.2 512 @@ -81,17 +81,20 @@ ..\..\packages\Autofac.WebApi2.4.2.0\lib\net45\Autofac.Integration.WebApi.dll - - ..\..\packages\BundleTransformer.Autoprefixer.1.10.2\lib\net40\BundleTransformer.Autoprefixer.dll + + ..\..\packages\AutoprefixerHost.1.1.10\lib\net45\AutoprefixerHost.dll + + + ..\..\packages\BundleTransformer.Autoprefixer.1.12.1\lib\net40\BundleTransformer.Autoprefixer.dll ..\..\packages\BundleTransformer.Core.1.10.0\lib\net40\BundleTransformer.Core.dll - - ..\..\packages\BundleTransformer.SassAndScss.1.10.0\lib\net40\BundleTransformer.SassAndScss.dll + + ..\..\packages\BundleTransformer.SassAndScss.1.12.1\lib\net40\BundleTransformer.SassAndScss.dll - ..\..\packages\CommonServiceLocator.2.0.5\lib\net46\CommonServiceLocator.dll + ..\..\packages\CommonServiceLocator.2.0.5\lib\net47\CommonServiceLocator.dll ..\..\packages\DotLiquid.2.0.254\lib\net45\DotLiquid.dll @@ -107,11 +110,11 @@ ..\..\packages\FluentValidation.7.4.0\lib\net45\FluentValidation.dll - - ..\..\packages\JavaScriptEngineSwitcher.Core.3.0.0\lib\net45\JavaScriptEngineSwitcher.Core.dll + + ..\..\packages\JavaScriptEngineSwitcher.Core.3.3.0\lib\net45\JavaScriptEngineSwitcher.Core.dll - - ..\..\packages\LibSassHost.1.2.2\lib\net45\LibSassHost.dll + + ..\..\packages\LibSassHost.1.2.6\lib\net471\LibSassHost.dll ..\..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll @@ -130,6 +133,9 @@ ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\System.Buffers.4.0.0\lib\netstandard1.1\System.Buffers.dll + @@ -148,9 +154,6 @@ ..\..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - diff --git a/src/Presentation/SmartStore.Web.Framework/app.config b/src/Presentation/SmartStore.Web.Framework/app.config index c75a4b4348..3cf6309ecc 100644 --- a/src/Presentation/SmartStore.Web.Framework/app.config +++ b/src/Presentation/SmartStore.Web.Framework/app.config @@ -16,7 +16,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -74,6 +74,10 @@ + + + + - + diff --git a/src/Presentation/SmartStore.Web.Framework/packages.config b/src/Presentation/SmartStore.Web.Framework/packages.config index 8bba36e6b6..3a994957a8 100644 --- a/src/Presentation/SmartStore.Web.Framework/packages.config +++ b/src/Presentation/SmartStore.Web.Framework/packages.config @@ -5,15 +5,16 @@ - + + - - + + - - + + @@ -29,12 +30,12 @@ + - \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj index cad98fd581..d1146ddf9a 100644 --- a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj +++ b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj @@ -13,7 +13,7 @@ Properties SmartStore.Admin SmartStore.Admin - v4.6.1 + v4.7.2 false true @@ -120,9 +120,6 @@ - - ..\..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - diff --git a/src/Presentation/SmartStore.Web/Administration/Web.config b/src/Presentation/SmartStore.Web/Administration/Web.config index 61dbd23e15..19498da48d 100644 --- a/src/Presentation/SmartStore.Web/Administration/Web.config +++ b/src/Presentation/SmartStore.Web/Administration/Web.config @@ -18,7 +18,7 @@ --> - + @@ -101,17 +101,9 @@ - - - - - - - - - + @@ -141,6 +133,14 @@ + + + + + + + + diff --git a/src/Presentation/SmartStore.Web/Administration/packages.config b/src/Presentation/SmartStore.Web/Administration/packages.config index a6b9edf1e5..0d7426974d 100644 --- a/src/Presentation/SmartStore.Web/Administration/packages.config +++ b/src/Presentation/SmartStore.Web/Administration/packages.config @@ -17,6 +17,5 @@ - \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/App_GlobalResources/EditorLocalization.designer.cs b/src/Presentation/SmartStore.Web/App_GlobalResources/EditorLocalization.designer.cs index d3305bbc4d..be7a96c2ae 100644 --- a/src/Presentation/SmartStore.Web/App_GlobalResources/EditorLocalization.designer.cs +++ b/src/Presentation/SmartStore.Web/App_GlobalResources/EditorLocalization.designer.cs @@ -19,7 +19,7 @@ namespace Resources { // mit einem Tool wie ResGen oder Visual Studio automatisch generiert. // Bearbeiten Sie zum Hinzufügen oder Entfernen eines Members die RESX-Datei, und führen Sie dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen das Visual Studio-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class EditorLocalization { diff --git a/src/Presentation/SmartStore.Web/App_GlobalResources/GridLocalization.designer.cs b/src/Presentation/SmartStore.Web/App_GlobalResources/GridLocalization.designer.cs index 06b0c263a4..b1c1d87e61 100644 --- a/src/Presentation/SmartStore.Web/App_GlobalResources/GridLocalization.designer.cs +++ b/src/Presentation/SmartStore.Web/App_GlobalResources/GridLocalization.designer.cs @@ -19,7 +19,7 @@ namespace Resources { // mit einem Tool wie ResGen oder Visual Studio automatisch generiert. // Bearbeiten Sie zum Hinzufügen oder Entfernen eines Members die RESX-Datei, und führen Sie dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen das Visual Studio-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class GridLocalization { diff --git a/src/Presentation/SmartStore.Web/App_GlobalResources/MvcLocalization.Designer.cs b/src/Presentation/SmartStore.Web/App_GlobalResources/MvcLocalization.Designer.cs index d1492374cc..3991bc8a42 100644 --- a/src/Presentation/SmartStore.Web/App_GlobalResources/MvcLocalization.Designer.cs +++ b/src/Presentation/SmartStore.Web/App_GlobalResources/MvcLocalization.Designer.cs @@ -19,7 +19,7 @@ namespace Resources { // mit einem Tool wie ResGen oder Visual Studio automatisch generiert. // Bearbeiten Sie zum Hinzufügen oder Entfernen eines Members die RESX-Datei, und führen Sie dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen das Visual Studio-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class MvcLocalization { diff --git a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj index efaa1658b3..7351d74410 100644 --- a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj +++ b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj @@ -1,9 +1,9 @@  - - - - + + + + @@ -18,7 +18,7 @@ Properties SmartStore.Web SmartStore.Web - v4.6.1 + v4.7.2 false true @@ -86,8 +86,11 @@ ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll True - - ..\..\packages\BundleTransformer.Autoprefixer.1.10.2\lib\net40\BundleTransformer.Autoprefixer.dll + + ..\..\packages\AutoprefixerHost.1.1.10\lib\net45\AutoprefixerHost.dll + + + ..\..\packages\BundleTransformer.Autoprefixer.1.12.1\lib\net40\BundleTransformer.Autoprefixer.dll ..\..\packages\BundleTransformer.Core.1.10.0\lib\net40\BundleTransformer.Core.dll @@ -95,14 +98,14 @@ ..\..\packages\BundleTransformer.JsMin.1.12.6\lib\net40\BundleTransformer.JsMin.dll - - ..\..\packages\BundleTransformer.NUglify.1.12.9\lib\net40\BundleTransformer.NUglify.dll + + ..\..\packages\BundleTransformer.NUglify.1.12.16\lib\net40\BundleTransformer.NUglify.dll - - ..\..\packages\BundleTransformer.SassAndScss.1.10.0\lib\net40\BundleTransformer.SassAndScss.dll + + ..\..\packages\BundleTransformer.SassAndScss.1.12.1\lib\net40\BundleTransformer.SassAndScss.dll - - ..\..\packages\JavaScriptEngineSwitcher.V8.3.0.5\lib\net45\ClearScript.dll + + ..\..\packages\JavaScriptEngineSwitcher.V8.3.5.5\lib\net45\ClearScript.dll ..\..\packages\DouglasCrockford.JsMin.2.1.0\lib\net45\DouglasCrockford.JsMin.dll @@ -125,17 +128,17 @@ ..\..\packages\FluentValidation.Mvc5.7.4.0\lib\net45\FluentValidation.Mvc.dll - - ..\..\packages\JavaScriptEngineSwitcher.Core.3.0.0\lib\net45\JavaScriptEngineSwitcher.Core.dll + + ..\..\packages\JavaScriptEngineSwitcher.Core.3.3.0\lib\net45\JavaScriptEngineSwitcher.Core.dll - - ..\..\packages\JavaScriptEngineSwitcher.Msie.3.0.2\lib\net45\JavaScriptEngineSwitcher.Msie.dll + + ..\..\packages\JavaScriptEngineSwitcher.Msie.3.4.3\lib\net45\JavaScriptEngineSwitcher.Msie.dll - - ..\..\packages\JavaScriptEngineSwitcher.V8.3.0.5\lib\net45\JavaScriptEngineSwitcher.V8.dll + + ..\..\packages\JavaScriptEngineSwitcher.V8.3.5.5\lib\net45\JavaScriptEngineSwitcher.V8.dll - - ..\..\packages\LibSassHost.1.2.2\lib\net45\LibSassHost.dll + + ..\..\packages\LibSassHost.1.2.6\lib\net471\LibSassHost.dll ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -144,14 +147,17 @@ True ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\packages\MsieJavaScriptEngine.3.0.1\lib\net45\MsieJavaScriptEngine.dll + + ..\..\packages\MsieJavaScriptEngine.3.0.7\lib\net45\MsieJavaScriptEngine.dll ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\packages\NUglify.1.5.14\lib\net40\NUglify.dll + + ..\..\packages\NUglify.1.6.4\lib\net40\NUglify.dll + + + ..\..\packages\System.Buffers.4.0.0\lib\netstandard1.1\System.Buffers.dll @@ -168,9 +174,6 @@ - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - @@ -2090,9 +2093,9 @@ - - - - + + + + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Web.config b/src/Presentation/SmartStore.Web/Web.config index 8a981478ff..005758563b 100644 --- a/src/Presentation/SmartStore.Web/Web.config +++ b/src/Presentation/SmartStore.Web/Web.config @@ -1,47 +1,47 @@ - + -
+
-
-
-
-
+
+
+
+
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - - - - - - - + + + + + + + - - + + - + - + - - + + - - - - + + + + - - - + + + - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + - + - + - - - - + + + + - - - - - - - + + + + + + + - - + + - - + + - - - + + + - - + + - - + + - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - - - - - - - - + + + + + + + + + + - + - - - + - + - + @@ -296,7 +294,7 @@ - + @@ -348,7 +346,7 @@ - + @@ -368,89 +366,93 @@ - + + + + + - + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - + - + - + - - + + - - - - - - - - - - + + + + + + + + + + - + - - + + - + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/packages.config b/src/Presentation/SmartStore.Web/packages.config index c2ebf7619d..39f816c7b4 100644 --- a/src/Presentation/SmartStore.Web/packages.config +++ b/src/Presentation/SmartStore.Web/packages.config @@ -4,24 +4,25 @@ - + + - - + + - - - - - - - - + + + + + + + + @@ -30,10 +31,10 @@ - + - + + - \ No newline at end of file diff --git a/src/Tests/SmartStore.Core.Tests/App.config b/src/Tests/SmartStore.Core.Tests/App.config index 3ace789a89..d8c6b8d753 100644 --- a/src/Tests/SmartStore.Core.Tests/App.config +++ b/src/Tests/SmartStore.Core.Tests/App.config @@ -10,7 +10,7 @@ - + diff --git a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj index b95df39b91..d5724e561f 100644 --- a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj +++ b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Core.Tests SmartStore.Core.Tests - v4.6.1 + v4.7.2 512 diff --git a/src/Tests/SmartStore.Data.Tests/App.config b/src/Tests/SmartStore.Data.Tests/App.config index cac607e919..1378872e0d 100644 --- a/src/Tests/SmartStore.Data.Tests/App.config +++ b/src/Tests/SmartStore.Data.Tests/App.config @@ -41,7 +41,7 @@ - + @@ -49,4 +49,4 @@ - \ No newline at end of file + diff --git a/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj b/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj index d399f9157b..0ef4a9806c 100644 --- a/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj +++ b/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Data.Tests SmartStore.Data.Tests - v4.6.1 + v4.7.2 512 diff --git a/src/Tests/SmartStore.Services.Tests/App.config b/src/Tests/SmartStore.Services.Tests/App.config index b8e59c41ac..42628e2c61 100644 --- a/src/Tests/SmartStore.Services.Tests/App.config +++ b/src/Tests/SmartStore.Services.Tests/App.config @@ -20,7 +20,7 @@ - + diff --git a/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj b/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj index 9dce818842..007dedcf87 100644 --- a/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj +++ b/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj @@ -12,7 +12,7 @@ Properties SmartStore.Services.Tests SmartStore.Services.Tests - v4.6.1 + v4.7.2 512 diff --git a/src/Tests/SmartStore.Tests/App.config b/src/Tests/SmartStore.Tests/App.config index 147b958fff..a9530d0756 100644 --- a/src/Tests/SmartStore.Tests/App.config +++ b/src/Tests/SmartStore.Tests/App.config @@ -27,4 +27,4 @@ - + diff --git a/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj b/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj index 84a62a73ae..dbbbb741db 100644 --- a/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj +++ b/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Tests SmartStore.Tests - v4.6.1 + v4.7.2 512 diff --git a/src/Tests/SmartStore.Web.MVC.Tests/App.config b/src/Tests/SmartStore.Web.MVC.Tests/App.config index e985d56475..6ebf5eff27 100644 --- a/src/Tests/SmartStore.Web.MVC.Tests/App.config +++ b/src/Tests/SmartStore.Web.MVC.Tests/App.config @@ -9,7 +9,7 @@ - + @@ -41,10 +41,6 @@ - - - - @@ -83,7 +79,7 @@ - + @@ -101,6 +97,14 @@ + + + + + + + + diff --git a/src/Tests/SmartStore.Web.MVC.Tests/SmartStore.Web.MVC.Tests.csproj b/src/Tests/SmartStore.Web.MVC.Tests/SmartStore.Web.MVC.Tests.csproj index af2dc660ab..f11482fa6c 100644 --- a/src/Tests/SmartStore.Web.MVC.Tests/SmartStore.Web.MVC.Tests.csproj +++ b/src/Tests/SmartStore.Web.MVC.Tests/SmartStore.Web.MVC.Tests.csproj @@ -10,7 +10,7 @@ Properties SmartStore.Web.MVC.Tests SmartStore.Web.MVC.Tests - v4.6.1 + v4.7.2 512 @@ -81,9 +81,6 @@ - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll diff --git a/src/Tests/SmartStore.Web.MVC.Tests/packages.config b/src/Tests/SmartStore.Web.MVC.Tests/packages.config index 3ec293ad35..18ac8e0f1f 100644 --- a/src/Tests/SmartStore.Web.MVC.Tests/packages.config +++ b/src/Tests/SmartStore.Web.MVC.Tests/packages.config @@ -8,5 +8,4 @@ - \ No newline at end of file diff --git a/src/Tools/SmartStore.Packager/App.config b/src/Tools/SmartStore.Packager/App.config index 279248918b..5ce5d12972 100644 --- a/src/Tools/SmartStore.Packager/App.config +++ b/src/Tools/SmartStore.Packager/App.config @@ -6,7 +6,7 @@ - + diff --git a/src/Tools/SmartStore.Packager/Properties/Resources.Designer.cs b/src/Tools/SmartStore.Packager/Properties/Resources.Designer.cs index 3749231b86..b09e936e1a 100644 --- a/src/Tools/SmartStore.Packager/Properties/Resources.Designer.cs +++ b/src/Tools/SmartStore.Packager/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace SmartStore.Packager.Properties { // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/Tools/SmartStore.Packager/Properties/Settings.Designer.cs b/src/Tools/SmartStore.Packager/Properties/Settings.Designer.cs index 052518ec04..1532ba2b99 100644 --- a/src/Tools/SmartStore.Packager/Properties/Settings.Designer.cs +++ b/src/Tools/SmartStore.Packager/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SmartStore.Packager.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/Tools/SmartStore.Packager/SmartStore.Packager.csproj b/src/Tools/SmartStore.Packager/SmartStore.Packager.csproj index 794db96f12..b6bc6a6e41 100644 --- a/src/Tools/SmartStore.Packager/SmartStore.Packager.csproj +++ b/src/Tools/SmartStore.Packager/SmartStore.Packager.csproj @@ -9,7 +9,7 @@ Properties SmartStore.Packager SmartStore.Packager - v4.6.1 + v4.7.2 512 diff --git a/src/Tools/SmartStore.WebApi.Client/App.config b/src/Tools/SmartStore.WebApi.Client/App.config index 0e577fb077..bc30a5e783 100644 --- a/src/Tools/SmartStore.WebApi.Client/App.config +++ b/src/Tools/SmartStore.WebApi.Client/App.config @@ -6,7 +6,7 @@ - + diff --git a/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs b/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs index 8d9bc7c5f5..c31baa9266 100644 --- a/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs +++ b/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace SmartStoreNetWebApiClient.Properties { // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs b/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs index 461b1a2987..8d0f1103b9 100644 --- a/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs +++ b/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SmartStoreNetWebApiClient.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.1.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj b/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj index 9bd1f1cf9f..426ea67e53 100644 --- a/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj +++ b/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj @@ -9,7 +9,7 @@ Properties SmartStoreNetWebApiClient SmartStoreNetWebApiClient - v4.6.1 + v4.7.2 512 false veröffentlichen\ From 8022743517a826ca6907b5540e6116494a16527e Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Sat, 8 Aug 2020 02:06:41 +0200 Subject: [PATCH 014/695] Updated MaxMind packages --- .../SmartStore.Services/SmartStore.Services.csproj | 4 ++-- src/Libraries/SmartStore.Services/packages.config | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index df8e4ecff7..82e77a9138 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -98,10 +98,10 @@ ..\..\packages\LumenWorksCsvReader.4.0.0\lib\net461\LumenWorks.Framework.IO.dll - ..\..\packages\MaxMind.Db.2.4.0\lib\net45\MaxMind.Db.dll + ..\..\packages\MaxMind.Db.2.6.1\lib\net45\MaxMind.Db.dll - ..\..\packages\MaxMind.GeoIP2.3.0.0\lib\net45\MaxMind.GeoIP2.dll + ..\..\packages\MaxMind.GeoIP2.3.2.0\lib\net45\MaxMind.GeoIP2.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index 618d223d67..efaa7e009b 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -8,12 +8,12 @@ - - + + - + From f52f12de523525acff1b1143a223a9cf9185970b Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 10 Aug 2020 10:07:24 +0200 Subject: [PATCH 015/695] API: CRUD endpoints refactoring due to removal of EntitySetController --- .../OData/LocalizedPropertiesController.cs | 13 ---- .../OData/MeasureWeightsController.cs | 18 ----- .../Controllers/OData/OrderItemsController.cs | 14 +++- .../Controllers/OData/OrdersController.cs | 40 +++++++++++ .../Controllers/OData/PicturesController.cs | 64 ++++++------------ ...roductSpecificationAttributesController.cs | 52 +++++++++----- ...tVariantAttributeCombinationsController.cs | 52 +++++++++----- ...ProductVariantAttributeValuesController.cs | 52 +++++++++----- .../ProductVariantAttributesController.cs | 49 ++++++++++---- .../Controllers/OData/ProductsController.cs | 28 ++++++++ .../OData/QuantityUnitsController.cs | 48 +++++++++---- .../OData/RelatedProductsController.cs | 48 +++++++++---- .../OData/ReturnRequestsController.cs | 43 ++++++++++-- .../Controllers/OData/SettingsController.cs | 48 +++++++++---- .../OData/ShipmentItemsController.cs | 48 +++++++++---- .../Controllers/OData/ShipmentsController.cs | 48 +++++++++---- .../OData/ShippingMethodsController.cs | 48 +++++++++---- ...SpecificationAttributeOptionsController.cs | 49 ++++++++++---- .../SpecificationAttributesController.cs | 49 ++++++++++---- .../OData/StateProvincesController.cs | 52 +++++++++----- .../OData/StoreMappingsController.cs | 38 ++++++++--- .../Controllers/OData/StoresController.cs | 48 +++++++++---- .../OData/SyncMappingsController.cs | 38 ++++++++--- .../OData/TaxCategoriesController.cs | 48 +++++++++---- .../Controllers/OData/TierPricesController.cs | 48 +++++++++---- .../Controllers/OData/UrlRecordsController.cs | 31 ++++++--- .../WebApiConfigurationProvider.cs | 67 ++----------------- .../WebApi/WebApiEntityController.cs | 34 ---------- 28 files changed, 780 insertions(+), 435 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs index 46b522d7af..e24b3ab85f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs @@ -13,19 +13,6 @@ namespace SmartStore.WebApi.Controllers.OData [WebApiAuthenticate] public class LocalizedPropertiesController : WebApiEntityController { - protected override void Insert(LocalizedProperty entity) - { - Service.InsertLocalizedProperty(entity); - } - protected override void Update(LocalizedProperty entity) - { - Service.UpdateLocalizedProperty(entity); - } - protected override void Delete(LocalizedProperty entity) - { - Service.DeleteLocalizedProperty(entity); - } - [WebApiQueryable] public IQueryable Get() { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs index df850a51c1..7170408664 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs @@ -13,24 +13,6 @@ namespace SmartStore.WebApi.Controllers.OData { public class MeasureWeightsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] - protected override void Insert(MeasureWeight entity) - { - Service.InsertMeasureWeight(entity); - } - - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] - protected override void Update(MeasureWeight entity) - { - Service.UpdateMeasureWeight(entity); - } - - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Delete)] - protected override void Delete(MeasureWeight entity) - { - Service.DeleteMeasureWeight(entity); - } - [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] public IQueryable Get() diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs index b730f70293..65a97ffa38 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs @@ -7,6 +7,7 @@ using SmartStore.Core.Security; using SmartStore.Services.Orders; using SmartStore.Web.Framework.WebApi; +using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.Web.Framework.WebApi.OData; using SmartStore.Web.Framework.WebApi.Security; using SmartStore.WebApi.Models.OData; @@ -80,11 +81,18 @@ public SingleResult GetProduct(int key) return GetRelatedEntity(key, x => x.Product); } - #endregion + #endregion + + #region Actions - #region Actions + public static void Init(WebApiConfigurationBroadcaster configData) + { + var entityConfig = configData.ModelBuilder.EntityType(); + + entityConfig.Action("Infos").Returns(); + } - [HttpPost] + [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Read)] public OrderItemInfo Infos(int key) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index 408e301735..8abc376d50 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -12,6 +12,7 @@ using SmartStore.Core.Security; using SmartStore.Services.Orders; using SmartStore.Web.Framework.WebApi; +using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.Web.Framework.WebApi.OData; using SmartStore.Web.Framework.WebApi.Security; using SmartStore.WebApi.Models.OData; @@ -133,6 +134,45 @@ public IQueryable GetOrderItems(int key) #region Actions + public static void Init(WebApiConfigurationBroadcaster configData) + { + var entityConfig = configData.ModelBuilder.EntityType(); + + entityConfig + .Action("Infos") + .Returns(); + + entityConfig.Action("Pdf"); + + entityConfig + .Action("PaymentPending") + .ReturnsFromEntitySet("Orders"); + + entityConfig + .Action("PaymentPaid") + .ReturnsFromEntitySet("Orders") + .Parameter("PaymentMethodName"); + + entityConfig + .Action("PaymentRefund") + .ReturnsFromEntitySet("Orders") + .Parameter("Online"); + + entityConfig + .Action("Cancel") + .ReturnsFromEntitySet("Orders"); + + var addShipment = entityConfig + .Action("AddShipment") + .ReturnsFromEntitySet("Orders"); + addShipment.Parameter("TrackingNumber"); + addShipment.Parameter("SetAsShipped"); + + entityConfig + .Action("CompleteOrder") + .ReturnsFromEntitySet("Orders"); + } + [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Read)] public OrderInfo Infos(int key) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs index bad29f51be..7cfe69cfd0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs @@ -24,6 +24,28 @@ public MediaController(IMediaService mediaService) _mediaService = mediaService; } + // TODO: readonly properties of MediaFileInfo cannot be serialized! + + // GET /Media(123) + [WebApiAuthenticate] + public MediaFileInfo Get(int key) + { + MediaFileInfo file = null; + + this.ProcessEntity(() => + { + file = _mediaService.GetFileById(key); + if (file == null) + { + throw this.ExceptionNotFound($"Cannot find file by ID {key}."); + } + }); + + return file; + } + + #region Actions + public static void Init(WebApiConfigurationBroadcaster configData) { var entityConfig = configData.ModelBuilder.EntityType(); @@ -68,28 +90,6 @@ public static void Init(WebApiConfigurationBroadcaster configData) countFiles.CollectionParameter("Extensions"); } - // TODO: readonly properties of MediaFileInfo cannot be serialized! - - // GET /Media(123) - [WebApiAuthenticate] - public MediaFileInfo Get(int key) - { - MediaFileInfo file = null; - - this.ProcessEntity(() => - { - file = _mediaService.GetFileById(key); - if (file == null) - { - throw this.ExceptionNotFound($"Cannot find file by ID {key}."); - } - }); - - return file; - } - - #region Actions - /// POST /Media/FileExists {"Path":"content/my-file.jpg"} [HttpPost, WebApiAuthenticate] public bool FileExists(ODataActionParameters parameters) @@ -236,32 +236,12 @@ from x in Repository.Table return query; } - //[WebApiAuthenticate(Permission = Permissions.Media.Upload)] - protected override void Insert(MediaFile entity) - { - throw this.ExceptionNotImplemented(); - } - - //[WebApiAuthenticate(Permission = Permissions.Media.Update)] - protected override void Update(MediaFile entity) - { - throw this.ExceptionNotImplemented(); - } - - //[WebApiAuthenticate(Permission = Permissions.Media.Delete)] - protected override void Delete(MediaFile entity) - { - throw this.ExceptionNotImplemented(); - } - [WebApiQueryable] public SingleResult GetPicture(int key) { return GetSingleResult(key); } - // Navigation properties. - [WebApiQueryable] public IQueryable GetProductPictures(int key) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs index 381c2176da..ce1d3f528b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductSpecificationAttributesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] - protected override void Insert(ProductSpecificationAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProductSpecificationAttribute(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] - protected override void Update(ProductSpecificationAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateProductSpecificationAttribute(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] - protected override void Delete(ProductSpecificationAttribute entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] + public IHttpActionResult Post(ProductSpecificationAttribute entity) { - Service.DeleteProductSpecificationAttribute(entity); + var result = Insert(entity, () => Service.InsertProductSpecificationAttribute(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProductSpecificationAttribute(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] + public async Task Put(int key, ProductSpecificationAttribute entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateProductSpecificationAttribute(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductSpecificationAttribute(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductSpecificationAttribute(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] @@ -43,5 +63,7 @@ public SingleResult GetSpecificationAttributeOptio { return GetRelatedEntity(key, x => x.SpecificationAttributeOption); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs index 0a3b1d4ca1..545df638d8 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; @@ -11,32 +14,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductVariantAttributeCombinationsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Insert(ProductVariantAttributeCombination entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProductVariantAttributeCombination(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Update(ProductVariantAttributeCombination entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateProductVariantAttributeCombination(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Delete(ProductVariantAttributeCombination entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public IHttpActionResult Post(ProductVariantAttributeCombination entity) { - Service.DeleteProductVariantAttributeCombination(entity); + var result = Insert(entity, () => Service.InsertProductVariantAttributeCombination(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProductVariantAttributeCombination(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Put(int key, ProductVariantAttributeCombination entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateProductVariantAttributeCombination(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductVariantAttributeCombination(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductVariantAttributeCombination(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] @@ -44,5 +64,7 @@ public SingleResult GetDeliveryTime(int key) { return GetRelatedEntity(key, x => x.DeliveryTime); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs index 9e68b445a9..5b42d5be4c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductVariantAttributeValuesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Insert(ProductVariantAttributeValue entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProductVariantAttributeValue(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Update(ProductVariantAttributeValue entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateProductVariantAttributeValue(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Delete(ProductVariantAttributeValue entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public IHttpActionResult Post(ProductVariantAttributeValue entity) { - Service.DeleteProductVariantAttributeValue(entity); + var result = Insert(entity, () => Service.InsertProductVariantAttributeValue(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProductVariantAttributeValue(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Put(int key, ProductVariantAttributeValue entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateProductVariantAttributeValue(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductVariantAttributeValue(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductVariantAttributeValue(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] @@ -43,5 +63,7 @@ public SingleResult GetProductVariantAttribute(int key) { return GetRelatedEntity(key, x => x.ProductVariantAttribute); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs index d92e320058..449d3274e8 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -11,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class ProductVariantAttributesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Insert(ProductVariantAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertProductVariantAttribute(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Update(ProductVariantAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateProductVariantAttribute(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] - protected override void Delete(ProductVariantAttribute entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public IHttpActionResult Post(ProductVariantAttribute entity) { - Service.DeleteProductVariantAttribute(entity); + var result = Insert(entity, () => Service.InsertProductVariantAttribute(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProductVariantAttribute(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Put(int key, ProductVariantAttribute entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateProductVariantAttribute(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateProductVariantAttribute(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteProductVariantAttribute(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] @@ -51,5 +70,7 @@ public IQueryable GetProductVariantAttributeValues { return GetRelatedCollection(key, x => x.ProductVariantAttributeValues); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index 455d85a113..aebea290c1 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -17,6 +17,7 @@ using SmartStore.Services.Search; using SmartStore.Services.Seo; using SmartStore.Web.Framework.WebApi; +using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.Web.Framework.WebApi.OData; using SmartStore.Web.Framework.WebApi.Security; using SmartStore.WebApi.Services; @@ -351,6 +352,33 @@ public IQueryable GetProductBundleItems(int key) #region Actions + public static void Init(WebApiConfigurationBroadcaster configData) + { + var entityConfig = configData.ModelBuilder.EntityType(); + + entityConfig.Collection + .Action("Search") + .ReturnsCollectionFromEntitySet("Products"); + + entityConfig + .Action("FinalPrice") + .Returns(); + + entityConfig + .Action("LowestPrice") + .Returns(); + + entityConfig + .Action("CreateAttributeCombinations") + .ReturnsCollectionFromEntitySet("ProductVariantAttributeCombinations"); + + var manageAttributes = entityConfig + .Action("ManageAttributes") + .ReturnsCollectionFromEntitySet("ProductVariantAttributes"); + manageAttributes.Parameter("Synchronize"); + manageAttributes.CollectionParameter("Attributes"); + } + [HttpPost, WebApiQueryable(PagingOptional = true)] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] public IQueryable Search([ModelBinder(typeof(WebApiCatalogSearchQueryModelBinder))] CatalogSearchQuery query) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs index 13c9a0ded3..bc73ed1586 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class QuantityUnitsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] - protected override void Insert(QuantityUnit entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] + public IQueryable Get() { - Service.InsertQuantityUnit(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] - protected override void Update(QuantityUnit entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] + public SingleResult Get(int key) { - Service.UpdateQuantityUnit(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Delete)] - protected override void Delete(QuantityUnit entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] + public IHttpActionResult Post(QuantityUnit entity) { - Service.DeleteQuantityUnit(entity); + var result = Insert(entity, () => Service.InsertQuantityUnit(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult GetQuantityUnit(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] + public async Task Put(int key, QuantityUnit entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateQuantityUnit(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateQuantityUnit(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteQuantityUnit(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs index 760934f8f0..adeee5d791 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class RelatedProductsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] - protected override void Insert(RelatedProduct entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertRelatedProduct(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] - protected override void Update(RelatedProduct entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateRelatedProduct(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] - protected override void Delete(RelatedProduct entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] + public IHttpActionResult Post(RelatedProduct entity) { - Service.DeleteRelatedProduct(entity); + var result = Insert(entity, () => Service.InsertRelatedProduct(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetRelatedProduct(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] + public async Task Put(int key, RelatedProduct entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateRelatedProduct(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateRelatedProduct(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteRelatedProduct(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs index 47febeda9c..859b13a53f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Customers; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; @@ -11,20 +14,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class ReturnRequestsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Delete)] - protected override void Delete(ReturnRequest entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Read)] + public IQueryable Get() { - Service.DeleteReturnRequest(entity); + return GetEntitySet(); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Read)] - public SingleResult GetReturnRequest(int key) + public SingleResult Get(int key) { return GetSingleResult(key); } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Customer.Create)] + public IHttpActionResult Post(ReturnRequest entity) + { + throw this.ExceptionNotImplemented(); + } + + [WebApiAuthenticate(Permission = Permissions.Customer.Update)] + public IHttpActionResult Put(int key, ReturnRequest entity) + { + throw this.ExceptionNotImplemented(); + } + + [WebApiAuthenticate(Permission = Permissions.Customer.Update)] + public IHttpActionResult Patch(int key, Delta model) + { + throw this.ExceptionNotImplemented(); + } + + [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteReturnRequest(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] @@ -32,5 +61,7 @@ public SingleResult GetCustomer(int key) { return GetRelatedEntity(key, x => x.Customer); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs index f355225178..9e19004f8a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Configuration; using SmartStore.Core.Security; using SmartStore.Services.Configuration; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class SettingsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Create)] - protected override void Insert(Setting entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Read)] + public IQueryable Get() { - Service.InsertSetting(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Update)] - protected override void Update(Setting entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Read)] + public SingleResult Get(int key) { - Service.UpdateSetting(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Delete)] - protected override void Delete(Setting entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Create)] + public IHttpActionResult Post(Setting entity) { - Service.DeleteSetting(entity); + var result = Insert(entity, () => Service.InsertSetting(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Read)] - public SingleResult GetSetting(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Update)] + public async Task Put(int key, Setting entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateSetting(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateSetting(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteSetting(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs index e42781ab3a..0be2285599 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Shipping; using SmartStore.Core.Security; using SmartStore.Services.Shipping; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class ShipmentItemsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] - protected override void Insert(ShipmentItem entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public IQueryable Get() { - Service.InsertShipmentItem(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] - protected override void Update(ShipmentItem entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public SingleResult Get(int key) { - Service.UpdateShipmentItem(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] - protected override void Delete(ShipmentItem entity) + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public IHttpActionResult Post(ShipmentItem entity) { - Service.DeleteShipmentItem(entity); + var result = Insert(entity, () => Service.InsertShipmentItem(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult GetShipmentItem(int key) + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public async Task Put(int key, ShipmentItem entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateShipmentItem(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateShipmentItem(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteShipmentItem(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs index 42631b925c..12b02ef6dd 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Shipping; using SmartStore.Core.Security; using SmartStore.Services.Shipping; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class ShipmentsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] - protected override void Insert(Shipment entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public IQueryable Get() { - Service.InsertShipment(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] - protected override void Update(Shipment entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public SingleResult Get(int key) { - Service.UpdateShipment(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] - protected override void Delete(Shipment entity) + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public IHttpActionResult Post(Shipment entity) { - Service.DeleteShipment(entity); + var result = Insert(entity, () => Service.InsertShipment(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult GetShipment(int key) + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public async Task Put(int key, Shipment entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateShipment(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateShipment(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteShipment(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs index f158720ffc..bb9928fb93 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Shipping; using SmartStore.Core.Security; using SmartStore.Services.Shipping; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class ShippingMethodsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Create)] - protected override void Insert(ShippingMethod entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Read)] + public IQueryable Get() { - Service.InsertShippingMethod(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Update)] - protected override void Update(ShippingMethod entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Read)] + public SingleResult Get(int key) { - Service.UpdateShippingMethod(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Delete)] - protected override void Delete(ShippingMethod entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Create)] + public IHttpActionResult Post(ShippingMethod entity) { - Service.DeleteShippingMethod(entity); + var result = Insert(entity, () => Service.InsertShippingMethod(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Read)] - public SingleResult GetShippingMethod(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Update)] + public async Task Put(int key, ShippingMethod entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateShippingMethod(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateShippingMethod(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteShippingMethod(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs index 63c633ad77..8c54098f66 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -11,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class SpecificationAttributeOptionsController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] - protected override void Insert(SpecificationAttributeOption entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] + public IQueryable Get() { - Service.InsertSpecificationAttributeOption(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] - protected override void Update(SpecificationAttributeOption entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] + public SingleResult Get(int key) { - Service.UpdateSpecificationAttributeOption(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] - protected override void Delete(SpecificationAttributeOption entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] + public IHttpActionResult Post(SpecificationAttributeOption entity) { - Service.DeleteSpecificationAttributeOption(entity); + var result = Insert(entity, () => Service.InsertSpecificationAttributeOption(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public SingleResult GetSpecificationAttributeOption(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] + public async Task Put(int key, SpecificationAttributeOption entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateSpecificationAttributeOption(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateSpecificationAttributeOption(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteSpecificationAttributeOption(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] @@ -51,5 +70,7 @@ public IQueryable GetProductSpecificationAttribut { return GetRelatedCollection(key, x => x.ProductSpecificationAttributes); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs index ea23b2a556..2994d7c258 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs @@ -1,5 +1,7 @@ using System.Linq; +using System.Threading.Tasks; using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -11,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class SpecificationAttributesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Create)] - protected override void Insert(SpecificationAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] + public IQueryable Get() { - Service.InsertSpecificationAttribute(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Update)] - protected override void Update(SpecificationAttribute entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] + public SingleResult Get(int key) { - Service.UpdateSpecificationAttribute(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Delete)] - protected override void Delete(SpecificationAttribute entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Create)] + public IHttpActionResult Post(SpecificationAttribute entity) { - Service.DeleteSpecificationAttribute(entity); + var result = Insert(entity, () => Service.InsertSpecificationAttribute(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public SingleResult GetSpecificationAttribute(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Update)] + public async Task Put(int key, SpecificationAttribute entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateSpecificationAttribute(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateSpecificationAttribute(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteSpecificationAttribute(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] @@ -44,5 +63,7 @@ public IQueryable GetSpecificationAttributeOptions { return GetRelatedCollection(key, x => x.SpecificationAttributeOptions); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs index 6434dc46a0..b450dba788 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Directory; @@ -10,32 +13,49 @@ namespace SmartStore.WebApi.Controllers.OData { public class StateProvincesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Create)] - protected override void Insert(StateProvince entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] + public IQueryable Get() { - Service.InsertStateProvince(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Update)] - protected override void Update(StateProvince entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] + public SingleResult Get(int key) { - Service.UpdateStateProvince(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Delete)] - protected override void Delete(StateProvince entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Create)] + public IHttpActionResult Post(StateProvince entity) { - Service.DeleteStateProvince(entity); + var result = Insert(entity, () => Service.InsertStateProvince(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public SingleResult GetStateProvince(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Update)] + public async Task Put(int key, StateProvince entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateStateProvince(entity)); + return result; } - // Navigation properties. + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateStateProvince(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteStateProvince(entity)); + return result; + } + + #region Navigation properties [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] @@ -43,5 +63,7 @@ public SingleResult GetCountry(int key) { return GetRelatedEntity(key, x => x.Country); } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs index 1ea66b7a57..82c20ecb18 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Stores; using SmartStore.Services.Stores; using SmartStore.Web.Framework.WebApi; @@ -10,25 +13,40 @@ namespace SmartStore.WebApi.Controllers.OData [WebApiAuthenticate] public class StoreMappingsController : WebApiEntityController { - protected override void Insert(StoreMapping entity) + [WebApiQueryable] + public IQueryable Get() { - Service.InsertStoreMapping(entity); + return GetEntitySet(); } - protected override void Update(StoreMapping entity) + [WebApiQueryable] + public SingleResult Get(int key) { - Service.UpdateStoreMapping(entity); + return GetSingleResult(key); } - protected override void Delete(StoreMapping entity) + public IHttpActionResult Post(StoreMapping entity) { - Service.DeleteStoreMapping(entity); + var result = Insert(entity, () => Service.InsertStoreMapping(entity)); + return result; } - [WebApiQueryable] - public SingleResult GetStoreMapping(int key) + public async Task Put(int key, StoreMapping entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateStoreMapping(entity)); + return result; + } + + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateStoreMapping(entity)); + return result; + } + + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteStoreMapping(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs index e5dd2b2325..715dccbd3c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Stores; using SmartStore.Core.Security; using SmartStore.Services.Stores; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class StoresController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Create)] - protected override void Insert(Store entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] + public IQueryable Get() { - Service.InsertStore(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Update)] - protected override void Update(Store entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] + public SingleResult Get(int key) { - Service.UpdateStore(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Delete)] - protected override void Delete(Store entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Create)] + public IHttpActionResult Post(Store entity) { - Service.DeleteStore(entity); + var result = Insert(entity, () => Service.InsertStore(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] - public SingleResult GetStore(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Update)] + public async Task Put(int key, Store entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateStore(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateStore(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteStore(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs index 497c4c5788..5fbd37ba7a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.DataExchange; using SmartStore.Services.DataExchange; using SmartStore.Web.Framework.WebApi; @@ -10,25 +13,40 @@ namespace SmartStore.WebApi.Controllers.OData [WebApiAuthenticate] public class SyncMappingsController : WebApiEntityController { - protected override void Insert(SyncMapping entity) + [WebApiQueryable] + public IQueryable Get() { - Service.InsertSyncMapping(entity); + return GetEntitySet(); } - protected override void Update(SyncMapping entity) + [WebApiQueryable] + public SingleResult Get(int key) { - Service.UpdateSyncMapping(entity); + return GetSingleResult(key); } - protected override void Delete(SyncMapping entity) + public IHttpActionResult Post(SyncMapping entity) { - Service.DeleteSyncMapping(entity); + var result = Insert(entity, () => Service.InsertSyncMapping(entity)); + return result; } - [WebApiQueryable] - public SingleResult GetSyncMapping(int key) + public async Task Put(int key, SyncMapping entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateSyncMapping(entity)); + return result; + } + + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateSyncMapping(entity)); + return result; + } + + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteSyncMapping(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs index dfc2410601..dfc94d598c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Tax; using SmartStore.Core.Security; using SmartStore.Services.Tax; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class TaxCategoriesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Create)] - protected override void Insert(TaxCategory entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Read)] + public IQueryable Get() { - Service.InsertTaxCategory(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Update)] - protected override void Update(TaxCategory entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Read)] + public SingleResult Get(int key) { - Service.UpdateTaxCategory(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Delete)] - protected override void Delete(TaxCategory entity) + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Create)] + public IHttpActionResult Post(TaxCategory entity) { - Service.DeleteTaxCategory(entity); + var result = Insert(entity, () => Service.InsertTaxCategory(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Read)] - public SingleResult GetTaxCategory(int key) + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Update)] + public async Task Put(int key, TaxCategory entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateTaxCategory(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Update)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateTaxCategory(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Delete)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteTaxCategory(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs index b071e3570c..543dc6a7e3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs @@ -1,4 +1,7 @@ -using System.Web.Http; +using System.Linq; +using System.Threading.Tasks; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -10,29 +13,46 @@ namespace SmartStore.WebApi.Controllers.OData { public class TierPricesController : WebApiEntityController { - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] - protected override void Insert(TierPrice entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public IQueryable Get() { - Service.InsertTierPrice(entity); + return GetEntitySet(); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] - protected override void Update(TierPrice entity) + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult Get(int key) { - Service.UpdateTierPrice(entity); + return GetSingleResult(key); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] - protected override void Delete(TierPrice entity) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] + public IHttpActionResult Post(TierPrice entity) { - Service.DeleteTierPrice(entity); + var result = Insert(entity, () => Service.InsertTierPrice(entity)); + return result; } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetTierPrice(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] + public async Task Put(int key, TierPrice entity) { - return GetSingleResult(key); + var result = await UpdateAsync(entity, key, () => Service.UpdateTierPrice(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] + public async Task Patch(int key, Delta model) + { + var result = await PartiallyUpdateAsync(key, model, entity => Service.UpdateTierPrice(entity)); + return result; + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] + public async Task Delete(int key) + { + var result = await DeleteAsync(key, entity => Service.DeleteTierPrice(entity)); + return result; } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs index bb34ba66b7..04ac3f0303 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs @@ -1,32 +1,47 @@ -using System.Web.Http; +using System.Linq; +using System.Web.Http; +using System.Web.OData; using SmartStore.Core.Domain.Seo; using SmartStore.Services.Seo; using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.OData; +using SmartStore.Web.Framework.WebApi.Security; namespace SmartStore.WebApi.Controllers.OData { - public class UrlRecordsController : WebApiEntityController + [WebApiAuthenticate] + public class UrlRecordsController : WebApiEntityController { - protected override void Insert(UrlRecord entity) + [WebApiQueryable] + public IQueryable Get() + { + return GetEntitySet(); + } + + [WebApiQueryable] + public SingleResult Get(int key) + { + return GetSingleResult(key); + } + + public IHttpActionResult Post(UrlRecord entity) { throw this.ExceptionForbidden(); } - protected override void Update(UrlRecord entity) + public IHttpActionResult Put(int key, UrlRecord entity) { throw this.ExceptionForbidden(); } - protected override void Delete(UrlRecord entity) + public IHttpActionResult Patch(int key, Delta model) { throw this.ExceptionForbidden(); } - [WebApiQueryable] - public SingleResult GetUrlRecord(int key) + public IHttpActionResult Delete(int key) { - return GetSingleResult(key); + throw this.ExceptionForbidden(); } } } diff --git a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs index 971baef874..4f2ddd8aa9 100644 --- a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs +++ b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Web.OData.Builder; using SmartStore.Core.Domain.Blogs; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Common; @@ -22,8 +21,6 @@ using SmartStore.Services.Media; using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.Configuration; -using SmartStore.WebApi.Models.OData; -using SmartStore.WebApi.Services; using SmartStore.WebApi.Services.Swagger; using Swashbuckle.Application; @@ -94,10 +91,10 @@ public void Configure(WebApiConfigurationBroadcaster configData) m.EntitySet("UrlRecords"); m.EntitySet("SyncMappings"); - AddActionsToOrder(m.EntityType()); - AddActionsToOrderItem(m.EntityType()); - AddActionsToProduct(m.EntityType()); - + // Register OData actions and functions. + Controllers.OData.OrdersController.Init(configData); + Controllers.OData.OrderItemsController.Init(configData); + Controllers.OData.ProductsController.Init(configData); Controllers.OData.MediaController.Init(configData); // Swagger integration, see http://www.my-store.com/swagger/ui/index @@ -144,61 +141,5 @@ public void Configure(WebApiConfigurationBroadcaster configData) ex.Dump(); } } - - private void AddActionsToOrder(EntityTypeConfiguration config) - { - config.Action("Infos").Returns(); - - config.Action("Pdf"); - - config.Action("PaymentPending") - .ReturnsFromEntitySet("Orders"); - - config.Action("PaymentPaid") - .ReturnsFromEntitySet("Orders") - .Parameter("PaymentMethodName"); - - config.Action("PaymentRefund") - .ReturnsFromEntitySet("Orders") - .Parameter("Online"); - - config.Action("Cancel") - .ReturnsFromEntitySet("Orders"); - - var addShipment = config.Action("AddShipment") - .ReturnsFromEntitySet("Orders"); - - var completeOrder = config.Action("CompleteOrder") - .ReturnsFromEntitySet("Orders"); - - addShipment.Parameter("TrackingNumber"); - addShipment.Parameter("SetAsShipped"); - } - - private void AddActionsToOrderItem(EntityTypeConfiguration config) - { - config.Action("Infos").Returns(); - } - - private void AddActionsToProduct(EntityTypeConfiguration config) - { - config.Collection.Action("Search") - .ReturnsCollectionFromEntitySet("Products"); - - config.Action("FinalPrice") - .Returns(); - - config.Action("LowestPrice") - .Returns(); - - config.Action("CreateAttributeCombinations") - .ReturnsCollectionFromEntitySet("ProductVariantAttributeCombinations"); - - var manageAttributes = config.Action("ManageAttributes") - .ReturnsCollectionFromEntitySet("ProductVariantAttributes"); - - manageAttributes.Parameter("Synchronize"); - manageAttributes.CollectionParameter("Attributes"); - } } } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index afb1e39d8e..8e17b53554 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -27,25 +27,6 @@ namespace SmartStore.Web.Framework.WebApi public abstract class WebApiEntityController : ODataController where TEntity : BaseEntity, new() { - // TODO: Implement custom routing convention(s): - // public override HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) - - // TODO: Needs to be handled by the respective controller: - // protected override int GetKey(TEntity entity) - // protected override TEntity GetEntityByKey(int key) - - // public override HttpResponseMessage Post(TEntity entity) - // protected override TEntity CreateEntity(TEntity entity) - // public override HttpResponseMessage Put(int key, TEntity update) - // protected override TEntity UpdateEntity(int key, TEntity update) - // public override HttpResponseMessage Patch(int key, Delta patch) - // protected override TEntity PatchEntity(int key, Delta patch) - // public override void Delete(int key) - - // TODO: - // XML serialization issues. - // Don't use service models like MediaFileInfo. API must encapsulate and model independently. - /// /// Auto injected by Autofac. /// @@ -228,21 +209,6 @@ protected internal virtual SingleResult GetRelatedEntity( return SingleResult.Create(query); } - protected internal virtual void Insert(TEntity entity) - { - Repository.Insert(entity); - } - - protected internal virtual void Update(TEntity entity) - { - Repository.Update(entity); - } - - protected internal virtual void Delete(TEntity entity) - { - Repository.Delete(entity); - } - protected internal virtual IHttpActionResult Insert(TEntity entity, Action insert) { if (!ModelState.IsValid) From caa87367631fc84ecc1ed110ab56dccfaeec2d6d Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 10 Aug 2020 10:43:14 +0200 Subject: [PATCH 016/695] API: minor update of the API client --- src/Tools/SmartStore.WebApi.Client/App.config | 9 +++--- .../MainForm.Designer.cs | 10 +++---- .../SmartStore.WebApi.Client/MainForm.cs | 5 ++-- .../Misc/Extensions.cs | 2 +- .../Misc/HourGlass.cs | 2 +- src/Tools/SmartStore.WebApi.Client/Program.cs | 6 ++-- .../Properties/AssemblyInfo.cs | 10 +++---- .../Properties/Resources.Designer.cs | 28 +++++++++---------- .../Properties/Settings.Designer.cs | 10 +++---- .../Properties/Settings.settings | 2 +- .../SmartStore.WebApi.Client/Settings.cs | 2 +- .../SmartStore.WebApi.Client.csproj | 10 +++---- .../WebApi/HmacAuthentication.cs | 2 +- .../WebApi/WebApiConsumer.cs | 3 +- .../WebApi/WebApiConsumerResponse.cs | 2 +- .../WebApi/WebApiCore.cs | 2 +- .../WebApi/WebApiExtensions.cs | 26 ++++++++++------- 17 files changed, 68 insertions(+), 63 deletions(-) diff --git a/src/Tools/SmartStore.WebApi.Client/App.config b/src/Tools/SmartStore.WebApi.Client/App.config index bc30a5e783..0f1b5ffc08 100644 --- a/src/Tools/SmartStore.WebApi.Client/App.config +++ b/src/Tools/SmartStore.WebApi.Client/App.config @@ -2,14 +2,14 @@ -
+
- + @@ -34,6 +34,7 @@ - - + + + diff --git a/src/Tools/SmartStore.WebApi.Client/MainForm.Designer.cs b/src/Tools/SmartStore.WebApi.Client/MainForm.Designer.cs index be51428354..7b379875c2 100644 --- a/src/Tools/SmartStore.WebApi.Client/MainForm.Designer.cs +++ b/src/Tools/SmartStore.WebApi.Client/MainForm.Designer.cs @@ -1,4 +1,4 @@ -namespace SmartStoreNetWebApiClient +namespace SmartStore.WebApi.Client { partial class MainForm { @@ -407,21 +407,21 @@ private void InitializeComponent() // // txtVersion // - this.txtVersion.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::SmartStoreNetWebApiClient.Properties.Settings.Default, "ApiVersion", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.txtVersion.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::SmartStore.WebApi.Client.Properties.Settings.Default, "ApiVersion", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtVersion.Location = new System.Drawing.Point(370, 36); this.txtVersion.Name = "txtVersion"; this.txtVersion.Size = new System.Drawing.Size(89, 21); this.txtVersion.TabIndex = 4; - this.txtVersion.Text = global::SmartStoreNetWebApiClient.Properties.Settings.Default.ApiVersion; + this.txtVersion.Text = global::SmartStore.WebApi.Client.Properties.Settings.Default.ApiVersion; // // txtUrl // - this.txtUrl.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::SmartStoreNetWebApiClient.Properties.Settings.Default, "ApiUrl", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); + this.txtUrl.DataBindings.Add(new System.Windows.Forms.Binding("Text", global::SmartStore.WebApi.Client.Properties.Settings.Default, "ApiUrl", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.txtUrl.Location = new System.Drawing.Point(84, 62); this.txtUrl.Name = "txtUrl"; this.txtUrl.Size = new System.Drawing.Size(225, 21); this.txtUrl.TabIndex = 2; - this.txtUrl.Text = global::SmartStoreNetWebApiClient.Properties.Settings.Default.ApiUrl; + this.txtUrl.Text = global::SmartStore.WebApi.Client.Properties.Settings.Default.ApiUrl; // // btnFileOpen // diff --git a/src/Tools/SmartStore.WebApi.Client/MainForm.cs b/src/Tools/SmartStore.WebApi.Client/MainForm.cs index 1ec67ae20a..72d341f8b1 100644 --- a/src/Tools/SmartStore.WebApi.Client/MainForm.cs +++ b/src/Tools/SmartStore.WebApi.Client/MainForm.cs @@ -3,10 +3,9 @@ using System.Diagnostics; using System.Text; using System.Windows.Forms; -using SmartStore.Net.WebApi; -using SmartStoreNetWebApiClient.Properties; +using SmartStore.WebApi.Client.Properties; -namespace SmartStoreNetWebApiClient +namespace SmartStore.WebApi.Client { public partial class MainForm : Form { diff --git a/src/Tools/SmartStore.WebApi.Client/Misc/Extensions.cs b/src/Tools/SmartStore.WebApi.Client/Misc/Extensions.cs index 67c22c0114..d2d7faea62 100644 --- a/src/Tools/SmartStore.WebApi.Client/Misc/Extensions.cs +++ b/src/Tools/SmartStore.WebApi.Client/Misc/Extensions.cs @@ -4,7 +4,7 @@ using System.Text; using System.Windows.Forms; -namespace SmartStoreNetWebApiClient +namespace SmartStore.WebApi.Client { public static class Extensions { diff --git a/src/Tools/SmartStore.WebApi.Client/Misc/HourGlass.cs b/src/Tools/SmartStore.WebApi.Client/Misc/HourGlass.cs index c2c80a7230..645dd92295 100644 --- a/src/Tools/SmartStore.WebApi.Client/Misc/HourGlass.cs +++ b/src/Tools/SmartStore.WebApi.Client/Misc/HourGlass.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace SmartStoreNetWebApiClient +namespace SmartStore.WebApi.Client { public class HourGlass : IDisposable { diff --git a/src/Tools/SmartStore.WebApi.Client/Program.cs b/src/Tools/SmartStore.WebApi.Client/Program.cs index 804bee7412..77a79af8e3 100644 --- a/src/Tools/SmartStore.WebApi.Client/Program.cs +++ b/src/Tools/SmartStore.WebApi.Client/Program.cs @@ -1,12 +1,12 @@ using System; using System.Windows.Forms; -namespace SmartStoreNetWebApiClient +namespace SmartStore.WebApi.Client { static class Program { - public static string AppName { get { return "SmartStore.Net Web API Client v.1.6"; } } - public static string ConsumerName { get { return "My shopping data consumer v.1.6"; } } + public static string AppName { get { return "SmartStore Web API Client v.1.7"; } } + public static string ConsumerName { get { return "My shopping data consumer v.1.7"; } } [STAThread] static void Main() diff --git a/src/Tools/SmartStore.WebApi.Client/Properties/AssemblyInfo.cs b/src/Tools/SmartStore.WebApi.Client/Properties/AssemblyInfo.cs index 9c64d97f98..d8cdab27b8 100644 --- a/src/Tools/SmartStore.WebApi.Client/Properties/AssemblyInfo.cs +++ b/src/Tools/SmartStore.WebApi.Client/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("SmartStore.Net WebApi Client")] +[assembly: AssemblyTitle("SmartStore WebApi Client")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SmartStoreNetWebApiClient")] -[assembly: AssemblyCopyright("Copyright © SmartStore AG 2017")] +[assembly: AssemblyProduct("SmartStoreWebApiClient")] +[assembly: AssemblyCopyright("Copyright © SmartStore AG 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.0.0")] -[assembly: AssemblyFileVersion("1.5.0.0")] +[assembly: AssemblyVersion("1.7.0.0")] +[assembly: AssemblyFileVersion("1.7.0.0")] diff --git a/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs b/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs index c31baa9266..886e9e37c7 100644 --- a/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs +++ b/src/Tools/SmartStore.WebApi.Client/Properties/Resources.Designer.cs @@ -1,24 +1,24 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ -namespace SmartStoreNetWebApiClient.Properties { +namespace SmartStore.WebApi.Client.Properties { using System; /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,13 +33,13 @@ internal Resources() { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SmartStoreNetWebApiClient.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SmartStore.WebApi.Client.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { diff --git a/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs b/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs index 8d0f1103b9..ac2aa8c85f 100644 --- a/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs +++ b/src/Tools/SmartStore.WebApi.Client/Properties/Settings.Designer.cs @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ -namespace SmartStoreNetWebApiClient.Properties { +namespace SmartStore.WebApi.Client.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] diff --git a/src/Tools/SmartStore.WebApi.Client/Properties/Settings.settings b/src/Tools/SmartStore.WebApi.Client/Properties/Settings.settings index 0c9a0fecf9..3ba352ea4f 100644 --- a/src/Tools/SmartStore.WebApi.Client/Properties/Settings.settings +++ b/src/Tools/SmartStore.WebApi.Client/Properties/Settings.settings @@ -1,5 +1,5 @@  - + diff --git a/src/Tools/SmartStore.WebApi.Client/Settings.cs b/src/Tools/SmartStore.WebApi.Client/Settings.cs index 33cef85710..058c435335 100644 --- a/src/Tools/SmartStore.WebApi.Client/Settings.cs +++ b/src/Tools/SmartStore.WebApi.Client/Settings.cs @@ -1,4 +1,4 @@ -namespace SmartStoreNetWebApiClient.Properties +namespace SmartStore.WebApi.Client.Properties { internal sealed partial class Settings { diff --git a/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj b/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj index 426ea67e53..4e20cc2a42 100644 --- a/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj +++ b/src/Tools/SmartStore.WebApi.Client/SmartStore.WebApi.Client.csproj @@ -7,11 +7,14 @@ {CD28D50C-38C3-4371-80B3-71FE7853D61D} WinExe Properties - SmartStoreNetWebApiClient - SmartStoreNetWebApiClient + SmartStore.WebApi.Client + SmartStoreWebApiClient v4.7.2 512 false + ..\..\ + true + veröffentlichen\ true Disk @@ -26,9 +29,6 @@ 1.0.0.%2a false true - ..\..\ - true - AnyCPU diff --git a/src/Tools/SmartStore.WebApi.Client/WebApi/HmacAuthentication.cs b/src/Tools/SmartStore.WebApi.Client/WebApi/HmacAuthentication.cs index 9e96243456..6501d83121 100644 --- a/src/Tools/SmartStore.WebApi.Client/WebApi/HmacAuthentication.cs +++ b/src/Tools/SmartStore.WebApi.Client/WebApi/HmacAuthentication.cs @@ -4,7 +4,7 @@ using System.Text; using System.Web; -namespace SmartStore.Net.WebApi +namespace SmartStore.WebApi.Client { public class HmacAuthentication { diff --git a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs index 2bd2ff0afd..3ce18ef41d 100644 --- a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs +++ b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs @@ -7,9 +7,8 @@ using System.Text; using System.Web; using System.Windows.Forms; -using SmartStoreNetWebApiClient; -namespace SmartStore.Net.WebApi +namespace SmartStore.WebApi.Client { public class ApiConsumer : HmacAuthentication { diff --git a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumerResponse.cs b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumerResponse.cs index bdfab463ae..250cb0f297 100644 --- a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumerResponse.cs +++ b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumerResponse.cs @@ -1,4 +1,4 @@ -namespace SmartStore.Net.WebApi +namespace SmartStore.WebApi.Client { public class WebApiConsumerResponse { diff --git a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiCore.cs b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiCore.cs index 6aef864d6b..043d1b2d73 100644 --- a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiCore.cs +++ b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiCore.cs @@ -1,6 +1,6 @@ using System.Text; -namespace SmartStore.Net.WebApi +namespace SmartStore.WebApi.Client { public class WebApiRequestContext { diff --git a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiExtensions.cs b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiExtensions.cs index dcb281f1d1..61f7245660 100644 --- a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiExtensions.cs +++ b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiExtensions.cs @@ -4,9 +4,9 @@ using System.Text; using Newtonsoft.Json.Linq; -namespace SmartStore.Net.WebApi +namespace SmartStore.WebApi.Client { - public static class WebApiExtensions + public static class WebApiExtensions { private static readonly DateTime BeginOfEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); @@ -26,7 +26,9 @@ public static DateTime FromUnixTime(this long unixTime) public static string ToHexString(this byte[] bytes, int length = 0) { if (bytes == null || bytes.Length <= 0) + { return ""; + } var sb = new StringBuilder(); @@ -37,6 +39,7 @@ public static string ToHexString(this byte[] bytes, int length = 0) if (length > 0 && sb.Length >= length) break; } + return sb.ToString(); } @@ -46,18 +49,20 @@ public static string ToHexString(this byte[] bytes, int length = 0) public static List TryParseCustomers(this WebApiConsumerResponse response) { if (response == null || string.IsNullOrWhiteSpace(response.Content)) + { return null; + } - //dynamic dynamicJson = JObject.Parse(response.Content); + // dynamic dynamicJson = JObject.Parse(response.Content); - //foreach (dynamic customer in dynamicJson.value) - //{ - // string str = string.Format("{0} {1} {2}", customer.Id, customer.CustomerGuid, customer.Email); - // Debug.WriteLine(str); - //} + // foreach (dynamic customer in dynamicJson.value) + // { + // string str = string.Format("{0} {1} {2}", customer.Id, customer.CustomerGuid, customer.Email); + //str.Dump(); + // } - var json = JObject.Parse(response.Content); - string metadata = (string)json["odata.metadata"]; + var json = JObject.Parse(response.Content); + string metadata = (string)json["@odata.context"]; if (!string.IsNullOrWhiteSpace(metadata) && metadata.EndsWith("#Customers")) { @@ -65,6 +70,7 @@ public static List TryParseCustomers(this WebApiConsumerResponse respo return customers; } + return null; } } From 2bd50dfcf1086aa8d300c280374ee406eae76d02 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 10 Aug 2020 15:44:34 +0200 Subject: [PATCH 017/695] API: fixes "The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'" --- .../SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs index 88d58be4bb..184c532976 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs @@ -3,7 +3,6 @@ using System.Web.Http.Cors; using System.Web.OData.Builder; using System.Web.OData.Extensions; -using System.Web.OData.Formatter; using System.Web.OData.Routing; using System.Web.OData.Routing.Conventions; using Newtonsoft.Json; @@ -30,8 +29,9 @@ public void Start() config.DependencyResolver = new AutofacWebApiDependencyResolver(); - var odataFormatters = ODataMediaTypeFormatters.Create(); - config.Formatters.InsertRange(0, odataFormatters); + // Causes error messages during XML serialization: + //var oDataFormatters = ODataMediaTypeFormatters.Create(); + //config.Formatters.InsertRange(0, oDataFormatters); config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; From 8805097f870e0714877aefd35d1a78d8812a3302 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 10 Aug 2020 20:10:23 +0200 Subject: [PATCH 018/695] API: minor changes --- ...cturesController.cs => MediaController.cs} | 55 +++++++++---------- .../Controllers/OData/ProductsController.cs | 14 +++-- .../Models/Api/UploadImage.cs | 3 + .../OData/ManageAttributeType.cs} | 5 +- .../Models/OData/OrderInfo.cs | 3 + .../Models/OData/OrderItemInfo.cs | 3 + .../SmartStore.WebApi.csproj | 4 +- .../WebApiConfigurationProvider.cs | 1 - 8 files changed, 50 insertions(+), 38 deletions(-) rename src/Plugins/SmartStore.WebApi/Controllers/OData/{PicturesController.cs => MediaController.cs} (89%) rename src/Plugins/SmartStore.WebApi/{Services/WebApiCore.cs => Models/OData/ManageAttributeType.cs} (85%) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs similarity index 89% rename from src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs rename to src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 7cfe69cfd0..1bdceadf94 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -5,8 +5,6 @@ using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; -using SmartStore.Core.Domain.Catalog; -using SmartStore.Core.Domain.Media; using SmartStore.Services.Media; using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.Configuration; @@ -15,6 +13,7 @@ namespace SmartStore.WebApi.Controllers.OData { + // TODO: readonly properties of MediaFileInfo cannot be serialized! public class MediaController : ODataController { private readonly IMediaService _mediaService; @@ -24,8 +23,6 @@ public MediaController(IMediaService mediaService) _mediaService = mediaService; } - // TODO: readonly properties of MediaFileInfo cannot be serialized! - // GET /Media(123) [WebApiAuthenticate] public MediaFileInfo Get(int key) @@ -222,30 +219,28 @@ await this.ProcessEntityAsync(async () => } - // TODO: do not support direct MediaFile entity editing through API. - // Add MediaController for IMediaService methods instead. - public class PicturesController : WebApiEntityController - { - protected override IQueryable GetEntitySet() - { - var query = - from x in Repository.Table - where !x.Deleted && !x.Hidden - select x; - - return query; - } - - [WebApiQueryable] - public SingleResult GetPicture(int key) - { - return GetSingleResult(key); - } - - [WebApiQueryable] - public IQueryable GetProductPictures(int key) - { - return GetRelatedCollection(key, x => x.ProductMediaFiles); - } - } + // public class PicturesController : WebApiEntityController + //{ + // protected override IQueryable GetEntitySet() + // { + // var query = + // from x in Repository.Table + // where !x.Deleted && !x.Hidden + // select x; + + // return query; + // } + + // [WebApiQueryable] + // public SingleResult GetPicture(int key) + // { + // return GetSingleResult(key); + // } + + // [WebApiQueryable] + // public IQueryable GetProductPictures(int key) + // { + // return GetRelatedCollection(key, x => x.ProductMediaFiles); + // } + //} } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index aebea290c1..a1afbbe125 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -20,6 +20,7 @@ using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.Web.Framework.WebApi.OData; using SmartStore.Web.Framework.WebApi.Security; +using SmartStore.WebApi.Models.OData; using SmartStore.WebApi.Services; namespace SmartStore.WebApi.Controllers.OData @@ -466,7 +467,7 @@ public IQueryable CreateAttributeCombination [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] public IQueryable ManageAttributes(int key, ODataActionParameters parameters) { - var entity = GetExpandedEntity(key, x => x.ProductVariantAttributes); + var entity = GetExpandedEntity(key, x => x.ProductVariantAttributes.Select(y => y.ProductAttribute)); var result = new List(); this.ProcessEntity(() => @@ -476,7 +477,7 @@ public IQueryable ManageAttributes(int key, ODataAction .Where(x => x.Name.HasValue()) .ToList(); - var attributeNames = new HashSet(data.Select(x => x.Name), StringComparer.InvariantCultureIgnoreCase); + var attributeNames = new HashSet(data.Select(x => x.Name), StringComparer.OrdinalIgnoreCase); var pagedAttributes = _productAttributeService.Value.GetAllProductAttributes(0, 1); var attributesData = pagedAttributes.SourceQuery .Where(x => attributeNames.Contains(x.Name)) @@ -484,8 +485,9 @@ public IQueryable ManageAttributes(int key, ODataAction .ToList(); var allAttributesDic = attributesData.ToDictionarySafe(x => x.Name, x => x, StringComparer.OrdinalIgnoreCase); - foreach (var srcAttr in data) + foreach (var srcAttr in data) { + // Product attribute. var attributeId = 0; if (allAttributesDic.TryGetValue(srcAttr.Name, out var attributeData)) { @@ -498,9 +500,11 @@ public IQueryable ManageAttributes(int key, ODataAction attributeId = attribute.Id; } - var productAttribute = entity.ProductVariantAttributes.FirstOrDefault(x => x.ProductAttribute.Name.IsCaseInsensitiveEqual(srcAttr.Name)); + // Product attribute mapping. + var productAttribute = entity.ProductVariantAttributes.FirstOrDefault(x => x.ProductAttribute?.Name.IsCaseInsensitiveEqual(srcAttr.Name) ?? false); if (productAttribute == null) { + // No mapping to attribute yet. productAttribute = new ProductVariantAttribute { ProductId = entity.Id, @@ -515,6 +519,7 @@ public IQueryable ManageAttributes(int key, ODataAction } else if (synchronize) { + // Has already an attribute mapping. if (srcAttr.Values.Count <= 0 && productAttribute.ShouldHaveValues()) { _productAttributeService.Value.DeleteProductVariantAttribute(productAttribute); @@ -528,6 +533,7 @@ public IQueryable ManageAttributes(int key, ODataAction } } + // Values. var maxDisplayOrder = productAttribute.ProductVariantAttributeValues .OrderByDescending(x => x.DisplayOrder) .Select(x => x.DisplayOrder) diff --git a/src/Plugins/SmartStore.WebApi/Models/Api/UploadImage.cs b/src/Plugins/SmartStore.WebApi/Models/Api/UploadImage.cs index a7e03e7e40..e00ab08035 100644 --- a/src/Plugins/SmartStore.WebApi/Models/Api/UploadImage.cs +++ b/src/Plugins/SmartStore.WebApi/Models/Api/UploadImage.cs @@ -5,6 +5,9 @@ namespace SmartStore.WebApi.Models.Api { + /// + /// Information about an uploaded image returned by the API. + /// [DataContract] public partial class UploadImage : UploadFileBase { diff --git a/src/Plugins/SmartStore.WebApi/Services/WebApiCore.cs b/src/Plugins/SmartStore.WebApi/Models/OData/ManageAttributeType.cs similarity index 85% rename from src/Plugins/SmartStore.WebApi/Services/WebApiCore.cs rename to src/Plugins/SmartStore.WebApi/Models/OData/ManageAttributeType.cs index aa956af9f5..e4fec45a59 100644 --- a/src/Plugins/SmartStore.WebApi/Services/WebApiCore.cs +++ b/src/Plugins/SmartStore.WebApi/Models/OData/ManageAttributeType.cs @@ -2,8 +2,11 @@ using System.Collections.Generic; using SmartStore.Core.Domain.Catalog; -namespace SmartStore.WebApi.Services +namespace SmartStore.WebApi.Models.OData { + /// + /// Data send by the consumer to manage product attributes. + /// [Serializable] internal class ManageAttributeType { diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/OrderInfo.cs b/src/Plugins/SmartStore.WebApi/Models/OData/OrderInfo.cs index fc2fb0ec3e..a9d5ec5ca8 100644 --- a/src/Plugins/SmartStore.WebApi/Models/OData/OrderInfo.cs +++ b/src/Plugins/SmartStore.WebApi/Models/OData/OrderInfo.cs @@ -2,6 +2,9 @@ namespace SmartStore.WebApi.Models.OData { + /// + /// Extra information about an order returned by the API. + /// [DataContract] public partial class OrderInfo { diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/OrderItemInfo.cs b/src/Plugins/SmartStore.WebApi/Models/OData/OrderItemInfo.cs index bd7e46ad8b..8cd95001a8 100644 --- a/src/Plugins/SmartStore.WebApi/Models/OData/OrderItemInfo.cs +++ b/src/Plugins/SmartStore.WebApi/Models/OData/OrderItemInfo.cs @@ -2,6 +2,9 @@ namespace SmartStore.WebApi.Models.OData { + /// + /// Extra information about an order item returned by the API. + /// [DataContract] public partial class OrderItemInfo { diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 0d525831e8..b993a6b15d 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -240,7 +240,7 @@ - + @@ -286,7 +286,7 @@ - + diff --git a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs index 4f2ddd8aa9..653856adb7 100644 --- a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs +++ b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs @@ -52,7 +52,6 @@ public void Configure(WebApiConfigurationBroadcaster configData) m.EntitySet("Manufacturers"); m.EntitySet("MeasureDimensions"); m.EntitySet("MeasureWeights"); - m.EntitySet("Pictures"); m.EntitySet("Media"); m.EntitySet("MediaTags"); m.EntitySet("MediaTracks"); From fc464112ef226f825717865d0b20e919680b284f Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Mon, 10 Aug 2020 21:00:07 +0200 Subject: [PATCH 019/695] Minor fixes --- src/Libraries/SmartStore.Data/Setup/DbSeedingMigrator.cs | 4 ++-- .../SmartStore.Web/Themes/Flex/Content/_menu.scss | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Libraries/SmartStore.Data/Setup/DbSeedingMigrator.cs b/src/Libraries/SmartStore.Data/Setup/DbSeedingMigrator.cs index 5b53ce3b15..e7ea34b16c 100644 --- a/src/Libraries/SmartStore.Data/Setup/DbSeedingMigrator.cs +++ b/src/Libraries/SmartStore.Data/Setup/DbSeedingMigrator.cs @@ -197,14 +197,14 @@ public int RunPendingMigrations(TContext context) private void RunSeeders(IEnumerable seederEntries, T ctx) where T : DbContext { + var eventPublisher = EngineContext.Current.Resolve(); + foreach (var seederEntry in seederEntries) { var seeder = (IDataSeeder)seederEntry.DataSeeder; try { - var eventPublisher = EngineContext.Current.Resolve(); - // Pre seed event eventPublisher.Publish(new SeedingDbMigrationEvent { MigrationName = seederEntry.MigrationName, DbContext = ctx }); diff --git a/src/Presentation/SmartStore.Web/Themes/Flex/Content/_menu.scss b/src/Presentation/SmartStore.Web/Themes/Flex/Content/_menu.scss index 5c2273bd53..bbc538cda6 100644 --- a/src/Presentation/SmartStore.Web/Themes/Flex/Content/_menu.scss +++ b/src/Presentation/SmartStore.Web/Themes/Flex/Content/_menu.scss @@ -21,13 +21,13 @@ $ocm-selected-color: $warning; .catmenu-path-item.expanded, .catmenu-item.parent { - padding-right: $list-group-item-padding-x * 1.5; + padding-right: $list-group-item-padding-x * 1.2; &:after { - @include fontawesome("\f105", 1.2rem); + @include fontawesome("\f054", 0.75rem); display: block; position: absolute; - right: 1rem; + right: 0.625rem; top: 50%; transform: translateY(-50%); } From d38adea8736d6311c4ab6dd0a517a121a76c46a8 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Mon, 10 Aug 2020 21:43:14 +0200 Subject: [PATCH 020/695] Updated EntityFramework packages to v3.4.4 --- src/Libraries/SmartStore.Core/SmartStore.Core.csproj | 4 ++-- src/Libraries/SmartStore.Core/packages.config | 2 +- src/Libraries/SmartStore.Data/SmartStore.Data.csproj | 6 +++--- src/Libraries/SmartStore.Data/packages.config | 4 ++-- .../SmartStore.Services/SmartStore.Services.csproj | 4 ++-- src/Libraries/SmartStore.Services/packages.config | 2 +- src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj | 4 ++-- src/Plugins/SmartStore.DevTools/packages.config | 2 +- .../SmartStore.GoogleMerchantCenter.csproj | 4 ++-- src/Plugins/SmartStore.GoogleMerchantCenter/packages.config | 2 +- src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj | 4 ++-- src/Plugins/SmartStore.Shipping/packages.config | 2 +- .../SmartStore.ShippingByWeight.csproj | 4 ++-- src/Plugins/SmartStore.ShippingByWeight/packages.config | 2 +- src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj | 4 ++-- src/Plugins/SmartStore.Tax/packages.config | 2 +- src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj | 4 ++-- src/Plugins/SmartStore.WebApi/packages.config | 2 +- .../SmartStore.Web.Framework.csproj | 4 ++-- src/Presentation/SmartStore.Web.Framework/packages.config | 2 +- .../SmartStore.Web/Administration/packages.config | 2 +- src/Presentation/SmartStore.Web/SmartStore.Web.csproj | 6 +++--- src/Presentation/SmartStore.Web/packages.config | 4 ++-- .../SmartStore.Core.Tests/SmartStore.Core.Tests.csproj | 4 ++-- src/Tests/SmartStore.Core.Tests/packages.config | 2 +- .../SmartStore.Data.Tests/SmartStore.Data.Tests.csproj | 6 +++--- src/Tests/SmartStore.Data.Tests/packages.config | 4 ++-- .../SmartStore.Services.Tests.csproj | 4 ++-- src/Tests/SmartStore.Services.Tests/packages.config | 2 +- src/Tests/SmartStore.Tests/SmartStore.Tests.csproj | 4 ++-- src/Tests/SmartStore.Tests/packages.config | 2 +- 31 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj index 130f467935..1bbc86c10d 100644 --- a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj +++ b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj @@ -73,11 +73,11 @@ True - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll True - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll True diff --git a/src/Libraries/SmartStore.Core/packages.config b/src/Libraries/SmartStore.Core/packages.config index e43ef279d7..f8558c42cd 100644 --- a/src/Libraries/SmartStore.Core/packages.config +++ b/src/Libraries/SmartStore.Core/packages.config @@ -3,7 +3,7 @@ - + diff --git a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj index b1c7331ec9..6d014f01c7 100644 --- a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj +++ b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj @@ -71,15 +71,15 @@ ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll True - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll True - ..\..\packages\EntityFramework.SqlServerCompact.6.2.0\lib\net45\EntityFramework.SqlServerCompact.dll + ..\..\packages\EntityFramework.SqlServerCompact.6.4.4\lib\net45\EntityFramework.SqlServerCompact.dll True diff --git a/src/Libraries/SmartStore.Data/packages.config b/src/Libraries/SmartStore.Data/packages.config index a7e5d59fea..a913d74148 100644 --- a/src/Libraries/SmartStore.Data/packages.config +++ b/src/Libraries/SmartStore.Data/packages.config @@ -1,8 +1,8 @@  - - + + diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 82e77a9138..503fe52789 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -81,11 +81,11 @@ True - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll True - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll True diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index efaa7e009b..9218c41be9 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -4,7 +4,7 @@ - + diff --git a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj index 3a0ad889a8..940f54c632 100644 --- a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj +++ b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj @@ -85,11 +85,11 @@ False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False diff --git a/src/Plugins/SmartStore.DevTools/packages.config b/src/Plugins/SmartStore.DevTools/packages.config index 57a42b5851..1898961fd7 100644 --- a/src/Plugins/SmartStore.DevTools/packages.config +++ b/src/Plugins/SmartStore.DevTools/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj index 56ad46f35a..06368ab51d 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj @@ -94,11 +94,11 @@ False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config b/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config index fdc270f9cd..6f0d685c52 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj index d6cefba6be..a4f65fe396 100644 --- a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj +++ b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj @@ -94,11 +94,11 @@ False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False diff --git a/src/Plugins/SmartStore.Shipping/packages.config b/src/Plugins/SmartStore.Shipping/packages.config index 481f956237..775e294d7d 100644 --- a/src/Plugins/SmartStore.Shipping/packages.config +++ b/src/Plugins/SmartStore.Shipping/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj index a36d46d41f..ca1310024f 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj +++ b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj @@ -94,11 +94,11 @@ False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False diff --git a/src/Plugins/SmartStore.ShippingByWeight/packages.config b/src/Plugins/SmartStore.ShippingByWeight/packages.config index dadad11e6d..775e294d7d 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/packages.config +++ b/src/Plugins/SmartStore.ShippingByWeight/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj index 10615a9aa4..36f3d57b73 100644 --- a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj +++ b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj @@ -90,11 +90,11 @@ False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False diff --git a/src/Plugins/SmartStore.Tax/packages.config b/src/Plugins/SmartStore.Tax/packages.config index c2904f28a5..36d0a9ec66 100644 --- a/src/Plugins/SmartStore.Tax/packages.config +++ b/src/Plugins/SmartStore.Tax/packages.config @@ -1,7 +1,7 @@  - + diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index a7f6111bfd..56670be120 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -96,11 +96,11 @@ False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll False - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False diff --git a/src/Plugins/SmartStore.WebApi/packages.config b/src/Plugins/SmartStore.WebApi/packages.config index 24b7e62ffc..70f1cfe266 100644 --- a/src/Plugins/SmartStore.WebApi/packages.config +++ b/src/Plugins/SmartStore.WebApi/packages.config @@ -3,7 +3,7 @@ - + diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index 0a2848140c..4358766610 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -100,11 +100,11 @@ ..\..\packages\DotLiquid.2.0.254\lib\net45\DotLiquid.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll True - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll True diff --git a/src/Presentation/SmartStore.Web.Framework/packages.config b/src/Presentation/SmartStore.Web.Framework/packages.config index 3a994957a8..8ad306cfc9 100644 --- a/src/Presentation/SmartStore.Web.Framework/packages.config +++ b/src/Presentation/SmartStore.Web.Framework/packages.config @@ -11,7 +11,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/Administration/packages.config b/src/Presentation/SmartStore.Web/Administration/packages.config index 0d7426974d..7c34e63d21 100644 --- a/src/Presentation/SmartStore.Web/Administration/packages.config +++ b/src/Presentation/SmartStore.Web/Administration/packages.config @@ -3,7 +3,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj index 7351d74410..fda78974db 100644 --- a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj +++ b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj @@ -111,15 +111,15 @@ ..\..\packages\DouglasCrockford.JsMin.2.1.0\lib\net45\DouglasCrockford.JsMin.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll True - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll True - ..\..\packages\EntityFramework.SqlServerCompact.6.2.0\lib\net45\EntityFramework.SqlServerCompact.dll + ..\..\packages\EntityFramework.SqlServerCompact.6.4.4\lib\net45\EntityFramework.SqlServerCompact.dll True diff --git a/src/Presentation/SmartStore.Web/packages.config b/src/Presentation/SmartStore.Web/packages.config index 39f816c7b4..4c8b1b1872 100644 --- a/src/Presentation/SmartStore.Web/packages.config +++ b/src/Presentation/SmartStore.Web/packages.config @@ -11,8 +11,8 @@ - - + + diff --git a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj index d5724e561f..65432f54b0 100644 --- a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj +++ b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj @@ -66,10 +66,10 @@ ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Tests/SmartStore.Core.Tests/packages.config b/src/Tests/SmartStore.Core.Tests/packages.config index 078c3a2cff..464049c76b 100644 --- a/src/Tests/SmartStore.Core.Tests/packages.config +++ b/src/Tests/SmartStore.Core.Tests/packages.config @@ -1,7 +1,7 @@  - + diff --git a/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj b/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj index 0ef4a9806c..1c6900cef7 100644 --- a/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj +++ b/src/Tests/SmartStore.Data.Tests/SmartStore.Data.Tests.csproj @@ -63,13 +63,13 @@ - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll - ..\..\packages\EntityFramework.SqlServerCompact.6.2.0\lib\net45\EntityFramework.SqlServerCompact.dll + ..\..\packages\EntityFramework.SqlServerCompact.6.4.4\lib\net45\EntityFramework.SqlServerCompact.dll False diff --git a/src/Tests/SmartStore.Data.Tests/packages.config b/src/Tests/SmartStore.Data.Tests/packages.config index 71048b7d00..ca2235437e 100644 --- a/src/Tests/SmartStore.Data.Tests/packages.config +++ b/src/Tests/SmartStore.Data.Tests/packages.config @@ -1,7 +1,7 @@  - - + + \ No newline at end of file diff --git a/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj b/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj index 007dedcf87..46ac88b8ca 100644 --- a/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj +++ b/src/Tests/SmartStore.Services.Tests/SmartStore.Services.Tests.csproj @@ -67,10 +67,10 @@ - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll True diff --git a/src/Tests/SmartStore.Services.Tests/packages.config b/src/Tests/SmartStore.Services.Tests/packages.config index 64cae807e1..b7dc70b980 100644 --- a/src/Tests/SmartStore.Services.Tests/packages.config +++ b/src/Tests/SmartStore.Services.Tests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj b/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj index dbbbb741db..656767cf8c 100644 --- a/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj +++ b/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj @@ -66,10 +66,10 @@ ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False diff --git a/src/Tests/SmartStore.Tests/packages.config b/src/Tests/SmartStore.Tests/packages.config index 7df795ca0d..e08776c4ed 100644 --- a/src/Tests/SmartStore.Tests/packages.config +++ b/src/Tests/SmartStore.Tests/packages.config @@ -1,7 +1,7 @@  - + \ No newline at end of file From deec2a83eeabe70fdcca7c706bf4efb9b60db8bf Mon Sep 17 00:00:00 2001 From: Marcel Schmidt Date: Mon, 10 Aug 2020 21:47:48 +0200 Subject: [PATCH 021/695] fu > display main badge only for product pictures --- .../SmartStore.Web/Content/skinning/_fileupload.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Presentation/SmartStore.Web/Content/skinning/_fileupload.scss b/src/Presentation/SmartStore.Web/Content/skinning/_fileupload.scss index a830afbaa9..59a068a5cc 100644 --- a/src/Presentation/SmartStore.Web/Content/skinning/_fileupload.scss +++ b/src/Presentation/SmartStore.Web/Content/skinning/_fileupload.scss @@ -207,7 +207,7 @@ border-bottom-right-radius: 0; } - &:first-child .main-pic-badge { + #product-edit &:first-child .main-pic-badge { display: block; } From db1c2c1f4aed61cd8aa7428c8064235c01ee23e1 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 10 Aug 2020 21:55:14 +0200 Subject: [PATCH 022/695] API: custom routing convention (in progress) --- .../Controllers/Api/PaymentsController.cs | 2 +- .../Controllers/Api/UploadsController.cs | 15 +- .../OData/CustomerRolesController.cs | 7 +- .../Controllers/OData/CustomersController.cs | 6 +- .../Controllers/OData/MediaController.cs | 4 +- .../Controllers/OData/OrderItemsController.cs | 7 +- .../Controllers/OData/OrderNotesController.cs | 5 +- .../OData/PaymentMethodsController.cs | 3 +- .../OData/ReturnRequestsController.cs | 7 +- .../Controllers/OData/UrlRecordsController.cs | 9 +- .../Extensions/MiscExtensions.cs | 16 +- .../Services/CustomRoutingConvention.cs | 73 +++++++ .../WebApiCatalogSearchQueryModelBinder.cs | 5 +- .../SmartStore.WebApi.csproj | 1 + .../WebApiConfigurationProvider.cs | 4 + .../SmartStore.Web.Framework.csproj | 3 +- .../Extensions/ApiControllerExtensions.cs | 86 ++++++++ .../HttpRequestMessageExtensions.cs | 58 ++++++ .../Security/WebApiAuthenticateAttribute.cs | 8 +- .../WebApi/WebApiEntityController.cs | 12 +- .../WebApi/WebApiExtension.cs | 192 ------------------ 21 files changed, 287 insertions(+), 236 deletions(-) create mode 100644 src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs create mode 100644 src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs create mode 100644 src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs delete mode 100644 src/Presentation/SmartStore.Web.Framework/WebApi/WebApiExtension.cs diff --git a/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs index e9858981e0..08cd9c73d6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs @@ -24,7 +24,7 @@ public PaymentsController(Lazy providerManager) public IQueryable GetMethods() { if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); + throw this.InvalidModelStateException(); var query = _providerManager.Value .GetAllProviders() diff --git a/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs index 1a49be6a07..a6a6e3fd42 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs @@ -3,6 +3,7 @@ using System.IO; using System.IO.Compression; using System.Linq; +using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; @@ -93,7 +94,7 @@ public async Task> ProductImages() { if (!Request.Content.IsMimeMultipartContent()) { - throw this.ExceptionUnsupportedMediaType(); + throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType); } Product entity = null; @@ -108,7 +109,7 @@ public async Task> ProductImages() catch (Exception ex) { provider.DeleteLocalFiles(); - throw this.ExceptionInternalServerError(ex); + throw Request.InternalServerErrorException(ex); } // Find product entity. @@ -131,7 +132,7 @@ public async Task> ProductImages() if (entity == null) { provider.DeleteLocalFiles(); - throw this.ExceptionNotFound(WebApiGlobal.Error.EntityNotFound.FormatInvariant(identifier.NaIfEmpty())); + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(identifier.NaIfEmpty())); } // Process images. @@ -169,7 +170,7 @@ public async Task> ProductImages() if (existingFile == null || existingFile.Id != image.Picture.Id) { - throw this.ExceptionInternalServerError(new Exception($"Failed to update existing product image: id {image.Picture.Id}, path '{path.NaIfEmpty()}'.")); + throw Request.InternalServerErrorException(new Exception($"Failed to update existing product image: id {image.Picture.Id}, path '{path.NaIfEmpty()}'.")); } } else @@ -222,7 +223,7 @@ public async Task> ImportFiles() { if (!Request.Content.IsMimeMultipartContent()) { - throw this.ExceptionUnsupportedMediaType(); + throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType); } ImportProfile profile = null; @@ -237,7 +238,7 @@ public async Task> ImportFiles() catch (Exception ex) { FileSystemHelper.ClearDirectory(tempDir, true); - throw this.ExceptionInternalServerError(ex); + throw Request.InternalServerErrorException(ex); } // Find import profile. @@ -255,7 +256,7 @@ public async Task> ImportFiles() if (profile == null) { FileSystemHelper.ClearDirectory(tempDir, true); - throw this.ExceptionNotFound(WebApiGlobal.Error.EntityNotFound.FormatInvariant(identifier.NaIfEmpty())); + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(identifier.NaIfEmpty())); } var startImport = false; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs index 8bf7acbd14..bd7a3d1091 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -41,7 +42,7 @@ public async Task Put(int key, CustomerRole entity) { if (entity != null && entity.IsSystemRole) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } Service.UpdateCustomerRole(entity); @@ -57,7 +58,7 @@ public async Task Patch(int key, Delta model) { if (entity != null && entity.IsSystemRole) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } Service.UpdateCustomerRole(entity); @@ -73,7 +74,7 @@ public async Task Delete(int key) { if (entity != null && entity.IsSystemRole) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } Service.DeleteCustomerRole(entity); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 68c14283e2..1065d36d18 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -64,7 +64,7 @@ public async Task Put(int key, Customer entity) { if (entity != null && entity.IsSystemAccount) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } Service.UpdateCustomer(entity); @@ -79,7 +79,7 @@ public async Task Patch(int key, Delta model) { if (entity != null && entity.IsSystemAccount) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } Service.UpdateCustomer(entity); @@ -94,7 +94,7 @@ public async Task Delete(int key) { if (entity != null && entity.IsSystemAccount) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } Service.DeleteCustomer(entity); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 1bdceadf94..ad8d87063f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -34,7 +34,7 @@ public MediaFileInfo Get(int key) file = _mediaService.GetFileById(key); if (file == null) { - throw this.ExceptionNotFound($"Cannot find file by ID {key}."); + throw Request.NotFoundException($"Cannot find file by ID {key}."); } }); @@ -141,7 +141,7 @@ public MediaFileInfo GetFileByPath(ODataActionParameters parameters) file = _mediaService.GetFileByPath(path); if (file == null) { - throw this.ExceptionNotFound($"The file with the path '{path ?? string.Empty}' does not exist."); + throw Request.NotFoundException($"The file with the path '{path ?? string.Empty}' does not exist."); } }); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs index 65a97ffa38..f73fc2a2ca 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -43,19 +44,19 @@ public SingleResult Get(int key) [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] public IHttpActionResult Post(OrderItem entity) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] public IHttpActionResult Put(int key, OrderItem entity) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] public IHttpActionResult Patch(int key, Delta model) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs index 5e7af7704b..c539d054a7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -52,13 +53,13 @@ public IHttpActionResult Post(OrderNote entity) [WebApiAuthenticate(Permission = Permissions.Order.Update)] public IHttpActionResult Put(int key, OrderNote entity) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.Update)] public IHttpActionResult Patch(int key, Delta model) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.Update)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs index 507a13e230..53c6c18136 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -52,7 +53,7 @@ public async Task Patch(int key, Delta model) [WebApiAuthenticate] public IHttpActionResult Delete(int key) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs index 859b13a53f..91f5467cfc 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -31,19 +32,19 @@ public SingleResult Get(int key) [WebApiAuthenticate(Permission = Permissions.Customer.Create)] public IHttpActionResult Post(ReturnRequest entity) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Customer.Update)] public IHttpActionResult Put(int key, ReturnRequest entity) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Customer.Update)] public IHttpActionResult Patch(int key, Delta model) { - throw this.ExceptionNotImplemented(); + throw new HttpResponseException(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Delete)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs index 04ac3f0303..bbc1aca985 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Seo; @@ -26,22 +27,22 @@ public SingleResult Get(int key) public IHttpActionResult Post(UrlRecord entity) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } public IHttpActionResult Put(int key, UrlRecord entity) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } public IHttpActionResult Patch(int key, Delta model) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } public IHttpActionResult Delete(int key) { - throw this.ExceptionForbidden(); + throw new HttpResponseException(HttpStatusCode.Forbidden); } } } diff --git a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs index 50a75bd6e9..d4ef779249 100644 --- a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs +++ b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs @@ -1,8 +1,10 @@ -using System.Text; +using System.Net.Http; +using System.Text; using System.Web.Mvc; using System.Web.OData; using SmartStore.Core.Infrastructure; using SmartStore.Services.Localization; +using SmartStore.Utilities; namespace SmartStore.WebApi { @@ -61,5 +63,17 @@ public static T GetValueSafe(this ODataActionParameters parameters, string ke return default; } + + public static void DeleteLocalFiles(this MultipartFormDataStreamProvider provider) + { + try + { + foreach (var file in provider.FileData) + { + FileSystemHelper.DeleteFile(file.LocalFileName); + } + } + catch { } + } } } diff --git a/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs b/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs new file mode 100644 index 0000000000..893d9bb112 --- /dev/null +++ b/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs @@ -0,0 +1,73 @@ +using System.Linq; +using System.Net.Http; +using System.Web.Http.Controllers; +using System.Web.OData.Routing; +using System.Web.OData.Routing.Conventions; +using SmartStore.Web.Framework.WebApi; + +namespace SmartStore.WebApi.Services +{ + public class CustomRoutingConvention : EntitySetRoutingConvention + { + public override string SelectAction(ODataPath odataPath, HttpControllerContext context, ILookup actionMap) + { + var method = context.Request.Method; + + if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation/key")) + { + if (method == HttpMethod.Get || method == HttpMethod.Post || method == HttpMethod.Delete) + { + // We ignore standard OData path cause they differ: + // ~/entityset/key/$links/navigation (OData 3 "link"), ~/entityset/key/navigation/$ref (OData 4 "reference") + + var navigationProperty = GetNavigation(odataPath, 2); + + if (navigationProperty.IsEmpty()) + { + throw context.Request.BadRequestException(WebApiGlobal.Error.NoNavigationFromPath); + } + + var methodName = string.Concat("Navigation", navigationProperty); + + $"process custom path {methodName}".Dump(); + } + } + + // Not a match. + return null; + } + + #region Utilities + + // public static bool GetNormalizedKey(this ODataPath odataPath, int segmentIndex, out int key) + //{ + // if (odataPath.Segments.Count > segmentIndex) + // { + // string rawKey = (odataPath.Segments[segmentIndex] as KeyValuePathSegment).Value; + // if (rawKey.HasValue()) + // { + // if (rawKey.StartsWith("'")) + // rawKey = rawKey.Substring(1, rawKey.Length - 2); + + // if (int.TryParse(rawKey, out key)) + // return true; + // } + // } + // key = 0; + // return false; + //} + + private static string GetNavigation(ODataPath odataPath, int segmentIndex) + { + if (odataPath.Segments.Count > segmentIndex) + { + var navigationProperty = (odataPath.Segments[segmentIndex] as NavigationPathSegment).NavigationPropertyName; + return navigationProperty; + } + + return null; + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/Services/WebApiCatalogSearchQueryModelBinder.cs b/src/Plugins/SmartStore.WebApi/Services/WebApiCatalogSearchQueryModelBinder.cs index eef56d904f..bfb5d05f73 100644 --- a/src/Plugins/SmartStore.WebApi/Services/WebApiCatalogSearchQueryModelBinder.cs +++ b/src/Plugins/SmartStore.WebApi/Services/WebApiCatalogSearchQueryModelBinder.cs @@ -4,12 +4,11 @@ using System.Web.Http.ModelBinding; using SmartStore.Services.Search; using SmartStore.Services.Search.Modelling; -using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.Caching; namespace SmartStore.WebApi.Services { - public class WebApiCatalogSearchQueryModelBinder : IModelBinder + public class WebApiCatalogSearchQueryModelBinder : IModelBinder { private CatalogSearchQuery NormalizeQuery(CatalogSearchQuery query) { @@ -32,7 +31,7 @@ public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindi } var dependencyScope = actionContext.Request.GetDependencyScope(); - var factory = dependencyScope.GetService(); + var factory = (ICatalogSearchQueryFactory)dependencyScope.GetService(typeof(ICatalogSearchQueryFactory)); if (factory.Current != null) { diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index b993a6b15d..f2fe3a6b8f 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -280,6 +280,7 @@ + diff --git a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs index 653856adb7..4a1bed9ab8 100644 --- a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs +++ b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs @@ -21,6 +21,7 @@ using SmartStore.Services.Media; using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.Configuration; +using SmartStore.WebApi.Services; using SmartStore.WebApi.Services.Swagger; using Swashbuckle.Application; @@ -96,6 +97,9 @@ public void Configure(WebApiConfigurationBroadcaster configData) Controllers.OData.ProductsController.Init(configData); Controllers.OData.MediaController.Init(configData); + // Custom routing convention. + configData.RoutingConventions.Insert(0, new CustomRoutingConvention()); + // Swagger integration, see http://www.my-store.com/swagger/ui/index var thisAssembly = typeof(WebApiConfigurationProvider).Assembly; var pluginFinder = configData.Configuration.DependencyResolver.GetService(typeof(IPluginFinder)) as IPluginFinder; diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index 7dbe2a97db..3d5f388106 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -462,6 +462,8 @@ + + @@ -470,7 +472,6 @@ - diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs new file mode 100644 index 0000000000..a48d6ed651 --- /dev/null +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs @@ -0,0 +1,86 @@ +using System; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using System.Web.Http; + +namespace SmartStore.Web.Framework.WebApi +{ + public static class ApiControllerExtensions + { + public static HttpResponseException InvalidModelStateException(this ApiController apiController) + { + return new HttpResponseException(apiController.Request.CreateErrorResponse(HttpStatusCode.BadRequest, apiController.ModelState)); + } + + /// + /// Further entity processing typically used by OData actions. + /// + /// Action for entity processing. + public static void ProcessEntity(this ApiController apiController, Action process) + { + if (!apiController.ModelState.IsValid) + { + throw apiController.InvalidModelStateException(); + } + + try + { + process(); + } + catch (HttpResponseException hrEx) + { + throw hrEx; + } + catch (Exception ex) + { + throw apiController.Request.UnprocessableEntityException(ex.Message); + } + } + + public static async Task ProcessEntityAsync(this ApiController apiController, Func process) + { + if (!apiController.ModelState.IsValid) + { + throw apiController.InvalidModelStateException(); + } + + try + { + await process(); + } + catch (HttpResponseException hrEx) + { + throw hrEx; + } + catch (Exception ex) + { + throw apiController.Request.UnprocessableEntityException(ex.Message); + } + } + + /// + /// Gets a query string value from API request URL. + /// + /// Value type. + /// API controller. + /// Name of the query string value. + /// Default value. + /// Query string value. + public static T GetQueryStringValue(this ApiController apiController, string name, T defaultValue = default) + { + Guard.NotEmpty(name, nameof(name)); + + var queries = apiController?.Request?.RequestUri?.ParseQueryString(); + + if (queries?.AllKeys?.Contains(name) ?? false) + { + return queries[name].Convert(defaultValue, CultureInfo.InvariantCulture); + } + + return defaultValue; + } + } +} diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs new file mode 100644 index 0000000000..9467caa675 --- /dev/null +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs @@ -0,0 +1,58 @@ +using System; +using System.Linq.Expressions; +using System.Net; +using System.Net.Http; +using System.Reflection; +using System.Web.Http; + +namespace SmartStore.Web.Framework.WebApi +{ + public static class HttpRequestMessageExtensions + { + private static MethodInfo _createResponse = InitCreateResponse(); + + private static MethodInfo InitCreateResponse() + { + Expression> expr = (request) => request.CreateResponse(HttpStatusCode.OK, default(object)); + + return (expr.Body as MethodCallExpression).Method.GetGenericMethodDefinition(); + } + + /// https://gist.github.com/raghuramn/5084608 + public static HttpResponseMessage CreateResponse(this HttpRequestMessage request, HttpStatusCode status, Type type, object value) + { + return _createResponse.MakeGenericMethod(type).Invoke(null, new[] { request, status, value }) as HttpResponseMessage; + } + + public static HttpResponseMessage CreateResponseForEntity(this HttpRequestMessage request, object entity, int key) + { + if (entity == null) + { + return request.CreateResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } + + return request.CreateResponse(HttpStatusCode.OK, entity.GetType(), entity); + } + + public static HttpResponseException BadRequestException(this HttpRequestMessage request, string message) + { + return new HttpResponseException(request.CreateErrorResponse(HttpStatusCode.BadRequest, message)); + } + + public static HttpResponseException UnprocessableEntityException(this HttpRequestMessage request, string message) + { + return new HttpResponseException(request.CreateErrorResponse((HttpStatusCode)422, message)); + } + + public static HttpResponseException NotFoundException(this HttpRequestMessage request, string message) + { + return new HttpResponseException(request.CreateErrorResponse(HttpStatusCode.NotFound, message)); + } + + public static HttpResponseException InternalServerErrorException(this HttpRequestMessage request, Exception ex) + { + return new HttpResponseException(request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); + } + + } +} diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Security/WebApiAuthenticateAttribute.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Security/WebApiAuthenticateAttribute.cs index 61f78fe25f..5ca22de7de 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/Security/WebApiAuthenticateAttribute.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Security/WebApiAuthenticateAttribute.cs @@ -51,7 +51,7 @@ protected virtual bool HasPermission(IDependencyScope dependencyScope, Customer { try { - var permissionService = dependencyScope.GetService(); + var permissionService = (IPermissionService)dependencyScope.GetService(typeof(IPermissionService)); result = permissionService.Authorize(Permission, customer); } catch { } @@ -64,8 +64,8 @@ protected virtual void LogUnauthorized(HttpActionContext actionContext, IDepende { try { - var localization = dependencyScope.GetService(); - var loggerFactory = dependencyScope.GetService(); + var localization = (ILocalizationService)dependencyScope.GetService(typeof(ILocalizationService)); + var loggerFactory = (ILoggerFactory)dependencyScope.GetService(typeof(ILoggerFactory)); var logger = loggerFactory.GetLogger(this.GetType()); var strResult = result.ToString(); @@ -88,7 +88,7 @@ protected virtual Customer GetCustomer(IDependencyScope dependencyScope, int cus try { - var customerService = dependencyScope.GetService(); + var customerService = (ICustomerService)dependencyScope.GetService(typeof(ICustomerService)); customer = customerService.GetCustomerById(customerId); } catch (Exception ex) diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index 8e17b53554..3f164e0760 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -83,7 +83,7 @@ protected internal virtual IQueryable GetExpandedEntitySet(string prope protected internal virtual TEntity GetEntityByKeyNotNull(int key) { if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); + throw this.InvalidModelStateException(); var entity = this.Repository.GetById(key); @@ -97,7 +97,7 @@ protected internal virtual SingleResult GetSingleResult(int key) { if (!ModelState.IsValid) { - throw this.ExceptionInvalidModelState(); + throw this.InvalidModelStateException(); } var entity = GetEntitySet().FirstOrDefault(x => x.Id == key); @@ -114,7 +114,7 @@ protected internal virtual SingleResult GetSingleResult(TEntity entity) protected internal virtual TEntity GetExpandedEntity(int key, Expression> path) { if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); + throw this.InvalidModelStateException(); var query = GetExpandedEntitySet(path); @@ -129,7 +129,7 @@ protected internal virtual TEntity GetExpandedEntity(int key, Express protected internal virtual TEntity GetExpandedEntity(int key, string properties) { if (!ModelState.IsValid) - throw this.ExceptionInvalidModelState(); + throw this.InvalidModelStateException(); var query = GetExpandedEntitySet(properties); @@ -188,7 +188,7 @@ protected internal virtual IQueryable GetRelatedCollection> expr = (request) => request.CreateResponse(HttpStatusCode.OK, default(object)); - - return (expr.Body as MethodCallExpression).Method.GetGenericMethodDefinition(); - } - - /// https://gist.github.com/raghuramn/5084608 - public static HttpResponseMessage CreateResponse(this HttpRequestMessage request, HttpStatusCode status, Type type, object value) - { - return _createResponse.MakeGenericMethod(type).Invoke(null, new[] { request, status, value }) as HttpResponseMessage; - } - public static HttpResponseMessage CreateResponseForEntity(this HttpRequestMessage request, object entity, int key) - { - if (entity == null) - { - return request.CreateResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - } - - return request.CreateResponse(HttpStatusCode.OK, entity.GetType(), entity); - } - - public static HttpResponseException ExceptionInvalidModelState(this ApiController apiController) - { - return new HttpResponseException(apiController.Request.CreateErrorResponse(HttpStatusCode.BadRequest, apiController.ModelState)); - } - public static HttpResponseException ExceptionBadRequest(this ApiController apiController, string message) - { - return new HttpResponseException(apiController.Request.CreateErrorResponse(HttpStatusCode.BadRequest, message)); - } - public static HttpResponseException ExceptionUnprocessableEntity(this ApiController apiController, string message) - { - return new HttpResponseException(apiController.Request.CreateErrorResponse((HttpStatusCode)422, message)); - } - public static HttpResponseException ExceptionNotImplemented(this ApiController apiController) - { - return new HttpResponseException(HttpStatusCode.NotImplemented); - } - public static HttpResponseException ExceptionForbidden(this ApiController apiController) - { - return new HttpResponseException(HttpStatusCode.Forbidden); - } - public static HttpResponseException ExceptionForbidden(this ApiController apiController, string message) - { - return new HttpResponseException(apiController.Request.CreateErrorResponse(HttpStatusCode.Forbidden, message)); - } - public static HttpResponseException ExceptionUnsupportedMediaType(this ApiController apiController) - { - return new HttpResponseException(HttpStatusCode.UnsupportedMediaType); - } - public static HttpResponseException ExceptionNotFound(this ApiController apiController, string message) - { - return new HttpResponseException(apiController.Request.CreateErrorResponse(HttpStatusCode.NotFound, message)); - } - public static HttpResponseException ExceptionInternalServerError(this ApiController apiController, Exception ex) - { - return new HttpResponseException(apiController.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); - } - - /// - /// Further entity processing typically used by OData actions. - /// - /// Action for entity processing. - public static void ProcessEntity(this ApiController apiController, Action process) - { - if (!apiController.ModelState.IsValid) - { - throw apiController.ExceptionInvalidModelState(); - } - - try - { - process(); - } - catch (HttpResponseException hrEx) - { - throw hrEx; - } - catch (Exception ex) - { - throw apiController.ExceptionUnprocessableEntity(ex.Message); - } - } - - public static async Task ProcessEntityAsync(this ApiController apiController, Func process) - { - if (!apiController.ModelState.IsValid) - { - throw apiController.ExceptionInvalidModelState(); - } - - try - { - await process(); - } - catch (HttpResponseException hrEx) - { - throw hrEx; - } - catch (Exception ex) - { - throw apiController.ExceptionUnprocessableEntity(ex.Message); - } - } - - /// - /// Gets a query string value from API request URL. - /// - /// Value type. - /// API controller. - /// Name of the query string value. - /// Default value. - /// Query string value. - public static T GetQueryStringValue(this ApiController apiController, string name, T defaultValue = default) - { - Guard.NotEmpty(name, nameof(name)); - - var queries = apiController?.Request?.RequestUri?.ParseQueryString(); - - if (queries?.AllKeys?.Contains(name) ?? false) - { - return queries[name].Convert(defaultValue, CultureInfo.InvariantCulture); - } - - return defaultValue; - } - - // public static bool GetNormalizedKey(this ODataPath odataPath, int segmentIndex, out int key) - //{ - // if (odataPath.Segments.Count > segmentIndex) - // { - // string rawKey = (odataPath.Segments[segmentIndex] as KeyValuePathSegment).Value; - // if (rawKey.HasValue()) - // { - // if (rawKey.StartsWith("'")) - // rawKey = rawKey.Substring(1, rawKey.Length - 2); - - // if (int.TryParse(rawKey, out key)) - // return true; - // } - // } - // key = 0; - // return false; - //} - - //public static string GetNavigation(this ODataPath odataPath, int segmentIndex) - //{ - // if (odataPath.Segments.Count > segmentIndex) - // { - // string navigationProperty = (odataPath.Segments[segmentIndex] as NavigationPathSegment).NavigationPropertyName; - - // return navigationProperty; - // } - // return null; - //} - - public static void DeleteLocalFiles(this MultipartFormDataStreamProvider provider) - { - try - { - foreach (var file in provider.FileData) - { - FileSystemHelper.DeleteFile(file.LocalFileName); - } - } - catch { } - } - - public static T GetService(this IDependencyScope dependencyScope) - { - return (T)dependencyScope.GetService(typeof(T)); - } - } -} From e7db3c417f83969106b5b828a5dccbc01ca38a24 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Mon, 10 Aug 2020 22:07:22 +0200 Subject: [PATCH 023/695] Updated UAParser package to v3.1.44 --- .../Common/UAParserUserAgent.cs | 7 +- .../SmartStore.Services.csproj | 5 +- .../SmartStore.Services/packages.config | 2 +- .../App_Data/ua-parser.regexes.yaml | 5587 ----------------- .../SmartStore.Web/SmartStore.Web.csproj | 1 - 5 files changed, 8 insertions(+), 5594 deletions(-) delete mode 100644 src/Presentation/SmartStore.Web/App_Data/ua-parser.regexes.yaml diff --git a/src/Libraries/SmartStore.Services/Common/UAParserUserAgent.cs b/src/Libraries/SmartStore.Services/Common/UAParserUserAgent.cs index 03f767cc9d..f83db41703 100644 --- a/src/Libraries/SmartStore.Services/Common/UAParserUserAgent.cs +++ b/src/Libraries/SmartStore.Services/Common/UAParserUserAgent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Text.RegularExpressions; using System.Web; using SmartStore.Utilities; @@ -118,8 +119,10 @@ public class UAParserUserAgent : IUserAgent static UAParserUserAgent() { - //s_uap = uap.Parser.GetDefault(); - s_uap = uap.Parser.FromYamlFile(CommonHelper.MapPath("~/App_Data/ua-parser.regexes.yaml")); + var path = CommonHelper.MapPath("~/App_Data/UAParser.regexes.yaml"); + s_uap = File.Exists(path) + ? uap.Parser.FromYaml(path) + : uap.Parser.GetDefault(); } public UAParserUserAgent(HttpContextBase httpContext) diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 503fe52789..a7e54c6e61 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -168,9 +168,8 @@ - - ..\..\packages\UAParser.2.1.0.0\lib\net40-Client\UAParser.dll - True + + ..\..\packages\UAParser.3.1.44\lib\net45\UAParser.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index 9218c41be9..0b21ff4a14 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -22,5 +22,5 @@ - + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/App_Data/ua-parser.regexes.yaml b/src/Presentation/SmartStore.Web/App_Data/ua-parser.regexes.yaml deleted file mode 100644 index e7ca02b055..0000000000 --- a/src/Presentation/SmartStore.Web/App_Data/ua-parser.regexes.yaml +++ /dev/null @@ -1,5587 +0,0 @@ -user_agent_parsers: - #### SPECIAL CASES TOP #### - - # ESRI Server products - - regex: '(GeoEvent Server) (\d+)(?:\.(\d+)(?:\.(\d+)|)|)' - - # ESRI ArcGIS Desktop Products - - regex: '(ArcGIS Pro)(?: (\d+)\.(\d+)\.([^ ]+)|)' - - - regex: 'ArcGIS Client Using WinInet' - family_replacement: 'ArcMap' - - - regex: '(OperationsDashboard)-(?:Windows)-(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Operations Dashboard for ArcGIS' - - - regex: '(arcgisearth)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'ArcGIS Earth' - - - regex: 'com.esri.(earth).phone/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'ArcGIS Earth' - - # ESRI ArcGIS Mobile Products - - regex: '(arcgis-explorer)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Explorer for ArcGIS' - - - regex: 'arcgis-(collector|aurora)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Collector for ArcGIS' - - - regex: '(arcgis-workforce)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Workforce for ArcGIS' - - - regex: '(Collector|Explorer|Workforce)-(?:Android|iOS)-(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: '$1 for ArcGIS' - - - regex: '(Explorer|Collector)/(\d+) CFNetwork' - family_replacement: '$1 for ArcGIS' - - # ESRI ArcGIS Runtimes - - regex: 'ArcGISRuntime-(Android|iOS|NET|Qt)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'ArcGIS Runtime SDK for $1' - - - regex: 'ArcGIS\.?(iOS|Android|NET|Qt)(?:-|\.)(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'ArcGIS Runtime SDK for $1' - - - regex: 'ArcGIS\.Runtime\.(Qt)\.(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'ArcGIS Runtime SDK for $1' - - # CFNetwork Podcast catcher Applications - - regex: '^(Luminary)[Stage]+/(\d+) CFNetwork' - - regex: '(ESPN)[%20| ]+Radio/(\d+)\.(\d+)\.(\d+) CFNetwork' - - regex: '(Antenna)/(\d+) CFNetwork' - family_replacement: 'AntennaPod' - - regex: '(TopPodcasts)Pro/(\d+) CFNetwork' - - regex: '(MusicDownloader)Lite/(\d+)\.(\d+)\.(\d+) CFNetwork' - - regex: '^(.*)-iPad\/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|) CFNetwork' - - regex: '^(.*)-iPhone/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|) CFNetwork' - - regex: '^(.*)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|) CFNetwork' - - # Podcast catchers - - regex: '^(Luminary)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - - regex: '(espn\.go)' - family_replacement: 'ESPN' - - regex: '(espnradio\.com)' - family_replacement: 'ESPN' - - regex: 'ESPN APP$' - family_replacement: 'ESPN' - - regex: '(audioboom\.com)' - family_replacement: 'AudioBoom' - - regex: ' (Rivo) RHYTHM' - - # @note: iOS / OSX Applications - - regex: '(CFNetwork)(?:/(\d+)\.(\d+)(?:\.(\d+)|)|)' - family_replacement: 'CFNetwork' - - # Pingdom - - regex: '(Pingdom\.com_bot_version_)(\d+)\.(\d+)' - family_replacement: 'PingdomBot' - # 'Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PingdomTMS/0.8.5 Safari/534.34' - - regex: '(PingdomTMS)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'PingdomBot' - - # PTST / WebPageTest.org crawlers - - regex: ' (PTST)/(\d+)(?:\.(\d+)|)$' - family_replacement: 'WebPageTest.org bot' - - # Datanyze.com spider - - regex: 'X11; (Datanyze); Linux' - - # New Relic Pinger - - regex: '(NewRelicPinger)/(\d+)\.(\d+)' - family_replacement: 'NewRelicPingerBot' - - # Tableau - - regex: '(Tableau)/(\d+)\.(\d+)' - family_replacement: 'Tableau' - - # Adobe CreativeCloud - - regex: 'AppleWebKit/\d+\.\d+.* Safari.* (CreativeCloud)/(\d+)\.(\d+).(\d+)' - family_replacement: 'Adobe CreativeCloud' - - # Salesforce - - regex: '(Salesforce)(?:.)\/(\d+)\.(\d?)' - - #StatusCake - - regex: '(\(StatusCake\))' - family_replacement: 'StatusCakeBot' - - # Facebook - - regex: '(facebookexternalhit)/(\d+)\.(\d+)' - family_replacement: 'FacebookBot' - - # Google Plus - - regex: 'Google.*/\+/web/snippet' - family_replacement: 'GooglePlusBot' - - # Gmail - - regex: 'via ggpht\.com GoogleImageProxy' - family_replacement: 'GmailImageProxy' - - # Yahoo - - regex: 'YahooMailProxy; https://help\.yahoo\.com/kb/yahoo-mail-proxy-SLN28749\.html' - family_replacement: 'YahooMailProxy' - - # Twitter - - regex: '(Twitterbot)/(\d+)\.(\d+)' - family_replacement: 'Twitterbot' - - # Bots Pattern 'name/0.0.0' - - regex: '/((?:Ant-|)Nutch|[A-z]+[Bb]ot|[A-z]+[Ss]pider|Axtaris|fetchurl|Isara|ShopSalad|Tailsweep)[ \-](\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - # Bots Pattern 'name/0.0.0' - - regex: '\b(008|Altresium|Argus|BaiduMobaider|BoardReader|DNSGroup|DataparkSearch|EDI|Goodzer|Grub|INGRID|Infohelfer|LinkedInBot|LOOQ|Nutch|OgScrper|PathDefender|Peew|PostPost|Steeler|Twitterbot|VSE|WebCrunch|WebZIP|Y!J-BR[A-Z]|YahooSeeker|envolk|sproose|wminer)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - - # MSIECrawler - - regex: '(MSIE) (\d+)\.(\d+)([a-z]\d|[a-z]|);.* MSIECrawler' - family_replacement: 'MSIECrawler' - - # DAVdroid - - regex: '(DAVdroid)/(\d+)\.(\d+)(?:\.(\d+)|)' - - # Downloader ... - - regex: '(Google-HTTP-Java-Client|Apache-HttpClient|Go-http-client|scalaj-http|http%20client|Python-urllib|HttpMonitor|TLSProber|WinHTTP|JNLP|okhttp|aihttp|reqwest|axios|unirest-(?:java|python|ruby|nodejs|php|net))(?:[ /](\d+)(?:\.(\d+)|)(?:\.(\d+)|)|)' - - # Pinterestbot - - regex: '(Pinterest(?:bot|))/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)[;\s(]+\+https://www.pinterest.com/bot.html' - family_replacement: 'Pinterestbot' - - # Bots - - regex: '(CSimpleSpider|Cityreview Robot|CrawlDaddy|CrawlFire|Finderbots|Index crawler|Job Roboter|KiwiStatus Spider|Lijit Crawler|QuerySeekerSpider|ScollSpider|Trends Crawler|USyd-NLP-Spider|SiteCat Webbot|BotName\/\$BotVersion|123metaspider-Bot|1470\.net crawler|50\.nu|8bo Crawler Bot|Aboundex|Accoona-[A-z]{1,30}-Agent|AdsBot-Google(?:-[a-z]{1,30}|)|altavista|AppEngine-Google|archive.{0,30}\.org_bot|archiver|Ask Jeeves|[Bb]ai[Dd]u[Ss]pider(?:-[A-Za-z]{1,30})(?:-[A-Za-z]{1,30}|)|bingbot|BingPreview|blitzbot|BlogBridge|Bloglovin|BoardReader Blog Indexer|BoardReader Favicon Fetcher|boitho.com-dc|BotSeer|BUbiNG|\b\w{0,30}favicon\w{0,30}\b|\bYeti(?:-[a-z]{1,30}|)|Catchpoint(?: bot|)|[Cc]harlotte|Checklinks|clumboot|Comodo HTTP\(S\) Crawler|Comodo-Webinspector-Crawler|ConveraCrawler|CRAWL-E|CrawlConvera|Daumoa(?:-feedfetcher|)|Feed Seeker Bot|Feedbin|findlinks|Flamingo_SearchEngine|FollowSite Bot|furlbot|Genieo|gigabot|GomezAgent|gonzo1|(?:[a-zA-Z]{1,30}-|)Googlebot(?:-[a-zA-Z]{1,30}|)|Google SketchUp|grub-client|gsa-crawler|heritrix|HiddenMarket|holmes|HooWWWer|htdig|ia_archiver|ICC-Crawler|Icarus6j|ichiro(?:/mobile|)|IconSurf|IlTrovatore(?:-Setaccio|)|InfuzApp|Innovazion Crawler|InternetArchive|IP2[a-z]{1,30}Bot|jbot\b|KaloogaBot|Kraken|Kurzor|larbin|LEIA|LesnikBot|Linguee Bot|LinkAider|LinkedInBot|Lite Bot|Llaut|lycos|Mail\.RU_Bot|masscan|masidani_bot|Mediapartners-Google|Microsoft .{0,30} Bot|mogimogi|mozDex|MJ12bot|msnbot(?:-media {0,2}|)|msrbot|Mtps Feed Aggregation System|netresearch|Netvibes|NewsGator[^/]{0,30}|^NING|Nutch[^/]{0,30}|Nymesis|ObjectsSearch|OgScrper|Orbiter|OOZBOT|PagePeeker|PagesInventory|PaxleFramework|Peeplo Screenshot Bot|PlantyNet_WebRobot|Pompos|Qwantify|Read%20Later|Reaper|RedCarpet|Retreiver|Riddler|Rival IQ|scooter|Scrapy|Scrubby|searchsight|seekbot|semanticdiscovery|SemrushBot|Simpy|SimplePie|SEOstats|SimpleRSS|SiteCon|Slackbot-LinkExpanding|Slack-ImgProxy|Slurp|snappy|Speedy Spider|Squrl Java|Stringer|TheUsefulbot|ThumbShotsBot|Thumbshots\.ru|Tiny Tiny RSS|Twitterbot|WhatsApp|URL2PNG|Vagabondo|VoilaBot|^vortex|Votay bot|^voyager|WASALive.Bot|Web-sniffer|WebThumb|WeSEE:[A-z]{1,30}|WhatWeb|WIRE|WordPress|Wotbox|www\.almaden\.ibm\.com|Xenu(?:.s|) Link Sleuth|Xerka [A-z]{1,30}Bot|yacy(?:bot|)|YahooSeeker|Yahoo! Slurp|Yandex\w{1,30}|YodaoBot(?:-[A-z]{1,30}|)|YottaaMonitor|Yowedo|^Zao|^Zao-Crawler|ZeBot_www\.ze\.bz|ZooShot|ZyBorg|ArcGIS Hub Indexer)(?:[ /]v?(\d+)(?:\.(\d+)(?:\.(\d+)|)|)|)' - - # AWS S3 Clients - # must come before "Bots General matcher" to catch "boto"/"boto3" before "bot" - - regex: '\b(Boto3?|JetS3t|aws-(?:cli|sdk-(?:cpp|go|java|nodejs|ruby2?|dotnet-(?:\d{1,2}|core)))|s3fs)/(\d+)\.(\d+)(?:\.(\d+)|)' - - # SAFE FME - - regex: '(FME)\/(\d+\.\d+)\.(\d+)\.(\d+)' - - # QGIS - - regex: '(QGIS)\/(\d)\.?0?(\d{1,2})\.?0?(\d{1,2})' - - # JOSM - - regex: '(JOSM)/(\d+)\.(\d+)' - - # Tygron Platform - - regex: '(Tygron Platform) \((\d+)\.(\d+)\.(\d+(?:\.\d+| RC \d+\.\d+))' - - # Facebook - # Must come before "Bots General matcher" to catch OrangeBotswana - # Facebook Messenger must go before Facebook - - regex: '\[(FBAN/MessengerForiOS|FB_IAB/MESSENGER);FBAV/(\d+)(?:\.(\d+)(?:\.(\d+)|)|)' - family_replacement: 'Facebook Messenger' - # Facebook - - regex: '\[FB.*;(FBAV)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - family_replacement: 'Facebook' - # Sometimes Facebook does not specify a version (FBAV) - - regex: '\[FB.*;' - family_replacement: 'Facebook' - - # Bots General matcher 'name/0.0' - - regex: '(?:\/[A-Za-z0-9\.]+|) {0,5}([A-Za-z0-9 \-_\!\[\]:]{0,50}(?:[Aa]rchiver|[Ii]ndexer|[Ss]craper|[Bb]ot|[Ss]pider|[Cc]rawl[a-z]{0,50}))[/ ](\d+)(?:\.(\d+)(?:\.(\d+)|)|)' - # Bots containing bot(but not CUBOT) - - regex: '((?:[A-Za-z][A-Za-z0-9 -]{0,50}|)[^C][^Uu][Bb]ot)\b(?:(?:[ /]| v)(\d+)(?:\.(\d+)|)(?:\.(\d+)|)|)' - # Bots containing spider|scrape|Crawl - - regex: '((?:[A-z0-9]{1,50}|[A-z\-]{1,50} ?|)(?: the |)(?:[Ss][Pp][Ii][Dd][Ee][Rr]|[Ss]crape|[Cc][Rr][Aa][Ww][Ll])[A-z0-9]{0,50})(?:(?:[ /]| v)(\d+)(?:\.(\d+)|)(?:\.(\d+)|)|)' - - # HbbTV standard defines what features the browser should understand. - # but it's like targeting "HTML5 browsers", effective browser support depends on the model - # See os_parsers if you want to target a specific TV - - regex: '(HbbTV)/(\d+)\.(\d+)\.(\d+) \(' - - # must go before Firefox to catch Chimera/SeaMonkey/Camino/Waterfox - - regex: '(Chimera|SeaMonkey|Camino|Waterfox)/(\d+)\.(\d+)\.?([ab]?\d+[a-z]*|)' - - # must be before Firefox / Gecko to catch SailfishBrowser properly - - regex: '(SailfishBrowser)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Sailfish Browser' - - # Social Networks (non-Facebook) - # Pinterest - - regex: '\[(Pinterest)/[^\]]+\]' - - regex: '(Pinterest)(?: for Android(?: Tablet|)|)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - # Instagram app - - regex: 'Mozilla.*Mobile.*(Instagram).(\d+)\.(\d+)\.(\d+)' - # Flipboard app - - regex: 'Mozilla.*Mobile.*(Flipboard).(\d+)\.(\d+)\.(\d+)' - # Flipboard-briefing app - - regex: 'Mozilla.*Mobile.*(Flipboard-Briefing).(\d+)\.(\d+)\.(\d+)' - # Onefootball app - - regex: 'Mozilla.*Mobile.*(Onefootball)\/Android.(\d+)\.(\d+)\.(\d+)' - # Snapchat - - regex: '(Snapchat)\/(\d+)\.(\d+)\.(\d+)\.(\d+)' - # Twitter - - regex: '(Twitter for (?:iPhone|iPad)|TwitterAndroid)(?:\/(\d+)\.(\d+)|)' - family_replacement: 'Twitter' - - # aspiegel.com spider (owned by Huawei) - - regex: 'Mozilla.*Mobile.*AspiegelBot' - family_replacement: 'Spider' - brand_replacement: 'Spider' - model_replacement: 'Smartphone' - - - regex: 'AspiegelBot' - family_replacement: 'Spider' - brand_replacement: 'Spider' - model_replacement: 'Desktop' - - # Basilisk - - regex: '(Firefox)/(\d+)\.(\d+) Basilisk/(\d+)' - family_replacement: 'Basilisk' - - # Pale Moon - - regex: '(PaleMoon)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Pale Moon' - - # Firefox - - regex: '(Fennec)/(\d+)\.(\d+)\.?([ab]?\d+[a-z]*)' - family_replacement: 'Firefox Mobile' - - regex: '(Fennec)/(\d+)\.(\d+)(pre)' - family_replacement: 'Firefox Mobile' - - regex: '(Fennec)/(\d+)\.(\d+)' - family_replacement: 'Firefox Mobile' - - regex: '(?:Mobile|Tablet);.*(Firefox)/(\d+)\.(\d+)' - family_replacement: 'Firefox Mobile' - - regex: '(Namoroka|Shiretoko|Minefield)/(\d+)\.(\d+)\.(\d+(?:pre|))' - family_replacement: 'Firefox ($1)' - - regex: '(Firefox)/(\d+)\.(\d+)(a\d+[a-z]*)' - family_replacement: 'Firefox Alpha' - - regex: '(Firefox)/(\d+)\.(\d+)(b\d+[a-z]*)' - family_replacement: 'Firefox Beta' - - regex: '(Firefox)-(?:\d+\.\d+|)/(\d+)\.(\d+)(a\d+[a-z]*)' - family_replacement: 'Firefox Alpha' - - regex: '(Firefox)-(?:\d+\.\d+|)/(\d+)\.(\d+)(b\d+[a-z]*)' - family_replacement: 'Firefox Beta' - - regex: '(Namoroka|Shiretoko|Minefield)/(\d+)\.(\d+)([ab]\d+[a-z]*|)' - family_replacement: 'Firefox ($1)' - - regex: '(Firefox).*Tablet browser (\d+)\.(\d+)\.(\d+)' - family_replacement: 'MicroB' - - regex: '(MozillaDeveloperPreview)/(\d+)\.(\d+)([ab]\d+[a-z]*|)' - - regex: '(FxiOS)/(\d+)\.(\d+)(\.(\d+)|)(\.(\d+)|)' - family_replacement: 'Firefox iOS' - - # e.g.: Flock/2.0b2 - - regex: '(Flock)/(\d+)\.(\d+)(b\d+?)' - - # RockMelt - - regex: '(RockMelt)/(\d+)\.(\d+)\.(\d+)' - - # e.g.: Fennec/0.9pre - - regex: '(Navigator)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Netscape' - - - regex: '(Navigator)/(\d+)\.(\d+)([ab]\d+)' - family_replacement: 'Netscape' - - - regex: '(Netscape6)/(\d+)\.(\d+)\.?([ab]?\d+|)' - family_replacement: 'Netscape' - - - regex: '(MyIBrow)/(\d+)\.(\d+)' - family_replacement: 'My Internet Browser' - - # UC Browser - # we need check it before opera. In other case case UC Browser detected look like Opera Mini - - regex: '(UC? ?Browser|UCWEB|U3)[ /]?(\d+)\.(\d+)\.(\d+)' - family_replacement: 'UC Browser' - - # Opera will stop at 9.80 and hide the real version in the Version string. - # see: http://dev.opera.com/articles/view/opera-ua-string-changes/ - - regex: '(Opera Tablet).*Version/(\d+)\.(\d+)(?:\.(\d+)|)' - - regex: '(Opera Mini)(?:/att|)/?(\d+|)(?:\.(\d+)|)(?:\.(\d+)|)' - - regex: '(Opera)/.+Opera Mobi.+Version/(\d+)\.(\d+)' - family_replacement: 'Opera Mobile' - - regex: '(Opera)/(\d+)\.(\d+).+Opera Mobi' - family_replacement: 'Opera Mobile' - - regex: 'Opera Mobi.+(Opera)(?:/|\s+)(\d+)\.(\d+)' - family_replacement: 'Opera Mobile' - - regex: 'Opera Mobi' - family_replacement: 'Opera Mobile' - - regex: '(Opera)/9.80.*Version/(\d+)\.(\d+)(?:\.(\d+)|)' - - # Opera 14 for Android uses a WebKit render engine. - - regex: '(?:Mobile Safari).*(OPR)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Opera Mobile' - - # Opera >=15 for Desktop is similar to Chrome but includes an "OPR" Version string. - - regex: '(?:Chrome).*(OPR)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Opera' - - # Opera Coast - - regex: '(Coast)/(\d+).(\d+).(\d+)' - family_replacement: 'Opera Coast' - - # Opera Mini for iOS (from version 8.0.0) - - regex: '(OPiOS)/(\d+).(\d+).(\d+)' - family_replacement: 'Opera Mini' - - # Opera Neon - - regex: 'Chrome/.+( MMS)/(\d+).(\d+).(\d+)' - family_replacement: 'Opera Neon' - - # Palm WebOS looks a lot like Safari. - - regex: '(hpw|web)OS/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'webOS Browser' - - # LuaKit has no version info. - # http://luakit.org/projects/luakit/ - - regex: '(luakit)' - family_replacement: 'LuaKit' - - # Snowshoe - - regex: '(Snowshoe)/(\d+)\.(\d+).(\d+)' - - # Lightning (for Thunderbird) - # http://www.mozilla.org/projects/calendar/lightning/ - - regex: 'Gecko/\d+ (Lightning)/(\d+)\.(\d+)\.?((?:[ab]?\d+[a-z]*)|(?:\d*))' - - # Swiftfox - - regex: '(Firefox)/(\d+)\.(\d+)\.(\d+(?:pre|)) \(Swiftfox\)' - family_replacement: 'Swiftfox' - - regex: '(Firefox)/(\d+)\.(\d+)([ab]\d+[a-z]*|) \(Swiftfox\)' - family_replacement: 'Swiftfox' - - # Rekonq - - regex: '(rekonq)/(\d+)\.(\d+)(?:\.(\d+)|) Safari' - family_replacement: 'Rekonq' - - regex: 'rekonq' - family_replacement: 'Rekonq' - - # Conkeror lowercase/uppercase - # http://conkeror.org/ - - regex: '(conkeror|Conkeror)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Conkeror' - - # catches lower case konqueror - - regex: '(konqueror)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Konqueror' - - - regex: '(WeTab)-Browser' - - - regex: '(Comodo_Dragon)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Comodo Dragon' - - - regex: '(Symphony) (\d+).(\d+)' - - - regex: 'PLAYSTATION 3.+WebKit' - family_replacement: 'NetFront NX' - - regex: 'PLAYSTATION 3' - family_replacement: 'NetFront' - - regex: '(PlayStation Portable)' - family_replacement: 'NetFront' - - regex: '(PlayStation Vita)' - family_replacement: 'NetFront NX' - - - regex: 'AppleWebKit.+ (NX)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'NetFront NX' - - regex: '(Nintendo 3DS)' - family_replacement: 'NetFront NX' - - # Amazon Silk, should go before Safari and Chrome Mobile - - regex: '(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+)|)' - family_replacement: 'Amazon Silk' - - # @ref: http://www.puffinbrowser.com - - regex: '(Puffin)/(\d+)\.(\d+)(?:\.(\d+)|)' - - # Edge Mobile - - regex: 'Windows Phone .*(Edge)/(\d+)\.(\d+)' - family_replacement: 'Edge Mobile' - - regex: '(EdgiOS|EdgA)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Edge Mobile' - - # Samsung Internet (based on Chrome, but lacking some features) - - regex: '(SamsungBrowser)/(\d+)\.(\d+)' - family_replacement: 'Samsung Internet' - - # Seznam.cz browser (based on WebKit) - - regex: '(SznProhlizec)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Seznam prohlížeč' - - # Coc Coc browser, based on Chrome (used in Vietnam) - - regex: '(coc_coc_browser)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Coc Coc' - - # Baidu Browsers (desktop spoofs chrome & IE, explorer is mobile) - - regex: '(baidubrowser)[/\s](\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - family_replacement: 'Baidu Browser' - - regex: '(FlyFlow)/(\d+)\.(\d+)' - family_replacement: 'Baidu Explorer' - - # MxBrowser is Maxthon. Must go before Mobile Chrome for Android - - regex: '(MxBrowser)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Maxthon' - - # Crosswalk must go before Mobile Chrome for Android - - regex: '(Crosswalk)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - - # LINE https://line.me/en/ - # Must go before Mobile Chrome for Android - - regex: '(Line)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'LINE' - - # MiuiBrowser should got before Mobile Chrome for Android - - regex: '(MiuiBrowser)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'MiuiBrowser' - - # Mint Browser should got before Mobile Chrome for Android - - regex: '(Mint Browser)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Mint Browser' - - # TopBuzz Android must go before Chrome Mobile WebView - - regex: '(TopBuzz)/(\d+).(\d+).(\d+)' - family_replacement: 'TopBuzz' - - # Google Search App on Android, eg: - - regex: 'Mozilla.+Android.+(GSA)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Google' - - # QQ Browsers - - regex: '(MQQBrowser/Mini)(?:(\d+)(?:\.(\d+)|)(?:\.(\d+)|)|)' - family_replacement: 'QQ Browser Mini' - - regex: '(MQQBrowser)(?:/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)|)' - family_replacement: 'QQ Browser Mobile' - - regex: '(QQBrowser)(?:/(\d+)(?:\.(\d+)\.(\d+)(?:\.(\d+)|)|)|)' - family_replacement: 'QQ Browser' - - # Chrome Mobile - - regex: 'Version/.+(Chrome)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Chrome Mobile WebView' - - regex: '; wv\).+(Chrome)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Chrome Mobile WebView' - - regex: '(CrMo)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Chrome Mobile' - - regex: '(CriOS)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Chrome Mobile iOS' - - regex: '(Chrome)/(\d+)\.(\d+)\.(\d+)\.(\d+) Mobile(?:[ /]|$)' - family_replacement: 'Chrome Mobile' - - regex: ' Mobile .*(Chrome)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Chrome Mobile' - - # Chrome Frame must come before MSIE. - - regex: '(chromeframe)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Chrome Frame' - - # Tizen Browser (second case included in browser/major.minor regex) - - regex: '(SLP Browser)/(\d+)\.(\d+)' - family_replacement: 'Tizen Browser' - - # Sogou Explorer 2.X - - regex: '(SE 2\.X) MetaSr (\d+)\.(\d+)' - family_replacement: 'Sogou Explorer' - - # Rackspace Monitoring - - regex: '(Rackspace Monitoring)/(\d+)\.(\d+)' - family_replacement: 'RackspaceBot' - - # PRTG Network Monitoring - - regex: '(PRTG Network Monitor)' - - # PyAMF - - regex: '(PyAMF)/(\d+)\.(\d+)\.(\d+)' - - # Yandex Browser - - regex: '(YaBrowser)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Yandex Browser' - - # Mail.ru Amigo/Internet Browser (Chromium-based) - - regex: '(Chrome)/(\d+)\.(\d+)\.(\d+).* MRCHROME' - family_replacement: 'Mail.ru Chromium Browser' - - # AOL Browser (IE-based) - - regex: '(AOL) (\d+)\.(\d+); AOLBuild (\d+)' - - # Podcast catcher Applications using iTunes - - regex: '(PodCruncher|Downcast)[ /]?(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|)' - - # Box Notes https://www.box.com/resources/downloads - # Must be before Electron - - regex: ' (BoxNotes)/(\d+)\.(\d+)\.(\d+)' - - # Whale - - regex: '(Whale)/(\d+)\.(\d+)\.(\d+)\.(\d+) Mobile(?:[ /]|$)' - family_replacement: 'Whale' - - - regex: '(Whale)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Whale' - - # 1Password - - regex: '(1Password)/(\d+)\.(\d+)\.(\d+)' - - # Ghost - # @ref: http://www.ghost.org - - regex: '(Ghost)/(\d+)\.(\d+)\.(\d+)' - - #### END SPECIAL CASES TOP #### - - #### MAIN CASES - this catches > 50% of all browsers #### - - - # Slack desktop client (needs to be before Apple Mail, Electron, and Chrome as it gets wrongly detected on Mac OS otherwise) - - regex: '(Slack_SSB)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Slack Desktop Client' - - # HipChat provides a version on Mac, but not on Windows. - # Needs to be before Chrome on Windows, and AppleMail on Mac. - - regex: '(HipChat)/?(\d+|)' - family_replacement: 'HipChat Desktop Client' - - # Browser/major_version.minor_version.beta_version - - regex: '\b(MobileIron|FireWeb|Jasmine|ANTGalio|Midori|Fresco|Lobo|PaleMoon|Maxthon|Lynx|OmniWeb|Dillo|Camino|Demeter|Fluid|Fennec|Epiphany|Shiira|Sunrise|Spotify|Flock|Netscape|Lunascape|WebPilot|NetFront|Netfront|Konqueror|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|Opera Mini|iCab|NetNewsWire|ThunderBrowse|Iris|UP\.Browser|Bunjalloo|Google Earth|Raven for Mac|Openwave|MacOutlook|Electron|OktaMobile)/(\d+)\.(\d+)\.(\d+)' - - # Outlook 2007 - - regex: 'Microsoft Office Outlook 12\.\d+\.\d+|MSOffice 12' - family_replacement: 'Outlook' - v1_replacement: '2007' - - # Outlook 2010 - - regex: 'Microsoft Outlook 14\.\d+\.\d+|MSOffice 14' - family_replacement: 'Outlook' - v1_replacement: '2010' - - # Outlook 2013 - - regex: 'Microsoft Outlook 15\.\d+\.\d+' - family_replacement: 'Outlook' - v1_replacement: '2013' - - # Outlook 2016 - - regex: 'Microsoft Outlook (?:Mail )?16\.\d+\.\d+|MSOffice 16' - family_replacement: 'Outlook' - v1_replacement: '2016' - - # Word 2014 - - regex: 'Microsoft Office (Word) 2014' - - # Windows Live Mail - - regex: 'Outlook-Express\/7\.0.*' - family_replacement: 'Windows Live Mail' - - # Apple Air Mail - - regex: '(Airmail) (\d+)\.(\d+)(?:\.(\d+)|)' - - # Thunderbird - - regex: '(Thunderbird)/(\d+)\.(\d+)(?:\.(\d+(?:pre|))|)' - family_replacement: 'Thunderbird' - - # Postbox - - regex: '(Postbox)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Postbox' - - # Barca - - regex: '(Barca(?:Pro)?)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Barca' - - # Lotus Notes - - regex: '(Lotus-Notes)/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Lotus Notes' - - # Superhuman Mail Client - # @ref: https://www.superhuman.com - - regex: 'Superhuman' - family_replacement: 'Superhuman' - - # Vivaldi uses "Vivaldi" - - regex: '(Vivaldi)/(\d+)\.(\d+)\.(\d+)' - - # Edge/major_version.minor_version - # Edge with chromium Edg/major_version.minor_version.patch.minor_patch - - regex: '(Edge?)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)(?:\.(\d+)|)' - family_replacement: 'Edge' - - # Brave Browser https://brave.com/ - - regex: '(brave)/(\d+)\.(\d+)\.(\d+) Chrome' - family_replacement: 'Brave' - - # Iron Browser ~since version 50 - - regex: '(Chrome)/(\d+)\.(\d+)\.(\d+)[\d.]* Iron[^/]' - family_replacement: 'Iron' - - # Dolphin Browser - # @ref: http://www.dolphin.com - - regex: '\b(Dolphin)(?: |HDCN/|/INT\-)(\d+)\.(\d+)(?:\.(\d+)|)' - - # Headless Chrome - # https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md - - regex: '(HeadlessChrome)(?:/(\d+)\.(\d+)\.(\d+)|)' - - # Evolution Mail CardDav/CalDav integration - - regex: '(Evolution)/(\d+)\.(\d+)\.(\d+\.\d+)' - - # Roundcube Mail CardDav plugin - - regex: '(RCM CardDAV plugin)/(\d+)\.(\d+)\.(\d+(?:-dev|))' - - # Browser/major_version.minor_version - - regex: '(bingbot|Bolt|AdobeAIR|Jasmine|IceCat|Skyfire|Midori|Maxthon|Lynx|Arora|IBrowse|Dillo|Camino|Shiira|Fennec|Phoenix|Flock|Netscape|Lunascape|Epiphany|WebPilot|Opera Mini|Opera|NetFront|Netfront|Konqueror|Googlebot|SeaMonkey|Kazehakase|Vienna|Iceape|Iceweasel|IceWeasel|Iron|K-Meleon|Sleipnir|Galeon|GranParadiso|iCab|iTunes|MacAppStore|NetNewsWire|Space Bison|Stainless|Orca|Dolfin|BOLT|Minimo|Tizen Browser|Polaris|Abrowser|Planetweb|ICE Browser|mDolphin|qutebrowser|Otter|QupZilla|MailBar|kmail2|YahooMobileMail|ExchangeWebServices|ExchangeServicesClient|Dragon|Outlook-iOS-Android)/(\d+)\.(\d+)(?:\.(\d+)|)' - - # Chrome/Chromium/major_version.minor_version - - regex: '(Chromium|Chrome)/(\d+)\.(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - - ########## - # IE Mobile needs to happen before Android to catch cases such as: - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920)... - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920; ANZ821)... - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920; Orange)... - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920; Vodafone)... - ########## - - # IE Mobile - - regex: '(IEMobile)[ /](\d+)\.(\d+)' - family_replacement: 'IE Mobile' - - # Baca Berita App News Reader - - regex: '(BacaBerita App)\/(\d+)\.(\d+)\.(\d+)' - - # Podcast catchers - - regex: '^(bPod|Pocket Casts|Player FM)$' - - regex: '^(AlexaMediaPlayer|VLC)/(\d+)\.(\d+)\.([^.\s]+)' - - regex: '^(AntennaPod|WMPlayer|Zune|Podkicker|Radio|ExoPlayerDemo|Overcast|PocketTunes|NSPlayer|okhttp|DoggCatcher|QuickNews|QuickTime|Peapod|Podcasts|GoldenPod|VLC|Spotify|Miro|MediaGo|Juice|iPodder|gPodder|Banshee)/(\d+)\.(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - - regex: '^(Peapod|Liferea)/([^.\s]+)\.([^.\s]+|)\.?([^.\s]+|)' - - regex: '^(bPod|Player FM) BMID/(\S+)' - - regex: '^(Podcast ?Addict)/v(\d+) ' - - regex: '^(Podcast ?Addict) ' - family_replacement: 'PodcastAddict' - - regex: '(Replay) AV' - - regex: '(VOX) Music Player' - - regex: '(CITA) RSS Aggregator/(\d+)\.(\d+)' - - regex: '(Pocket Casts)$' - - regex: '(Player FM)$' - - regex: '(LG Player|Doppler|FancyMusic|MediaMonkey|Clementine) (\d+)\.(\d+)\.?([^.\s]+|)\.?([^.\s]+|)' - - regex: '(philpodder)/(\d+)\.(\d+)\.?([^.\s]+|)\.?([^.\s]+|)' - - regex: '(Player FM|Pocket Casts|DoggCatcher|Spotify|MediaMonkey|MediaGo|BashPodder)' - - regex: '(QuickTime)\.(\d+)\.(\d+)\.(\d+)' - - regex: '(Kinoma)(\d+)' - - regex: '(Fancy) Cloud Music (\d+)\.(\d+)' - family_replacement: 'FancyMusic' - - regex: 'EspnDownloadManager' - family_replacement: 'ESPN' - - regex: '(ESPN) Radio (\d+)\.(\d+)(?:\.(\d+)|) ?(?:rv:(\d+)|) ' - - regex: '(podracer|jPodder) v ?(\d+)\.(\d+)(?:\.(\d+)|)' - - regex: '(ZDM)/(\d+)\.(\d+)[; ]?' - - regex: '(Zune|BeyondPod) (\d+)(?:\.(\d+)|)[\);]' - - regex: '(WMPlayer)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - - regex: '^(Lavf)' - family_replacement: 'WMPlayer' - - regex: '^(RSSRadio)[ /]?(\d+|)' - - regex: '(RSS_Radio) (\d+)\.(\d+)' - family_replacement: 'RSSRadio' - - regex: '(Podkicker) \S+/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Podkicker' - - regex: '^(HTC) Streaming Player \S+ / \S+ / \S+ / (\d+)\.(\d+)(?:\.(\d+)|)' - - regex: '^(Stitcher)/iOS' - - regex: '^(Stitcher)/Android' - - regex: '^(VLC) .*version (\d+)\.(\d+)\.(\d+)' - - regex: ' (VLC) for' - - regex: '(vlc)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'VLC' - - regex: '^(foobar)\S+/([^.\s]+)\.([^.\s]+|)\.?([^.\s]+|)' - - regex: '^(Clementine)\S+ ([^.\s]+)\.([^.\s]+|)\.?([^.\s]+|)' - - regex: '(amarok)/([^.\s]+)\.([^.\s]+|)\.?([^.\s]+|)' - family_replacement: 'Amarok' - - regex: '(Custom)-Feed Reader' - - # Browser major_version.minor_version.beta_version (space instead of slash) - - regex: '(iRider|Crazy Browser|SkipStone|iCab|Lunascape|Sleipnir|Maemo Browser) (\d+)\.(\d+)\.(\d+)' - # Browser major_version.minor_version (space instead of slash) - - regex: '(iCab|Lunascape|Opera|Android|Jasmine|Polaris|Microsoft SkyDriveSync|The Bat!) (\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - - # Kindle WebKit - - regex: '(Kindle)/(\d+)\.(\d+)' - - # weird android UAs - - regex: '(Android) Donut' - v1_replacement: '1' - v2_replacement: '2' - - - regex: '(Android) Eclair' - v1_replacement: '2' - v2_replacement: '1' - - - regex: '(Android) Froyo' - v1_replacement: '2' - v2_replacement: '2' - - - regex: '(Android) Gingerbread' - v1_replacement: '2' - v2_replacement: '3' - - - regex: '(Android) Honeycomb' - v1_replacement: '3' - - # desktop mode - # http://www.anandtech.com/show/3982/windows-phone-7-review - - regex: '(MSIE) (\d+)\.(\d+).*XBLWP7' - family_replacement: 'IE Large Screen' - - # Nextcloud desktop sync client - - regex: '(Nextcloud)' - - # Generic mirall client - - regex: '(mirall)/(\d+)\.(\d+)\.(\d+)' - - # Nextcloud/Owncloud android client - - regex: '(ownCloud-android)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Owncloud' - - # Skype for Business - - regex: '(OC)/(\d+)\.(\d+)\.(\d+)\.(\d+) \(Skype for Business\)' - family_replacement: 'Skype' - - #### END MAIN CASES #### - - #### SPECIAL CASES #### - - regex: '(Obigo)InternetBrowser' - - regex: '(Obigo)\-Browser' - - regex: '(Obigo|OBIGO)[^\d]*(\d+)(?:.(\d+)|)' - family_replacement: 'Obigo' - - - regex: '(MAXTHON|Maxthon) (\d+)\.(\d+)' - family_replacement: 'Maxthon' - - regex: '(Maxthon|MyIE2|Uzbl|Shiira)' - v1_replacement: '0' - - - regex: '(BrowseX) \((\d+)\.(\d+)\.(\d+)' - - - regex: '(NCSA_Mosaic)/(\d+)\.(\d+)' - family_replacement: 'NCSA Mosaic' - - # Polaris/d.d is above - - regex: '(POLARIS)/(\d+)\.(\d+)' - family_replacement: 'Polaris' - - regex: '(Embider)/(\d+)\.(\d+)' - family_replacement: 'Polaris' - - - regex: '(BonEcho)/(\d+)\.(\d+)\.?([ab]?\d+|)' - family_replacement: 'Bon Echo' - - # topbuzz on IOS - - regex: '(TopBuzz) com.alex.NewsMaster/(\d+).(\d+).(\d+)' - family_replacement: 'TopBuzz' - - regex: '(TopBuzz) com.mobilesrepublic.newsrepublic/(\d+).(\d+).(\d+)' - family_replacement: 'TopBuzz' - - regex: '(TopBuzz) com.topbuzz.videoen/(\d+).(\d+).(\d+)' - family_replacement: 'TopBuzz' - - # @note: iOS / OSX Applications - - regex: '(iPod|iPhone|iPad).+GSA/(\d+)\.(\d+)\.(\d+)(?:\.(\d+)|) Mobile' - family_replacement: 'Google' - - regex: '(iPod|iPhone|iPad).+Version/(\d+)\.(\d+)(?:\.(\d+)|).*[ +]Safari' - family_replacement: 'Mobile Safari' - - regex: '(iPod|iPod touch|iPhone|iPad);.*CPU.*OS[ +](\d+)_(\d+)(?:_(\d+)|).* AppleNews\/\d+\.\d+\.\d+?' - family_replacement: 'Mobile Safari UI/WKWebView' - - regex: '(iPod|iPhone|iPad).+Version/(\d+)\.(\d+)(?:\.(\d+)|)' - family_replacement: 'Mobile Safari UI/WKWebView' - - regex: '(iPod|iPod touch|iPhone|iPad).* Safari' - family_replacement: 'Mobile Safari' - - regex: '(iPod|iPod touch|iPhone|iPad)' - family_replacement: 'Mobile Safari UI/WKWebView' - - regex: '(Watch)(\d+),(\d+)' - family_replacement: 'Apple $1 App' - - ########################## - # Outlook on iOS >= 2.62.0 - ########################## - - regex: '(Outlook-iOS)/\d+\.\d+\.prod\.iphone \((\d+)\.(\d+)\.(\d+)\)' - - - regex: '(AvantGo) (\d+).(\d+)' - - - regex: '(OneBrowser)/(\d+).(\d+)' - family_replacement: 'ONE Browser' - - - regex: '(Avant)' - v1_replacement: '1' - - # This is the Tesla Model S (see similar entry in device parsers) - - regex: '(QtCarBrowser)' - v1_replacement: '1' - - - regex: '^(iBrowser/Mini)(\d+).(\d+)' - family_replacement: 'iBrowser Mini' - - regex: '^(iBrowser|iRAPP)/(\d+).(\d+)' - - # nokia browsers - # based on: http://www.developer.nokia.com/Community/Wiki/User-Agent_headers_for_Nokia_devices - - regex: '^(Nokia)' - family_replacement: 'Nokia Services (WAP) Browser' - - regex: '(NokiaBrowser)/(\d+)\.(\d+).(\d+)\.(\d+)' - family_replacement: 'Nokia Browser' - - regex: '(NokiaBrowser)/(\d+)\.(\d+).(\d+)' - family_replacement: 'Nokia Browser' - - regex: '(NokiaBrowser)/(\d+)\.(\d+)' - family_replacement: 'Nokia Browser' - - regex: '(BrowserNG)/(\d+)\.(\d+).(\d+)' - family_replacement: 'Nokia Browser' - - regex: '(Series60)/5\.0' - family_replacement: 'Nokia Browser' - v1_replacement: '7' - v2_replacement: '0' - - regex: '(Series60)/(\d+)\.(\d+)' - family_replacement: 'Nokia OSS Browser' - - regex: '(S40OviBrowser)/(\d+)\.(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Ovi Browser' - - regex: '(Nokia)[EN]?(\d+)' - - # BlackBerry devices - - regex: '(PlayBook).+RIM Tablet OS (\d+)\.(\d+)\.(\d+)' - family_replacement: 'BlackBerry WebKit' - - regex: '(Black[bB]erry|BB10).+Version/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'BlackBerry WebKit' - - regex: '(Black[bB]erry)\s?(\d+)' - family_replacement: 'BlackBerry' - - - regex: '(OmniWeb)/v(\d+)\.(\d+)' - - - regex: '(Blazer)/(\d+)\.(\d+)' - family_replacement: 'Palm Blazer' - - - regex: '(Pre)/(\d+)\.(\d+)' - family_replacement: 'Palm Pre' - - # fork of Links - - regex: '(ELinks)/(\d+)\.(\d+)' - - regex: '(ELinks) \((\d+)\.(\d+)' - - regex: '(Links) \((\d+)\.(\d+)' - - - regex: '(QtWeb) Internet Browser/(\d+)\.(\d+)' - - #- regex: '\(iPad;.+(Version)/(\d+)\.(\d+)(?:\.(\d+)|).*Safari/' - # family_replacement: 'iPad' - - # Phantomjs, should go before Safari - - regex: '(PhantomJS)/(\d+)\.(\d+)\.(\d+)' - - # WebKit Nightly - - regex: '(AppleWebKit)/(\d+)(?:\.(\d+)|)\+ .* Safari' - family_replacement: 'WebKit Nightly' - - # Safari - - regex: '(Version)/(\d+)\.(\d+)(?:\.(\d+)|).*Safari/' - family_replacement: 'Safari' - # Safari didn't provide "Version/d.d.d" prior to 3.0 - - regex: '(Safari)/\d+' - - - regex: '(OLPC)/Update(\d+)\.(\d+)' - - - regex: '(OLPC)/Update()\.(\d+)' - v1_replacement: '0' - - - regex: '(SEMC\-Browser)/(\d+)\.(\d+)' - - - regex: '(Teleca)' - family_replacement: 'Teleca Browser' - - - regex: '(Phantom)/V(\d+)\.(\d+)' - family_replacement: 'Phantom Browser' - - - regex: '(Trident)/(7|8)\.(0)' - family_replacement: 'IE' - v1_replacement: '11' - - - regex: '(Trident)/(6)\.(0)' - family_replacement: 'IE' - v1_replacement: '10' - - - regex: '(Trident)/(5)\.(0)' - family_replacement: 'IE' - v1_replacement: '9' - - - regex: '(Trident)/(4)\.(0)' - family_replacement: 'IE' - v1_replacement: '8' - - # Espial - - regex: '(Espial)/(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - - # Apple Mail - - # apple mail - not directly detectable, have it after Safari stuff - - regex: '(AppleWebKit)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Apple Mail' - - # AFTER THE EDGE CASES ABOVE! - # AFTER IE11 - # BEFORE all other IE - - regex: '(Firefox)/(\d+)\.(\d+)\.(\d+)' - - regex: '(Firefox)/(\d+)\.(\d+)(pre|[ab]\d+[a-z]*|)' - - - regex: '([MS]?IE) (\d+)\.(\d+)' - family_replacement: 'IE' - - - regex: '(python-requests)/(\d+)\.(\d+)' - family_replacement: 'Python Requests' - - # headless user-agents - - regex: '\b(Windows-Update-Agent|WindowsPowerShell|Microsoft-CryptoAPI|SophosUpdateManager|SophosAgent|Debian APT-HTTP|Ubuntu APT-HTTP|libcurl-agent|libwww-perl|urlgrabber|curl|PycURL|Wget|wget2|aria2|Axel|OpenBSD ftp|lftp|jupdate|insomnia|fetch libfetch|akka-http|got)(?:[ /](\d+)(?:\.(\d+)|)(?:\.(\d+)|)|)' - - # Asynchronous HTTP Client/Server for asyncio and Python (https://aiohttp.readthedocs.io/) - - regex: '(Python/3\.\d{1,3} aiohttp)/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Python aiohttp' - - - regex: '(Java)[/ ]?\d+\.(\d+)\.(\d+)[_-]*([a-zA-Z0-9]+|)' - - # Cloud Storage Clients - - regex: '^(Cyberduck)/(\d+)\.(\d+)\.(\d+)(?:\.\d+|)' - - regex: '^(S3 Browser) (\d+)-(\d+)-(\d+)(?:\s*http://s3browser\.com|)' - - regex: '(S3Gof3r)' - # IBM COS (Cloud Object Storage) API - - regex: '\b(ibm-cos-sdk-(?:core|java|js|python))/(\d+)\.(\d+)(?:\.(\d+)|)' - # rusoto - Rusoto - AWS SDK for Rust - https://github.com/rusoto/rusoto - - regex: '^(rusoto)/(\d+)\.(\d+)\.(\d+)' - # rclone - rsync for cloud storage - https://rclone.org/ - - regex: '^(rclone)/v(\d+)\.(\d+)' - - # Roku Digital-Video-Players https://www.roku.com/ - - regex: '^(Roku)/DVP-(\d+)\.(\d+)' - - # Kurio App News Reader https://kurio.co.id/ - - regex: '(Kurio)\/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'Kurio App' - - # Box Drive and Box Sync https://www.box.com/resources/downloads - - regex: '^(Box(?: Sync)?)/(\d+)\.(\d+)\.(\d+)' - - # ViaFree streaming app https://www.viafree.{dk|se|no} - - regex: '^(ViaFree|Viafree)-(?:tvOS-)?[A-Z]{2}/(\d+)\.(\d+)\.(\d+)' - family_replacement: 'ViaFree' - -os_parsers: - ########## - # HbbTV vendors - ########## - - # starts with the easy one : Panasonic seems consistent across years, hope it will continue - #HbbTV/1.1.1 (;Panasonic;VIERA 2011;f.532;0071-0802 2000-0000;) - #HbbTV/1.1.1 (;Panasonic;VIERA 2012;1.261;0071-3103 2000-0000;) - #HbbTV/1.2.1 (;Panasonic;VIERA 2013;3.672;4101-0003 0002-0000;) - #- regex: 'HbbTV/\d+\.\d+\.\d+ \(;(Panasonic);VIERA ([0-9]{4});' - - # Sony is consistent too but do not place year like the other - # Opera/9.80 (Linux armv7l; HbbTV/1.1.1 (; Sony; KDL32W650A; PKG3.211EUA; 2013;); ) Presto/2.12.362 Version/12.11 - # Opera/9.80 (Linux mips; U; HbbTV/1.1.1 (; Sony; KDL40HX751; PKG1.902EUA; 2012;);; en) Presto/2.10.250 Version/11.60 - # Opera/9.80 (Linux mips; U; HbbTV/1.1.1 (; Sony; KDL22EX320; PKG4.017EUA; 2011;);; en) Presto/2.7.61 Version/11.00 - #- regex: 'HbbTV/\d+\.\d+\.\d+ \(; (Sony);.*;.*; ([0-9]{4});\)' - - - # LG is consistent too, but we need to add manually the year model - #Mozilla/5.0 (Unknown; Linux armv7l) AppleWebKit/537.1+ (KHTML, like Gecko) Safari/537.1+ HbbTV/1.1.1 ( ;LGE ;NetCast 4.0 ;03.20.30 ;1.0M ;) - #Mozilla/5.0 (DirectFB; Linux armv7l) AppleWebKit/534.26+ (KHTML, like Gecko) Version/5.0 Safari/534.26+ HbbTV/1.1.1 ( ;LGE ;NetCast 3.0 ;1.0 ;1.0M ;) - - regex: 'HbbTV/\d+\.\d+\.\d+ \( ;(LG)E ;NetCast 4.0' - os_v1_replacement: '2013' - - regex: 'HbbTV/\d+\.\d+\.\d+ \( ;(LG)E ;NetCast 3.0' - os_v1_replacement: '2012' - - # Samsung is on its way of normalizing their user-agent - # HbbTV/1.1.1 (;Samsung;SmartTV2013;T-FXPDEUC-1102.2;;) WebKit - # HbbTV/1.1.1 (;Samsung;SmartTV2013;T-MST12DEUC-1102.1;;) WebKit - # HbbTV/1.1.1 (;Samsung;SmartTV2012;;;) WebKit - # HbbTV/1.1.1 (;;;;;) Maple_2011 - - regex: 'HbbTV/1.1.1 \(;;;;;\) Maple_2011' - os_replacement: 'Samsung' - os_v1_replacement: '2011' - # manage the two models of 2013 - - regex: 'HbbTV/\d+\.\d+\.\d+ \(;(Samsung);SmartTV([0-9]{4});.*FXPDEUC' - os_v2_replacement: 'UE40F7000' - - regex: 'HbbTV/\d+\.\d+\.\d+ \(;(Samsung);SmartTV([0-9]{4});.*MST12DEUC' - os_v2_replacement: 'UE32F4500' - # generic Samsung (works starting in 2012) - #- regex: 'HbbTV/\d+\.\d+\.\d+ \(;(Samsung);SmartTV([0-9]{4});' - - # Philips : not found any other way than a manual mapping - # Opera/9.80 (Linux mips; U; HbbTV/1.1.1 (; Philips; ; ; ; ) CE-HTML/1.0 NETTV/4.1.3 PHILIPSTV/1.1.1; en) Presto/2.10.250 Version/11.60 - # Opera/9.80 (Linux mips ; U; HbbTV/1.1.1 (; Philips; ; ; ; ) CE-HTML/1.0 NETTV/3.2.1; en) Presto/2.6.33 Version/10.70 - - regex: 'HbbTV/1\.1\.1 \(; (Philips);.*NETTV/4' - os_v1_replacement: '2013' - - regex: 'HbbTV/1\.1\.1 \(; (Philips);.*NETTV/3' - os_v1_replacement: '2012' - - regex: 'HbbTV/1\.1\.1 \(; (Philips);.*NETTV/2' - os_v1_replacement: '2011' - - # the HbbTV emulator developers use HbbTV/1.1.1 (;;;;;) firetv-firefox-plugin 1.1.20 - - regex: 'HbbTV/\d+\.\d+\.\d+.*(firetv)-firefox-plugin (\d+).(\d+).(\d+)' - os_replacement: 'FireHbbTV' - - # generic HbbTV, hoping to catch manufacturer name (always after 2nd comma) and the first string that looks like a 2011-2019 year - - regex: 'HbbTV/\d+\.\d+\.\d+ \(.*; ?([a-zA-Z]+) ?;.*(201[1-9]).*\)' - - # aspiegel.com spider (owned by Huawei) - - regex: 'AspiegelBot' - os_replacement: 'Other' - - ########## - # @note: Windows Phone needs to come before Windows NT 6.1 *and* before Android to catch cases such as: - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920)... - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920; ANZ821)... - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920; Orange)... - # Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 920; Vodafone)... - ########## - - - regex: '(Windows Phone) (?:OS[ /])?(\d+)\.(\d+)' - - # Again a MS-special one: iPhone.*Outlook-iOS-Android/x.x is erroneously detected as Android - - regex: '(CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone)[ +]+(\d+)[_\.](\d+)(?:[_\.](\d+)|).*Outlook-iOS-Android' - os_replacement: 'iOS' - - # Special case for old ArcGIS Mobile products - - regex: 'ArcGIS\.?(iOS|Android)-\d+\.\d+(?:\.\d+|)(?:[^\/]+|)\/(\d+)(?:\.(\d+)(?:\.(\d+)|)|)' - - # Special case for new ArcGIS Mobile products - - regex: 'ArcGISRuntime-(?:Android|iOS)\/\d+\.\d+(?:\.\d+|) \((Android|iOS) (\d+)(?:\.(\d+)(?:\.(\d+)|)|);' - - ########## - # Android - # can actually detect rooted android os. do we care? - ########## - - regex: '(Android)[ \-/](\d+)(?:\.(\d+)|)(?:[.\-]([a-z0-9]+)|)' - - - regex: '(Android) Donut' - os_v1_replacement: '1' - os_v2_replacement: '2' - - - regex: '(Android) Eclair' - os_v1_replacement: '2' - os_v2_replacement: '1' - - - regex: '(Android) Froyo' - os_v1_replacement: '2' - os_v2_replacement: '2' - - - regex: '(Android) Gingerbread' - os_v1_replacement: '2' - os_v2_replacement: '3' - - - regex: '(Android) Honeycomb' - os_v1_replacement: '3' - - # Android 9; Android 10; - - regex: '(Android) (\d+);' - - # UCWEB - - regex: '^UCWEB.*; (Adr) (\d+)\.(\d+)(?:[.\-]([a-z0-9]+)|);' - os_replacement: 'Android' - - regex: '^UCWEB.*; (iPad|iPh|iPd) OS (\d+)_(\d+)(?:_(\d+)|);' - os_replacement: 'iOS' - - regex: '^UCWEB.*; (wds) (\d+)\.(\d+)(?:\.(\d+)|);' - os_replacement: 'Windows Phone' - # JUC - - regex: '^(JUC).*; ?U; ?(?:Android|)(\d+)\.(\d+)(?:[\.\-]([a-z0-9]+)|)' - os_replacement: 'Android' - - # Salesforce - - regex: '(android)\s(?:mobile\/)(\d+)(?:\.(\d+)(?:\.(\d+)|)|)' - os_replacement: 'Android' - - ########## - # Kindle Android - ########## - - regex: '(Silk-Accelerated=[a-z]{4,5})' - os_replacement: 'Android' - - # Citrix Chrome App on Chrome OS - # Note, this needs to come before the windows parsers as the app doesn't - # properly identify as Chrome OS - # - # ex: Mozilla/5.0 (X11; Windows aarch64 10718.88.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.118 Safari/537.36 CitrixChromeApp - - regex: '(x86_64|aarch64)\ (\d+)\.(\d+)\.(\d+).*Chrome.*(?:CitrixChromeApp)$' - os_replacement: 'Chrome OS' - - ########## - # Windows - # http://en.wikipedia.org/wiki/Windows_NT#Releases - # possibility of false positive when different marketing names share same NT kernel - # e.g. windows server 2003 and windows xp - # lots of ua strings have Windows NT 4.1 !?!?!?!? !?!? !? !????!?! !!! ??? !?!?! ? - # (very) roughly ordered in terms of frequency of occurence of regex (win xp currently most frequent, etc) - ########## - - # ie mobile desktop mode - # spoofs nt 6.1. must come before windows 7 - - regex: '(XBLWP7)' - os_replacement: 'Windows Phone' - - # @note: This needs to come before Windows NT 6.1 - - regex: '(Windows ?Mobile)' - os_replacement: 'Windows Mobile' - - - regex: '(Windows 10)' - os_replacement: 'Windows' - os_v1_replacement: '10' - - - regex: '(Windows (?:NT 5\.2|NT 5\.1))' - os_replacement: 'Windows' - os_v1_replacement: 'XP' - - - regex: '(Win(?:dows NT |32NT\/)6\.1)' - os_replacement: 'Windows' - os_v1_replacement: '7' - - - regex: '(Win(?:dows NT |32NT\/)6\.0)' - os_replacement: 'Windows' - os_v1_replacement: 'Vista' - - - regex: '(Win 9x 4\.90)' - os_replacement: 'Windows' - os_v1_replacement: 'ME' - - - regex: '(Windows NT 6\.2; ARM;)' - os_replacement: 'Windows' - os_v1_replacement: 'RT' - - - regex: '(Win(?:dows NT |32NT\/)6\.2)' - os_replacement: 'Windows' - os_v1_replacement: '8' - - - regex: '(Windows NT 6\.3; ARM;)' - os_replacement: 'Windows' - os_v1_replacement: 'RT 8' - os_v2_replacement: '1' - - - regex: '(Win(?:dows NT |32NT\/)6\.3)' - os_replacement: 'Windows' - os_v1_replacement: '8' - os_v2_replacement: '1' - - - regex: '(Win(?:dows NT |32NT\/)6\.4)' - os_replacement: 'Windows' - os_v1_replacement: '10' - - - regex: '(Windows NT 10\.0)' - os_replacement: 'Windows' - os_v1_replacement: '10' - - - regex: '(Windows NT 5\.0)' - os_replacement: 'Windows' - os_v1_replacement: '2000' - - - regex: '(WinNT4.0)' - os_replacement: 'Windows' - os_v1_replacement: 'NT 4.0' - - - regex: '(Windows ?CE)' - os_replacement: 'Windows' - os_v1_replacement: 'CE' - - - regex: 'Win(?:dows)? ?(95|98|3.1|NT|ME|2000|XP|Vista|7|CE)' - os_replacement: 'Windows' - os_v1_replacement: '$1' - - - regex: 'Win16' - os_replacement: 'Windows' - os_v1_replacement: '3.1' - - - regex: 'Win32' - os_replacement: 'Windows' - os_v1_replacement: '95' - - # Box apps (Drive, Sync, Notes) on Windows https://www.box.com/resources/downloads - - regex: '^Box.*Windows/([\d.]+);' - os_replacement: 'Windows' - os_v1_replacement: '$1' - - ########## - # Tizen OS from Samsung - # spoofs Android so pushing it above - ########## - - regex: '(Tizen)[/ ](\d+)\.(\d+)' - - ########## - # Mac OS - # @ref: http://en.wikipedia.org/wiki/Mac_OS_X#Versions - # @ref: http://www.puredarwin.org/curious/versions - ########## - - regex: '((?:Mac[ +]?|; )OS[ +]X)[\s+/](?:(\d+)[_.](\d+)(?:[_.](\d+)|)|Mach-O)' - os_replacement: 'Mac OS X' - - regex: '\w+\s+Mac OS X\s+\w+\s+(\d+).(\d+).(\d+).*' - os_replacement: 'Mac OS X' - os_v1_replacement: '$1' - os_v2_replacement: '$2' - os_v3_replacement: '$3' - # Leopard - - regex: ' (Dar)(win)/(9).(\d+).*\((?:i386|x86_64|Power Macintosh)\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '5' - # Snow Leopard - - regex: ' (Dar)(win)/(10).(\d+).*\((?:i386|x86_64)\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '6' - # Lion - - regex: ' (Dar)(win)/(11).(\d+).*\((?:i386|x86_64)\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '7' - # Mountain Lion - - regex: ' (Dar)(win)/(12).(\d+).*\((?:i386|x86_64)\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '8' - # Mavericks - - regex: ' (Dar)(win)/(13).(\d+).*\((?:i386|x86_64)\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '9' - # Yosemite is Darwin/14.x but patch versions are inconsistent in the Darwin string; - # more accurately covered by CFNetwork regexes downstream - - # IE on Mac doesn't specify version number - - regex: 'Mac_PowerPC' - os_replacement: 'Mac OS' - - # builds before tiger don't seem to specify version? - - # ios devices spoof (mac os x), so including intel/ppc prefixes - - regex: '(?:PPC|Intel) (Mac OS X)' - - # Box Drive and Box Sync on Mac OS X use OSX version numbers, not Darwin - - regex: '^Box.*;(Darwin)/(10)\.(1\d)(?:\.(\d+)|)' - os_replacement: 'Mac OS X' - - ########## - # iOS - # http://en.wikipedia.org/wiki/IOS_version_history - ########## - # keep this above generic iOS, since AppleTV UAs contain 'CPU OS' - - regex: '(Apple\s?TV)(?:/(\d+)\.(\d+)|)' - os_replacement: 'ATV OS X' - - - regex: '(CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(\d+)[_\.](\d+)(?:[_\.](\d+)|)' - os_replacement: 'iOS' - - # remaining cases are mostly only opera uas, so catch opera as to not catch iphone spoofs - - regex: '(iPhone|iPad|iPod); Opera' - os_replacement: 'iOS' - - # few more stragglers - - regex: '(iPhone|iPad|iPod).*Mac OS X.*Version/(\d+)\.(\d+)' - os_replacement: 'iOS' - - # CFNetwork/Darwin - The specific CFNetwork or Darwin version determines - # whether the os maps to Mac OS, or iOS, or just Darwin. - # See: http://user-agents.me/cfnetwork-version-list - - regex: '(CFNetwork)/(5)48\.0\.3.* Darwin/11\.0\.0' - os_replacement: 'iOS' - - regex: '(CFNetwork)/(5)48\.(0)\.4.* Darwin/(1)1\.0\.0' - os_replacement: 'iOS' - - regex: '(CFNetwork)/(5)48\.(1)\.4' - os_replacement: 'iOS' - - regex: '(CFNetwork)/(4)85\.1(3)\.9' - os_replacement: 'iOS' - - regex: '(CFNetwork)/(6)09\.(1)\.4' - os_replacement: 'iOS' - - regex: '(CFNetwork)/(6)(0)9' - os_replacement: 'iOS' - - regex: '(CFNetwork)/6(7)2\.(1)\.13' - os_replacement: 'iOS' - - regex: '(CFNetwork)/6(7)2\.(1)\.(1)4' - os_replacement: 'iOS' - - regex: '(CF)(Network)/6(7)(2)\.1\.15' - os_replacement: 'iOS' - os_v1_replacement: '7' - os_v2_replacement: '1' - - regex: '(CFNetwork)/6(7)2\.(0)\.(?:2|8)' - os_replacement: 'iOS' - - regex: '(CFNetwork)/709\.1' - os_replacement: 'iOS' - os_v1_replacement: '8' - os_v2_replacement: '0.b5' - - regex: '(CF)(Network)/711\.(\d)' - os_replacement: 'iOS' - os_v1_replacement: '8' - - regex: '(CF)(Network)/(720)\.(\d)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '10' - - regex: '(CF)(Network)/(760)\.(\d)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '11' - - regex: 'CFNetwork/7.* Darwin/15\.4\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '9' - os_v2_replacement: '3' - os_v3_replacement: '1' - - regex: 'CFNetwork/7.* Darwin/15\.5\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '9' - os_v2_replacement: '3' - os_v3_replacement: '2' - - regex: 'CFNetwork/7.* Darwin/15\.6\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '9' - os_v2_replacement: '3' - os_v3_replacement: '5' - - regex: '(CF)(Network)/758\.(\d)' - os_replacement: 'iOS' - os_v1_replacement: '9' - - regex: 'CFNetwork/808\.3 Darwin/16\.3\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '10' - os_v2_replacement: '2' - os_v3_replacement: '1' - - regex: '(CF)(Network)/808\.(\d)' - os_replacement: 'iOS' - os_v1_replacement: '10' - - ########## - # CFNetwork macOS Apps (must be before CFNetwork iOS Apps - # @ref: https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history - ########## - - regex: 'CFNetwork/.* Darwin/17\.\d+.*\(x86_64\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '13' - - regex: 'CFNetwork/.* Darwin/16\.\d+.*\(x86_64\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '12' - - regex: 'CFNetwork/8.* Darwin/15\.\d+.*\(x86_64\)' - os_replacement: 'Mac OS X' - os_v1_replacement: '10' - os_v2_replacement: '11' - ########## - # CFNetwork iOS Apps - # @ref: https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history - ########## - - regex: 'CFNetwork/.* Darwin/(9)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '1' - - regex: 'CFNetwork/.* Darwin/(10)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '4' - - regex: 'CFNetwork/.* Darwin/(11)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '5' - - regex: 'CFNetwork/.* Darwin/(13)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '6' - - regex: 'CFNetwork/6.* Darwin/(14)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '7' - - regex: 'CFNetwork/7.* Darwin/(14)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '8' - os_v2_replacement: '0' - - regex: 'CFNetwork/7.* Darwin/(15)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '9' - os_v2_replacement: '0' - - regex: 'CFNetwork/8.* Darwin/16\.5\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '10' - os_v2_replacement: '3' - - regex: 'CFNetwork/8.* Darwin/16\.6\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '10' - os_v2_replacement: '3' - os_v3_replacement: '2' - - regex: 'CFNetwork/8.* Darwin/16\.7\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '10' - os_v2_replacement: '3' - os_v3_replacement: '3' - - regex: 'CFNetwork/8.* Darwin/(16)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '10' - - regex: 'CFNetwork/8.* Darwin/17\.0\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - os_v2_replacement: '0' - - regex: 'CFNetwork/8.* Darwin/17\.2\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - os_v2_replacement: '1' - - regex: 'CFNetwork/8.* Darwin/17\.3\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - os_v2_replacement: '2' - - regex: 'CFNetwork/8.* Darwin/17\.4\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - os_v2_replacement: '2' - os_v3_replacement: '6' - - regex: 'CFNetwork/8.* Darwin/17\.5\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - os_v2_replacement: '3' - - regex: 'CFNetwork/9.* Darwin/17\.6\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - os_v2_replacement: '4' - - regex: 'CFNetwork/9.* Darwin/17\.7\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - os_v2_replacement: '4' - os_v3_replacement: '1' - - regex: 'CFNetwork/8.* Darwin/(17)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '11' - - regex: 'CFNetwork/9.* Darwin/18\.0\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '12' - os_v2_replacement: '0' - - regex: 'CFNetwork/9.* Darwin/(18)\.\d+' - os_replacement: 'iOS' - os_v1_replacement: '12' - - regex: 'CFNetwork/.* Darwin/' - os_replacement: 'iOS' - - # iOS Apps - - regex: '\b(iOS[ /]|iOS; |iPhone(?:/| v|[ _]OS[/,]|; | OS : |\d,\d/|\d,\d; )|iPad/)(\d{1,2})[_\.](\d{1,2})(?:[_\.](\d+)|)' - os_replacement: 'iOS' - - regex: '\((iOS);' - - ########## - # Apple Watch - ########## - - regex: '(watchOS)/(\d+)\.(\d+)(?:\.(\d+)|)' - os_replacement: 'WatchOS' - - ########################## - # Outlook on iOS >= 2.62.0 - ########################## - - regex: 'Outlook-(iOS)/\d+\.\d+\.prod\.iphone' - - ########################## - # iOS devices, the same regex matches mobile safari webviews - ########################## - - regex: '(iPod|iPhone|iPad)' - os_replacement: 'iOS' - - ########## - # Apple TV - ########## - - regex: '(tvOS)[/ ](\d+)\.(\d+)(?:\.(\d+)|)' - os_replacement: 'tvOS' - - ########## - # Chrome OS - # if version 0.0.0, probably this stuff: - # http://code.google.com/p/chromium-os/issues/detail?id=11573 - # http://code.google.com/p/chromium-os/issues/detail?id=13790 - ########## - - regex: '(CrOS) [a-z0-9_]+ (\d+)\.(\d+)(?:\.(\d+)|)' - os_replacement: 'Chrome OS' - - ########## - # Linux distros - ########## - - regex: '([Dd]ebian)' - os_replacement: 'Debian' - - regex: '(Linux Mint)(?:/(\d+)|)' - - regex: '(Mandriva)(?: Linux|)/(?:[\d.-]+m[a-z]{2}(\d+).(\d)|)' - - ########## - # Symbian + Symbian OS - # http://en.wikipedia.org/wiki/History_of_Symbian - ########## - - regex: '(Symbian[Oo][Ss])[/ ](\d+)\.(\d+)' - os_replacement: 'Symbian OS' - - regex: '(Symbian/3).+NokiaBrowser/7\.3' - os_replacement: 'Symbian^3 Anna' - - regex: '(Symbian/3).+NokiaBrowser/7\.4' - os_replacement: 'Symbian^3 Belle' - - regex: '(Symbian/3)' - os_replacement: 'Symbian^3' - - regex: '\b(Series 60|SymbOS|S60Version|S60V\d|S60\b)' - os_replacement: 'Symbian OS' - - regex: '(MeeGo)' - - regex: 'Symbian [Oo][Ss]' - os_replacement: 'Symbian OS' - - regex: 'Series40;' - os_replacement: 'Nokia Series 40' - - regex: 'Series30Plus;' - os_replacement: 'Nokia Series 30 Plus' - - ########## - # BlackBerry devices - ########## - - regex: '(BB10);.+Version/(\d+)\.(\d+)\.(\d+)' - os_replacement: 'BlackBerry OS' - - regex: '(Black[Bb]erry)[0-9a-z]+/(\d+)\.(\d+)\.(\d+)(?:\.(\d+)|)' - os_replacement: 'BlackBerry OS' - - regex: '(Black[Bb]erry).+Version/(\d+)\.(\d+)\.(\d+)(?:\.(\d+)|)' - os_replacement: 'BlackBerry OS' - - regex: '(RIM Tablet OS) (\d+)\.(\d+)\.(\d+)' - os_replacement: 'BlackBerry Tablet OS' - - regex: '(Play[Bb]ook)' - os_replacement: 'BlackBerry Tablet OS' - - regex: '(Black[Bb]erry)' - os_replacement: 'BlackBerry OS' - - ########## - # KaiOS - ########## - - regex: '(K[Aa][Ii]OS)\/(\d+)\.(\d+)(?:\.(\d+)|)' - os_replacement: 'KaiOS' - - ########## - # Firefox OS - ########## - - regex: '\((?:Mobile|Tablet);.+Gecko/18.0 Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - os_v1_replacement: '1' - os_v2_replacement: '0' - os_v3_replacement: '1' - - - regex: '\((?:Mobile|Tablet);.+Gecko/18.1 Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - os_v1_replacement: '1' - os_v2_replacement: '1' - - - regex: '\((?:Mobile|Tablet);.+Gecko/26.0 Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - os_v1_replacement: '1' - os_v2_replacement: '2' - - - regex: '\((?:Mobile|Tablet);.+Gecko/28.0 Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - os_v1_replacement: '1' - os_v2_replacement: '3' - - - regex: '\((?:Mobile|Tablet);.+Gecko/30.0 Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - os_v1_replacement: '1' - os_v2_replacement: '4' - - - regex: '\((?:Mobile|Tablet);.+Gecko/32.0 Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - os_v1_replacement: '2' - os_v2_replacement: '0' - - - regex: '\((?:Mobile|Tablet);.+Gecko/34.0 Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - os_v1_replacement: '2' - os_v2_replacement: '1' - - # Firefox OS Generic - - regex: '\((?:Mobile|Tablet);.+Firefox/\d+\.\d+' - os_replacement: 'Firefox OS' - - - ########## - # BREW - # yes, Brew is lower-cased for Brew MP - ########## - - regex: '(BREW)[ /](\d+)\.(\d+)\.(\d+)' - - regex: '(BREW);' - - regex: '(Brew MP|BMP)[ /](\d+)\.(\d+)\.(\d+)' - os_replacement: 'Brew MP' - - regex: 'BMP;' - os_replacement: 'Brew MP' - - ########## - # Google TV - ########## - - regex: '(GoogleTV)(?: (\d+)\.(\d+)(?:\.(\d+)|)|/[\da-z]+)' - - - regex: '(WebTV)/(\d+).(\d+)' - - ########## - # Chromecast - ########## - - regex: '(CrKey)(?:[/](\d+)\.(\d+)(?:\.(\d+)|)|)' - os_replacement: 'Chromecast' - - ########## - # Misc mobile - ########## - - regex: '(hpw|web)OS/(\d+)\.(\d+)(?:\.(\d+)|)' - os_replacement: 'webOS' - - regex: '(VRE);' - - ########## - # Generic patterns - # since the majority of os cases are very specific, these go last - ########## - - regex: '(Fedora|Red Hat|PCLinuxOS|Puppy|Ubuntu|Kindle|Bada|Sailfish|Lubuntu|BackTrack|Slackware|(?:Free|Open|Net|\b)BSD)[/ ](\d+)\.(\d+)(?:\.(\d+)|)(?:\.(\d+)|)' - - # Gentoo Linux + Kernel Version - - regex: '(Linux)[ /](\d+)\.(\d+)(?:\.(\d+)|).*gentoo' - os_replacement: 'Gentoo' - - # Opera Mini Bada - - regex: '\((Bada);' - - # just os - - regex: '(Windows|Android|WeTab|Maemo|Web0S)' - - regex: '(Ubuntu|Kubuntu|Arch Linux|CentOS|Slackware|Gentoo|openSUSE|SUSE|Red Hat|Fedora|PCLinuxOS|Mageia|(?:Free|Open|Net|\b)BSD)' - # Linux + Kernel Version - - regex: '(Linux)(?:[ /](\d+)\.(\d+)(?:\.(\d+)|)|)' - - regex: 'SunOS' - os_replacement: 'Solaris' - # Wget/x.x.x (linux-gnu) - - regex: '\(linux-gnu\)' - os_replacement: 'Linux' - - regex: '\(x86_64-redhat-linux-gnu\)' - os_replacement: 'Red Hat' - - regex: '\((freebsd)(\d+)\.(\d+)\)' - os_replacement: 'FreeBSD' - - regex: 'linux' - os_replacement: 'Linux' - - # Roku Digital-Video-Players https://www.roku.com/ - - regex: '^(Roku)/DVP-(\d+)\.(\d+)' - -device_parsers: - - ######### - # Mobile Spiders - # Catch the mobile crawler before checking for iPhones / Androids. - ######### - - regex: '(?:(?:iPhone|Windows CE|Windows Phone|Android).*(?:(?:Bot|Yeti)-Mobile|YRSpider|BingPreview|bots?/\d|(?:bot|spider)\.html)|AdsBot-Google-Mobile.*iPhone)' - regex_flag: 'i' - device_replacement: 'Spider' - brand_replacement: 'Spider' - model_replacement: 'Smartphone' - - regex: '(?:DoCoMo|\bMOT\b|\bLG\b|Nokia|Samsung|SonyEricsson).*(?:(?:Bot|Yeti)-Mobile|bots?/\d|(?:bot|crawler)\.html|(?:jump|google|Wukong)bot|ichiro/mobile|/spider|YahooSeeker)' - regex_flag: 'i' - device_replacement: 'Spider' - brand_replacement: 'Spider' - model_replacement: 'Feature Phone' - - # PTST / WebPageTest.org crawlers - - regex: ' PTST/\d+(?:\.)?\d+$' - device_replacement: 'Spider' - brand_replacement: 'Spider' - - # Datanyze.com spider - - regex: 'X11; Datanyze; Linux' - device_replacement: 'Spider' - brand_replacement: 'Spider' - - # aspiegel.com spider (owned by Huawei) - - regex: 'Mozilla.*Mobile.*AspiegelBot' - device_replacement: 'Spider' - brand_replacement: 'Spider' - model_replacement: 'Smartphone' - - regex: 'Mozilla.*AspiegelBot' - device_replacement: 'Spider' - brand_replacement: 'Spider' - model_replacement: 'Desktop' - - ######### - # WebBrowser for SmartWatch - # @ref: https://play.google.com/store/apps/details?id=se.vaggan.webbrowser&hl=en - ######### - - regex: '\bSmartWatch {0,2}\( {0,2}([^;]+) {0,2}; {0,2}([^;]+) {0,2};' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ###################################################################### - # Android parsers - # - # @ref: https://support.google.com/googleplay/answer/1727131?hl=en - ###################################################################### - - # Android Application - - regex: 'Android Application[^\-]+ - (Sony) ?(Ericsson|) (.+) \w+ - ' - device_replacement: '$1 $2' - brand_replacement: '$1$2' - model_replacement: '$3' - - regex: 'Android Application[^\-]+ - (?:HTC|HUAWEI|LGE|LENOVO|MEDION|TCT) (HTC|HUAWEI|LG|LENOVO|MEDION|ALCATEL)[ _\-](.+) \w+ - ' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - regex: 'Android Application[^\-]+ - ([^ ]+) (.+) \w+ - ' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # 3Q - # @ref: http://www.3q-int.com/ - ######### - - regex: '; *([BLRQ]C\d{4}[A-Z]+?)(?: Build|\) AppleWebKit)' - device_replacement: '3Q $1' - brand_replacement: '3Q' - model_replacement: '$1' - - regex: '; *(?:3Q_)([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '3Q $1' - brand_replacement: '3Q' - model_replacement: '$1' - - ######### - # Acer - # @ref: http://us.acer.com/ac/en/US/content/group/tablets - ######### - - regex: 'Android [34].*; *(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700(?: Lite| 3G|)|A701|B1-A71|A1-\d{3}|B1-\d{3}|V360|V370|W500|W500P|W501|W501P|W510|W511|W700|Slider SL101|DA22[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Acer' - model_replacement: '$1' - - regex: '; *Acer Iconia Tab ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Acer' - model_replacement: '$1' - - regex: '; *(Z1[1235]0|E320[^/]*|S500|S510|Liquid[^;/]*|Iconia A\d+)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Acer' - model_replacement: '$1' - - regex: '; *(Acer |ACER )([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Acer' - model_replacement: '$2' - - ######### - # Advent - # @ref: https://en.wikipedia.org/wiki/Advent_Vega - # @note: VegaBean and VegaComb (names derived from jellybean, honeycomb) are - # custom ROM builds for Vega - ######### - - regex: '; *(Advent |)(Vega(?:Bean|Comb|)).*?(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Advent' - model_replacement: '$2' - - ######### - # Ainol - # @ref: http://www.ainol.com/plugin.php?identifier=ainol&module=product - ######### - - regex: '; *(Ainol |)((?:NOVO|[Nn]ovo)[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Ainol' - model_replacement: '$2' - - ######### - # Airis - # @ref: http://airis.es/Tienda/Default.aspx?idG=001 - ######### - - regex: '; *AIRIS[ _\-]?([^/;\)]+) *(?:;|\)|Build)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Airis' - model_replacement: '$1' - - regex: '; *(OnePAD[^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Airis' - model_replacement: '$1' - - ######### - # Airpad - # @ref: ?? - ######### - - regex: '; *Airpad[ \-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Airpad $1' - brand_replacement: 'Airpad' - model_replacement: '$1' - - ######### - # Alcatel - TCT - # @ref: http://www.alcatelonetouch.com/global-en/products/smartphones.html - ######### - - regex: '; *(one ?touch) (EVO7|T10|T20)(?: Build|\) AppleWebKit)' - device_replacement: 'Alcatel One Touch $2' - brand_replacement: 'Alcatel' - model_replacement: 'One Touch $2' - - regex: '; *(?:alcatel[ _]|)(?:(?:one[ _]?touch[ _])|ot[ \-])([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Alcatel One Touch $1' - brand_replacement: 'Alcatel' - model_replacement: 'One Touch $1' - - regex: '; *(TCL)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - # operator specific models - - regex: '; *(Vodafone Smart II|Optimus_Madrid)(?: Build|\) AppleWebKit)' - device_replacement: 'Alcatel $1' - brand_replacement: 'Alcatel' - model_replacement: '$1' - - regex: '; *BASE_Lutea_3(?: Build|\) AppleWebKit)' - device_replacement: 'Alcatel One Touch 998' - brand_replacement: 'Alcatel' - model_replacement: 'One Touch 998' - - regex: '; *BASE_Varia(?: Build|\) AppleWebKit)' - device_replacement: 'Alcatel One Touch 918D' - brand_replacement: 'Alcatel' - model_replacement: 'One Touch 918D' - - ######### - # Allfine - # @ref: http://www.myallfine.com/Products.asp - ######### - - regex: '; *((?:FINE|Fine)\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Allfine' - model_replacement: '$1' - - ######### - # Allview - # @ref: http://www.allview.ro/produse/droseries/lista-tablete-pc/ - ######### - - regex: '; *(ALLVIEW[ _]?|Allview[ _]?)((?:Speed|SPEED).*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Allview' - model_replacement: '$2' - - regex: '; *(ALLVIEW[ _]?|Allview[ _]?|)(AX1_Shine|AX2_Frenzy)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Allview' - model_replacement: '$2' - - regex: '; *(ALLVIEW[ _]?|Allview[ _]?)([^;/]*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Allview' - model_replacement: '$2' - - ######### - # Allwinner - # @ref: http://www.allwinner.com/ - # @models: A31 (13.3"),A20,A10, - ######### - - regex: '; *(A13-MID)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Allwinner' - model_replacement: '$1' - - regex: '; *(Allwinner)[ _\-]?([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Allwinner' - model_replacement: '$1' - - ######### - # Amaway - # @ref: http://www.amaway.cn/ - ######### - - regex: '; *(A651|A701B?|A702|A703|A705|A706|A707|A711|A712|A713|A717|A722|A785|A801|A802|A803|A901|A902|A1002|A1003|A1006|A1007|A9701|A9703|Q710|Q80)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Amaway' - model_replacement: '$1' - - ######### - # Amoi - # @ref: http://www.amoi.com/en/prd/prd_index.jspx - ######### - - regex: '; *(?:AMOI|Amoi)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Amoi $1' - brand_replacement: 'Amoi' - model_replacement: '$1' - - regex: '^(?:AMOI|Amoi)[ _]([^;/]+?) Linux' - device_replacement: 'Amoi $1' - brand_replacement: 'Amoi' - model_replacement: '$1' - - ######### - # Aoc - # @ref: http://latin.aoc.com/media_tablet - ######### - - regex: '; *(MW(?:0[789]|10)[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Aoc' - model_replacement: '$1' - - ######### - # Aoson - # @ref: http://www.luckystar.com.cn/en/mid.aspx?page=1 - # @ref: http://www.luckystar.com.cn/en/mobiletel.aspx?page=1 - # @note: brand owned by luckystar - ######### - - regex: '; *(G7|M1013|M1015G|M11[CG]?|M-?12[B]?|M15|M19[G]?|M30[ACQ]?|M31[GQ]|M32|M33[GQ]|M36|M37|M38|M701T|M710|M712B|M713|M715G|M716G|M71(?:G|GS|T|)|M72[T]?|M73[T]?|M75[GT]?|M77G|M79T|M7L|M7LN|M81|M810|M81T|M82|M92|M92KS|M92S|M717G|M721|M722G|M723|M725G|M739|M785|M791|M92SK|M93D)(?: Build|\) AppleWebKit)' - device_replacement: 'Aoson $1' - brand_replacement: 'Aoson' - model_replacement: '$1' - - regex: '; *Aoson ([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Aoson $1' - brand_replacement: 'Aoson' - model_replacement: '$1' - - ######### - # Apanda - # @ref: http://www.apanda.com.cn/ - ######### - - regex: '; *[Aa]panda[ _\-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Apanda $1' - brand_replacement: 'Apanda' - model_replacement: '$1' - - ######### - # Archos - # @ref: http://www.archos.com/de/products/tablets.html - # @ref: http://www.archos.com/de/products/smartphones/index.html - ######### - - regex: '; *(?:ARCHOS|Archos) ?(GAMEPAD.*?)(?: Build|\) AppleWebKit)' - device_replacement: 'Archos $1' - brand_replacement: 'Archos' - model_replacement: '$1' - - regex: 'ARCHOS; GOGI; ([^;]+);' - device_replacement: 'Archos $1' - brand_replacement: 'Archos' - model_replacement: '$1' - - regex: '(?:ARCHOS|Archos)[ _]?(.*?)(?: Build|[;/\(\)\-]|$)' - device_replacement: 'Archos $1' - brand_replacement: 'Archos' - model_replacement: '$1' - - regex: '; *(AN(?:7|8|9|10|13)[A-Z0-9]{1,4})(?: Build|\) AppleWebKit)' - device_replacement: 'Archos $1' - brand_replacement: 'Archos' - model_replacement: '$1' - - regex: '; *(A28|A32|A43|A70(?:BHT|CHT|HB|S|X)|A101(?:B|C|IT)|A7EB|A7EB-WK|101G9|80G9)(?: Build|\) AppleWebKit)' - device_replacement: 'Archos $1' - brand_replacement: 'Archos' - model_replacement: '$1' - - ######### - # A-rival - # @ref: http://www.a-rival.de/de/ - ######### - - regex: '; *(PAD-FMD[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Arival' - model_replacement: '$1' - - regex: '; *(BioniQ) ?([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Arival' - model_replacement: '$1 $2' - - ######### - # Arnova - # @ref: http://arnovatech.com/ - ######### - - regex: '; *(AN\d[^;/]+|ARCHM\d+)(?: Build|\) AppleWebKit)' - device_replacement: 'Arnova $1' - brand_replacement: 'Arnova' - model_replacement: '$1' - - regex: '; *(?:ARNOVA|Arnova) ?([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Arnova $1' - brand_replacement: 'Arnova' - model_replacement: '$1' - - ######### - # Assistant - # @ref: http://www.assistant.ua - ######### - - regex: '; *(?:ASSISTANT |)(AP)-?([1789]\d{2}[A-Z]{0,2}|80104)(?: Build|\) AppleWebKit)' - device_replacement: 'Assistant $1-$2' - brand_replacement: 'Assistant' - model_replacement: '$1-$2' - - ######### - # Asus - # @ref: http://www.asus.com/uk/Tablets_Mobile/ - ######### - - regex: '; *(ME17\d[^;/]*|ME3\d{2}[^;/]+|K00[A-Z]|Nexus 10|Nexus 7(?: 2013|)|PadFone[^;/]*|Transformer[^;/]*|TF\d{3}[^;/]*|eeepc)(?: Build|\) AppleWebKit)' - device_replacement: 'Asus $1' - brand_replacement: 'Asus' - model_replacement: '$1' - - regex: '; *ASUS[ _]*([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Asus $1' - brand_replacement: 'Asus' - model_replacement: '$1' - - ######### - # Garmin-Asus - ######### - - regex: '; *Garmin-Asus ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Garmin-Asus $1' - brand_replacement: 'Garmin-Asus' - model_replacement: '$1' - - regex: '; *(Garminfone)(?: Build|\) AppleWebKit)' - device_replacement: 'Garmin $1' - brand_replacement: 'Garmin-Asus' - model_replacement: '$1' - - ######### - # Attab - # @ref: http://www.theattab.com/ - ######### - - regex: '; (@TAB-[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Attab' - model_replacement: '$1' - - ######### - # Audiosonic - # @ref: ?? - # @note: Take care with Docomo T-01 Toshiba - ######### - - regex: '; *(T-(?:07|[^0]\d)[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Audiosonic' - model_replacement: '$1' - - ######### - # Axioo - # @ref: http://www.axiooworld.com/ww/index.php - ######### - - regex: '; *(?:Axioo[ _\-]([^;/]+?)|(picopad)[ _\-]([^;/]+?))(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Axioo $1$2 $3' - brand_replacement: 'Axioo' - model_replacement: '$1$2 $3' - - ######### - # Azend - # @ref: http://azendcorp.com/index.php/products/portable-electronics - ######### - - regex: '; *(V(?:100|700|800)[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Azend' - model_replacement: '$1' - - ######### - # Bak - # @ref: http://www.bakinternational.com/produtos.php?cat=80 - ######### - - regex: '; *(IBAK\-[^;/]*)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Bak' - model_replacement: '$1' - - ######### - # Bedove - # @ref: http://www.bedove.com/product.html - # @models: HY6501|HY5001|X12|X21|I5 - ######### - - regex: '; *(HY5001|HY6501|X12|X21|I5)(?: Build|\) AppleWebKit)' - device_replacement: 'Bedove $1' - brand_replacement: 'Bedove' - model_replacement: '$1' - - ######### - # Benss - # @ref: http://www.benss.net/ - ######### - - regex: '; *(JC-[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'Benss $1' - brand_replacement: 'Benss' - model_replacement: '$1' - - ######### - # Blackberry - # @ref: http://uk.blackberry.com/ - # @note: Android Apps seams to be used here - ######### - - regex: '; *(BB) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Blackberry' - model_replacement: '$2' - - ######### - # Blackbird - # @ref: http://iblackbird.co.kr - ######### - - regex: '; *(BlackBird)[ _](I8.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - regex: '; *(BlackBird)[ _](.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # Blaupunkt - # @ref: http://www.blaupunkt.com - ######### - # Endeavour - - regex: '; *([0-9]+BP[EM][^;/]*|Endeavour[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Blaupunkt $1' - brand_replacement: 'Blaupunkt' - model_replacement: '$1' - - ######### - # Blu - # @ref: http://bluproducts.com - ######### - - regex: '; *((?:BLU|Blu)[ _\-])([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Blu' - model_replacement: '$2' - # BMOBILE = operator branded device - - regex: '; *(?:BMOBILE )?(Blu|BLU|DASH [^;/]+|VIVO 4\.3|TANK 4\.5)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Blu' - model_replacement: '$1' - - ######### - # Blusens - # @ref: http://www.blusens.com/es/?sg=1&sv=al&roc=1 - ######### - # tablet - - regex: '; *(TOUCH\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Blusens' - model_replacement: '$1' - - ######### - # Bmobile - # @ref: http://bmobile.eu.com/?categoria=smartphones-2 - # @note: Might collide with Maxx as AX is used also there. - ######### - # smartphone - - regex: '; *(AX5\d+)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Bmobile' - model_replacement: '$1' - - ######### - # bq - # @ref: http://bqreaders.com - ######### - - regex: '; *([Bb]q) ([^;/]+?);?(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'bq' - model_replacement: '$2' - - regex: '; *(Maxwell [^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'bq' - model_replacement: '$1' - - ######### - # Braun Phototechnik - # @ref: http://www.braun-phototechnik.de/en/products/list/~pcat.250/Tablet-PC.html - ######### - - regex: '; *((?:B-Tab|B-TAB) ?\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Braun' - model_replacement: '$1' - - ######### - # Broncho - # @ref: http://www.broncho.cn/ - ######### - - regex: '; *(Broncho) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # Captiva - # @ref: http://www.captiva-power.de - ######### - - regex: '; *CAPTIVA ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Captiva $1' - brand_replacement: 'Captiva' - model_replacement: '$1' - - ######### - # Casio - # @ref: http://www.casiogzone.com/ - ######### - - regex: '; *(C771|CAL21|IS11CA)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Casio' - model_replacement: '$1' - - ######### - # Cat - # @ref: http://www.cat-sound.com - ######### - - regex: '; *(?:Cat|CAT) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Cat $1' - brand_replacement: 'Cat' - model_replacement: '$1' - - regex: '; *(?:Cat)(Nova.*?)(?: Build|\) AppleWebKit)' - device_replacement: 'Cat $1' - brand_replacement: 'Cat' - model_replacement: '$1' - - regex: '; *(INM8002KP|ADM8000KP_[AB])(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Cat' - model_replacement: 'Tablet PHOENIX 8.1J0' - - ######### - # Celkon - # @ref: http://www.celkonmobiles.com/?_a=products - # @models: A10, A19Q, A101, A105, A107, A107\+, A112, A118, A119, A119Q, A15, A19, A20, A200, A220, A225, A22 Race, A27, A58, A59, A60, A62, A63, A64, A66, A67, A69, A75, A77, A79, A8\+, A83, A85, A86, A87, A89 Ultima, A9\+, A90, A900, A95, A97i, A98, AR 40, AR 45, AR 50, ML5 - ######### - - regex: '; *(?:[Cc]elkon[ _\*]|CELKON[ _\*])([^;/\)]+) ?(?:Build|;|\))' - device_replacement: '$1' - brand_replacement: 'Celkon' - model_replacement: '$1' - - regex: 'Build/(?:[Cc]elkon)+_?([^;/_\)]+)' - device_replacement: '$1' - brand_replacement: 'Celkon' - model_replacement: '$1' - - regex: '; *(CT)-?(\d+)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Celkon' - model_replacement: '$1$2' - # smartphones - - regex: '; *(A19|A19Q|A105|A107[^;/\)]*) ?(?:Build|;|\))' - device_replacement: '$1' - brand_replacement: 'Celkon' - model_replacement: '$1' - - ######### - # ChangJia - # @ref: http://www.cjshowroom.com/eproducts.aspx?classcode=004001001 - # @brief: China manufacturer makes tablets for different small brands - # (eg. http://www.zeepad.net/index.html) - ######### - - regex: '; *(TPC[0-9]{4,5})(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'ChangJia' - model_replacement: '$1' - - ######### - # Cloudfone - # @ref: http://www.cloudfonemobile.com/ - ######### - - regex: '; *(Cloudfone)[ _](Excite)([^ ][^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2 $3' - brand_replacement: 'Cloudfone' - model_replacement: '$1 $2 $3' - - regex: '; *(Excite|ICE)[ _](\d+[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Cloudfone $1 $2' - brand_replacement: 'Cloudfone' - model_replacement: 'Cloudfone $1 $2' - - regex: '; *(Cloudfone|CloudPad)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Cloudfone' - model_replacement: '$1 $2' - - ######### - # Cmx - # @ref: http://cmx.at/de/ - ######### - - regex: '; *((?:Aquila|Clanga|Rapax)[^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Cmx' - model_replacement: '$1' - - ######### - # CobyKyros - # @ref: http://cobykyros.com - # @note: Be careful with MID\d{3} from MpMan or Manta - ######### - - regex: '; *(?:CFW-|Kyros )?(MID[0-9]{4}(?:[ABC]|SR|TV)?)(\(3G\)-4G| GB 8K| 3G| 8K| GB)? *(?:Build|[;\)])' - device_replacement: 'CobyKyros $1$2' - brand_replacement: 'CobyKyros' - model_replacement: '$1$2' - - ######### - # Coolpad - # @ref: ?? - ######### - - regex: '; *([^;/]*)Coolpad[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Coolpad' - model_replacement: '$1$2' - - ######### - # Cube - # @ref: http://www.cube-tablet.com/buy-products.html - ######### - - regex: '; *(CUBE[ _])?([KU][0-9]+ ?GT.*?|A5300)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1$2' - brand_replacement: 'Cube' - model_replacement: '$2' - - ######### - # Cubot - # @ref: http://www.cubotmall.com/ - ######### - - regex: '; *CUBOT ([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Cubot' - model_replacement: '$1' - - regex: '; *(BOBBY)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Cubot' - model_replacement: '$1' - - ######### - # Danew - # @ref: http://www.danew.com/produits-tablette.php - ######### - - regex: '; *(Dslide [^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Danew' - model_replacement: '$1' - - ######### - # Dell - # @ref: http://www.dell.com - # @ref: http://www.softbank.jp/mobile/support/product/101dl/ - # @ref: http://www.softbank.jp/mobile/support/product/001dl/ - # @ref: http://developer.emnet.ne.jp/android.html - # @ref: http://www.dell.com/in/p/mobile-xcd28/pd - # @ref: http://www.dell.com/in/p/mobile-xcd35/pd - ######### - - regex: '; *(XCD)[ _]?(28|35)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1$2' - brand_replacement: 'Dell' - model_replacement: '$1$2' - - regex: '; *(001DL)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: 'Streak' - - regex: '; *(?:Dell|DELL) (Streak)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: 'Streak' - - regex: '; *(101DL|GS01|Streak Pro[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: 'Streak Pro' - - regex: '; *([Ss]treak ?7)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: 'Streak 7' - - regex: '; *(Mini-3iX)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: '$1' - - regex: '; *(?:Dell|DELL)[ _](Aero|Venue|Thunder|Mini.*?|Streak[ _]Pro)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: '$1' - - regex: '; *Dell[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: '$1' - - regex: '; *Dell ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: '$1' - - ######### - # Denver - # @ref: http://www.denver-electronics.com/tablets1/ - ######### - - regex: '; *(TA[CD]-\d+[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Denver' - model_replacement: '$1' - - ######### - # Dex - # @ref: http://dex.ua/ - ######### - - regex: '; *(iP[789]\d{2}(?:-3G)?|IP10\d{2}(?:-8GB)?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Dex' - model_replacement: '$1' - - ######### - # DNS AirTab - # @ref: http://www.dns-shop.ru/ - ######### - - regex: '; *(AirTab)[ _\-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'DNS' - model_replacement: '$1 $2' - - ######### - # Docomo (Operator Branded Device) - # @ref: http://www.ipentec.com/document/document.aspx?page=android-useragent - ######### - - regex: '; *(F\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Fujitsu' - model_replacement: '$1' - - regex: '; *(HT-03A)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'Magic' - - regex: '; *(HT\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: '$1' - - regex: '; *(L\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'LG' - model_replacement: '$1' - - regex: '; *(N\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Nec' - model_replacement: '$1' - - regex: '; *(P\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Panasonic' - model_replacement: '$1' - - regex: '; *(SC\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: '; *(SH\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Sharp' - model_replacement: '$1' - - regex: '; *(SO\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'SonyEricsson' - model_replacement: '$1' - - regex: '; *(T\-0[12][^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Toshiba' - model_replacement: '$1' - - ######### - # DOOV - # @ref: http://www.doov.com.cn/ - ######### - - regex: '; *(DOOV)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'DOOV' - model_replacement: '$2' - - ######### - # Enot - # @ref: http://www.enot.ua/ - ######### - - regex: '; *(Enot|ENOT)[ -]?([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Enot' - model_replacement: '$2' - - ######### - # Evercoss - # @ref: http://evercoss.com/android/ - ######### - - regex: '; *[^;/]+ Build/(?:CROSS|Cross)+[ _\-]([^\)]+)' - device_replacement: 'CROSS $1' - brand_replacement: 'Evercoss' - model_replacement: 'Cross $1' - - regex: '; *(CROSS|Cross)[ _\-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Evercoss' - model_replacement: 'Cross $2' - - ######### - # Explay - # @ref: http://explay.ru/ - ######### - - regex: '; *Explay[_ ](.+?)(?:[\)]| Build)' - device_replacement: '$1' - brand_replacement: 'Explay' - model_replacement: '$1' - - ######### - # Fly - # @ref: http://www.fly-phone.com/ - ######### - - regex: '; *(IQ.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Fly' - model_replacement: '$1' - - regex: '; *(Fly|FLY)[ _](IQ[^;]+?|F[34]\d+[^;]*?);?(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Fly' - model_replacement: '$2' - - ######### - # Fujitsu - # @ref: http://www.fujitsu.com/global/ - ######### - - regex: '; *(M532|Q572|FJL21)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Fujitsu' - model_replacement: '$1' - - ######### - # Galapad - # @ref: http://www.galapad.net/product.html - ######### - - regex: '; *(G1)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Galapad' - model_replacement: '$1' - - ######### - # Geeksphone - # @ref: http://www.geeksphone.com/ - ######### - - regex: '; *(Geeksphone) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # Gfive - # @ref: http://www.gfivemobile.com/en - ######### - #- regex: '; *(G\'?FIVE) ([^;/]+) Build' # there is a problem with python yaml parser here - - regex: '; *(G[^F]?FIVE) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Gfive' - model_replacement: '$2' - - ######### - # Gionee - # @ref: http://www.gionee.com/ - ######### - - regex: '; *(Gionee)[ _\-]([^;/]+?)(?:/[^;/]+|)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'Gionee' - model_replacement: '$2' - - regex: '; *(GN\d+[A-Z]?|INFINITY_PASSION|Ctrl_V1)(?: Build|\) AppleWebKit)' - device_replacement: 'Gionee $1' - brand_replacement: 'Gionee' - model_replacement: '$1' - - regex: '; *(E3) Build/JOP40D' - device_replacement: 'Gionee $1' - brand_replacement: 'Gionee' - model_replacement: '$1' - - regex: '\sGIONEE[-\s_](\w*)' - regex_flag: 'i' - device_replacement: 'Gionee $1' - brand_replacement: 'Gionee' - model_replacement: '$1' - - ######### - # GoClever - # @ref: http://www.goclever.com - ######### - - regex: '; *((?:FONE|QUANTUM|INSIGNIA) \d+[^;/]*|PLAYTAB)(?: Build|\) AppleWebKit)' - device_replacement: 'GoClever $1' - brand_replacement: 'GoClever' - model_replacement: '$1' - - regex: '; *GOCLEVER ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'GoClever $1' - brand_replacement: 'GoClever' - model_replacement: '$1' - - ######### - # Google - # @ref: http://www.google.de/glass/start/ - ######### - - regex: '; *(Glass \d+)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Google' - model_replacement: '$1' - - regex: '; *(Pixel.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Google' - model_replacement: '$1' - - ######### - # Gigabyte - # @ref: http://gsmart.gigabytecm.com/en/ - ######### - - regex: '; *(GSmart)[ -]([^/]+)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Gigabyte' - model_replacement: '$1 $2' - - ######### - # Freescale development boards - # @ref: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=IMX53QSB - ######### - - regex: '; *(imx5[13]_[^/]+)(?: Build|\) AppleWebKit)' - device_replacement: 'Freescale $1' - brand_replacement: 'Freescale' - model_replacement: '$1' - - ######### - # Haier - # @ref: http://www.haier.com/ - # @ref: http://www.haier.com/de/produkte/tablet/ - ######### - - regex: '; *Haier[ _\-]([^/]+)(?: Build|\) AppleWebKit)' - device_replacement: 'Haier $1' - brand_replacement: 'Haier' - model_replacement: '$1' - - regex: '; *(PAD1016)(?: Build|\) AppleWebKit)' - device_replacement: 'Haipad $1' - brand_replacement: 'Haipad' - model_replacement: '$1' - - ######### - # Haipad - # @ref: http://www.haipad.net/ - # @models: V7P|M7SM7S|M9XM9X|M7XM7X|M9|M8|M7-M|M1002|M7|M701 - ######### - - regex: '; *(M701|M7|M8|M9)(?: Build|\) AppleWebKit)' - device_replacement: 'Haipad $1' - brand_replacement: 'Haipad' - model_replacement: '$1' - - ######### - # Hannspree - # @ref: http://www.hannspree.eu/ - # @models: SN10T1|SN10T2|SN70T31B|SN70T32W - ######### - - regex: '; *(SN\d+T[^;\)/]*)(?: Build|[;\)])' - device_replacement: 'Hannspree $1' - brand_replacement: 'Hannspree' - model_replacement: '$1' - - ######### - # HCLme - # @ref: http://www.hclmetablet.com/india/ - ######### - - regex: 'Build/HCL ME Tablet ([^;\)]+)[\);]' - device_replacement: 'HCLme $1' - brand_replacement: 'HCLme' - model_replacement: '$1' - - regex: '; *([^;\/]+) Build/HCL' - device_replacement: 'HCLme $1' - brand_replacement: 'HCLme' - model_replacement: '$1' - - ######### - # Hena - # @ref: http://www.henadigital.com/en/product/index.asp?id=6 - ######### - - regex: '; *(MID-?\d{4}C[EM])(?: Build|\) AppleWebKit)' - device_replacement: 'Hena $1' - brand_replacement: 'Hena' - model_replacement: '$1' - - ######### - # Hisense - # @ref: http://www.hisense.com/ - ######### - - regex: '; *(EG\d{2,}|HS-[^;/]+|MIRA[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Hisense $1' - brand_replacement: 'Hisense' - model_replacement: '$1' - - regex: '; *(andromax[^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Hisense $1' - brand_replacement: 'Hisense' - model_replacement: '$1' - - ######### - # hitech - # @ref: http://www.hitech-mobiles.com/ - ######### - - regex: '; *(?:AMAZE[ _](S\d+)|(S\d+)[ _]AMAZE)(?: Build|\) AppleWebKit)' - device_replacement: 'AMAZE $1$2' - brand_replacement: 'hitech' - model_replacement: 'AMAZE $1$2' - - ######### - # HP - # @ref: http://www.hp.com/ - ######### - - regex: '; *(PlayBook)(?: Build|\) AppleWebKit)' - device_replacement: 'HP $1' - brand_replacement: 'HP' - model_replacement: '$1' - - regex: '; *HP ([^/]+)(?: Build|\) AppleWebKit)' - device_replacement: 'HP $1' - brand_replacement: 'HP' - model_replacement: '$1' - - regex: '; *([^/]+_tenderloin)(?: Build|\) AppleWebKit)' - device_replacement: 'HP TouchPad' - brand_replacement: 'HP' - model_replacement: 'TouchPad' - - ######### - # Huawei - # @ref: http://www.huaweidevice.com - # @note: Needs to be before HTC due to Desire HD Build on U8815 - ######### - - regex: '; *(HUAWEI |Huawei-|)([UY][^;/]+) Build/(?:Huawei|HUAWEI)([UY][^\);]+)\)' - device_replacement: '$1$2' - brand_replacement: 'Huawei' - model_replacement: '$2' - - regex: '; *([^;/]+) Build[/ ]Huawei(MT1-U06|[A-Z]+\d+[^\);]+)\)' - device_replacement: '$1' - brand_replacement: 'Huawei' - model_replacement: '$2' - - regex: '; *(S7|M860) Build' - device_replacement: '$1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - regex: '; *((?:HUAWEI|Huawei)[ \-]?)(MediaPad) Build' - device_replacement: '$1$2' - brand_replacement: 'Huawei' - model_replacement: '$2' - - regex: '; *((?:HUAWEI[ _]?|Huawei[ _]|)Ascend[ _])([^;/]+) Build' - device_replacement: '$1$2' - brand_replacement: 'Huawei' - model_replacement: '$2' - - regex: '; *((?:HUAWEI|Huawei)[ _\-]?)((?:G700-|MT-)[^;/]+) Build' - device_replacement: '$1$2' - brand_replacement: 'Huawei' - model_replacement: '$2' - - regex: '; *((?:HUAWEI|Huawei)[ _\-]?)([^;/]+) Build' - device_replacement: '$1$2' - brand_replacement: 'Huawei' - model_replacement: '$2' - - regex: '; *(MediaPad[^;]+|SpringBoard) Build/Huawei' - device_replacement: '$1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - regex: '; *([^;]+) Build/(?:Huawei|HUAWEI)' - device_replacement: '$1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - regex: '; *([Uu])([89]\d{3}) Build' - device_replacement: '$1$2' - brand_replacement: 'Huawei' - model_replacement: 'U$2' - - regex: '; *(?:Ideos |IDEOS )(S7) Build' - device_replacement: 'Huawei Ideos$1' - brand_replacement: 'Huawei' - model_replacement: 'Ideos$1' - - regex: '; *(?:Ideos |IDEOS )([^;/]+\s*|\s*)Build' - device_replacement: 'Huawei Ideos$1' - brand_replacement: 'Huawei' - model_replacement: 'Ideos$1' - - regex: '; *(Orange Daytona|Pulse|Pulse Mini|Vodafone 858|C8500|C8600|C8650|C8660|Nexus 6P|ATH-.+?) Build[/ ]' - device_replacement: 'Huawei $1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - regex: '; *((?:[A-Z]{3})\-L[A-Za0-9]{2})[\)]' - device_replacement: 'Huawei $1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - ######### - # HTC - # @ref: http://www.htc.com/www/products/ - # @ref: http://en.wikipedia.org/wiki/List_of_HTC_phones - ######### - - - regex: '; *HTC[ _]([^;]+); Windows Phone' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - - # Android HTC with Version Number matcher - # ; HTC_0P3Z11/1.12.161.3 Build - # ;HTC_A3335 V2.38.841.1 Build - - regex: '; *(?:HTC[ _/])+([^ _/]+)(?:[/\\]1\.0 | V|/| +)\d+\.\d[\d\.]*(?: *Build|\))' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - - regex: '; *(?:HTC[ _/])+([^ _/]+)(?:[ _/]([^ _/]+)|)(?:[/\\]1\.0 | V|/| +)\d+\.\d[\d\.]*(?: *Build|\))' - device_replacement: 'HTC $1 $2' - brand_replacement: 'HTC' - model_replacement: '$1 $2' - - regex: '; *(?:HTC[ _/])+([^ _/]+)(?:[ _/]([^ _/]+)(?:[ _/]([^ _/]+)|)|)(?:[/\\]1\.0 | V|/| +)\d+\.\d[\d\.]*(?: *Build|\))' - device_replacement: 'HTC $1 $2 $3' - brand_replacement: 'HTC' - model_replacement: '$1 $2 $3' - - regex: '; *(?:HTC[ _/])+([^ _/]+)(?:[ _/]([^ _/]+)(?:[ _/]([^ _/]+)(?:[ _/]([^ _/]+)|)|)|)(?:[/\\]1\.0 | V|/| +)\d+\.\d[\d\.]*(?: *Build|\))' - device_replacement: 'HTC $1 $2 $3 $4' - brand_replacement: 'HTC' - model_replacement: '$1 $2 $3 $4' - - # Android HTC without Version Number matcher - - regex: '; *(?:(?:HTC|htc)(?:_blocked|)[ _/])+([^ _/;]+)(?: *Build|[;\)]| - )' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - - regex: '; *(?:(?:HTC|htc)(?:_blocked|)[ _/])+([^ _/]+)(?:[ _/]([^ _/;\)]+)|)(?: *Build|[;\)]| - )' - device_replacement: 'HTC $1 $2' - brand_replacement: 'HTC' - model_replacement: '$1 $2' - - regex: '; *(?:(?:HTC|htc)(?:_blocked|)[ _/])+([^ _/]+)(?:[ _/]([^ _/]+)(?:[ _/]([^ _/;\)]+)|)|)(?: *Build|[;\)]| - )' - device_replacement: 'HTC $1 $2 $3' - brand_replacement: 'HTC' - model_replacement: '$1 $2 $3' - - regex: '; *(?:(?:HTC|htc)(?:_blocked|)[ _/])+([^ _/]+)(?:[ _/]([^ _/]+)(?:[ _/]([^ _/]+)(?:[ _/]([^ /;]+)|)|)|)(?: *Build|[;\)]| - )' - device_replacement: 'HTC $1 $2 $3 $4' - brand_replacement: 'HTC' - model_replacement: '$1 $2 $3 $4' - - # HTC Streaming Player - - regex: 'HTC Streaming Player [^\/]*/[^\/]*/ htc_([^/]+) /' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - # general matcher for anything else - - regex: '(?:[;,] *|^)(?:htccn_chs-|)HTC[ _-]?([^;]+?)(?: *Build|clay|Android|-?Mozilla| Opera| Profile| UNTRUSTED|[;/\(\)]|$)' - regex_flag: 'i' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - # Android matchers without HTC - - regex: '; *(A6277|ADR6200|ADR6300|ADR6350|ADR6400[A-Z]*|ADR6425[A-Z]*|APX515CKT|ARIA|Desire[^_ ]*|Dream|EndeavorU|Eris|Evo|Flyer|HD2|Hero|HERO200|Hero CDMA|HTL21|Incredible|Inspire[A-Z0-9]*|Legend|Liberty|Nexus ?(?:One|HD2)|One|One S C2|One[ _]?(?:S|V|X\+?)\w*|PC36100|PG06100|PG86100|S31HT|Sensation|Wildfire)(?: Build|[/;\(\)])' - regex_flag: 'i' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - - regex: '; *(ADR6200|ADR6400L|ADR6425LVW|Amaze|DesireS?|EndeavorU|Eris|EVO|Evo\d[A-Z]+|HD2|IncredibleS?|Inspire[A-Z0-9]*|Inspire[A-Z0-9]*|Sensation[A-Z0-9]*|Wildfire)[ _-](.+?)(?:[/;\)]|Build|MIUI|1\.0)' - regex_flag: 'i' - device_replacement: 'HTC $1 $2' - brand_replacement: 'HTC' - model_replacement: '$1 $2' - - ######### - # Hyundai - # @ref: http://www.hyundaitechnologies.com - ######### - - regex: '; *HYUNDAI (T\d[^/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'Hyundai $1' - brand_replacement: 'Hyundai' - model_replacement: '$1' - - regex: '; *HYUNDAI ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Hyundai $1' - brand_replacement: 'Hyundai' - model_replacement: '$1' - # X900? http://www.amazon.com/Hyundai-X900-Retina-Android-Bluetooth/dp/B00AO07H3O - - regex: '; *(X700|Hold X|MB-6900)(?: Build|\) AppleWebKit)' - device_replacement: 'Hyundai $1' - brand_replacement: 'Hyundai' - model_replacement: '$1' - - ######### - # iBall - # @ref: http://www.iball.co.in/Category/Mobiles/22 - ######### - - regex: '; *(?:iBall[ _\-]|)(Andi)[ _]?(\d[^;/]*)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'iBall' - model_replacement: '$1 $2' - - regex: '; *(IBall)(?:[ _]([^;/]+?)|)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'iBall' - model_replacement: '$2' - - ######### - # IconBIT - # @ref: http://www.iconbit.com/catalog/tablets/ - ######### - - regex: '; *(NT-\d+[^ ;/]*|Net[Tt]AB [^;/]+|Mercury [A-Z]+|iconBIT)(?: S/N:[^;/]+|)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'IconBIT' - model_replacement: '$1' - - ######### - # IMO - # @ref: http://www.ponselimo.com/ - ######### - - regex: '; *(IMO)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'IMO' - model_replacement: '$2' - - ######### - # i-mobile - # @ref: http://www.i-mobilephone.com/ - ######### - - regex: '; *i-?mobile[ _]([^/]+)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'i-mobile $1' - brand_replacement: 'imobile' - model_replacement: '$1' - - regex: '; *(i-(?:style|note)[^/]*)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'i-mobile $1' - brand_replacement: 'imobile' - model_replacement: '$1' - - ######### - # Impression - # @ref: http://impression.ua/planshetnye-kompyutery - ######### - - regex: '; *(ImPAD) ?(\d+(?:.)*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Impression' - model_replacement: '$1 $2' - - ######### - # Infinix - # @ref: http://www.infinixmobility.com/index.html - ######### - - regex: '; *(Infinix)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Infinix' - model_replacement: '$2' - - ######### - # Informer - # @ref: ?? - ######### - - regex: '; *(Informer)[ \-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Informer' - model_replacement: '$2' - - ######### - # Intenso - # @ref: http://www.intenso.de - # @models: 7":TAB 714,TAB 724;8":TAB 814,TAB 824;10":TAB 1004 - ######### - - regex: '; *(TAB) ?([78][12]4)(?: Build|\) AppleWebKit)' - device_replacement: 'Intenso $1' - brand_replacement: 'Intenso' - model_replacement: '$1 $2' - - ######### - # Intex - # @ref: http://intexmobile.in/index.aspx - # @note: Zync also offers a "Cloud Z5" device - ######### - # smartphones - - regex: '; *(?:Intex[ _]|)(AQUA|Aqua)([ _\.\-])([^;/]+?) *(?:Build|;)' - device_replacement: '$1$2$3' - brand_replacement: 'Intex' - model_replacement: '$1 $3' - # matches "INTEX CLOUD X1" - - regex: '; *(?:INTEX|Intex)(?:[_ ]([^\ _;/]+))(?:[_ ]([^\ _;/]+)|) *(?:Build|;)' - device_replacement: '$1 $2' - brand_replacement: 'Intex' - model_replacement: '$1 $2' - # tablets - - regex: '; *([iI]Buddy)[ _]?(Connect)(?:_|\?_| |)([^;/]*) *(?:Build|;)' - device_replacement: '$1 $2 $3' - brand_replacement: 'Intex' - model_replacement: 'iBuddy $2 $3' - - regex: '; *(I-Buddy)[ _]([^;/]+?) *(?:Build|;)' - device_replacement: '$1 $2' - brand_replacement: 'Intex' - model_replacement: 'iBuddy $2' - - ######### - # iOCEAN - # @ref: http://www.iocean.cc/ - ######### - - regex: '; *(iOCEAN) ([^/]+)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'iOCEAN' - model_replacement: '$2' - - ######### - # i.onik - # @ref: http://www.i-onik.de/ - ######### - - regex: '; *(TP\d+(?:\.\d+|)\-\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'ionik $1' - brand_replacement: 'ionik' - model_replacement: '$1' - - ######### - # IRU.ru - # @ref: http://www.iru.ru/catalog/soho/planetable/ - ######### - - regex: '; *(M702pro)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Iru' - model_replacement: '$1' - - ######### - # Itel Mobile - # @ref: https://www.itel-mobile.com/global/products/ - ######### - - regex: '; *itel ([^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'Itel $1' - brand_replacement: 'Itel' - model_replacement: '$1' - - ######### - # Ivio - # @ref: http://www.ivio.com/mobile.php - # @models: DG80,DG20,DE38,DE88,MD70 - ######### - - regex: '; *(DE88Plus|MD70)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Ivio' - model_replacement: '$1' - - regex: '; *IVIO[_\-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Ivio' - model_replacement: '$1' - - ######### - # Jaytech - # @ref: http://www.jay-tech.de/jaytech/servlet/frontend/ - ######### - - regex: '; *(TPC-\d+|JAY-TECH)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Jaytech' - model_replacement: '$1' - - ######### - # Jiayu - # @ref: http://www.ejiayu.com/en/Product.html - ######### - - regex: '; *(JY-[^;/]+|G[234]S?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Jiayu' - model_replacement: '$1' - - ######### - # JXD - # @ref: http://www.jxd.hk/ - ######### - - regex: '; *(JXD)[ _\-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'JXD' - model_replacement: '$2' - - ######### - # Karbonn - # @ref: http://www.karbonnmobiles.com/products_tablet.php - ######### - - regex: '; *Karbonn[ _]?([^;/]+) *(?:Build|;)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Karbonn' - model_replacement: '$1' - - regex: '; *([^;]+) Build/Karbonn' - device_replacement: '$1' - brand_replacement: 'Karbonn' - model_replacement: '$1' - - regex: '; *(A11|A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2|Titanium S\d) +Build' - device_replacement: '$1' - brand_replacement: 'Karbonn' - model_replacement: '$1' - - ######### - # KDDI (Operator Branded Device) - # @ref: http://www.ipentec.com/document/document.aspx?page=android-useragent - ######### - - regex: '; *(IS01|IS03|IS05|IS\d{2}SH)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Sharp' - model_replacement: '$1' - - regex: '; *(IS04)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Regza' - model_replacement: '$1' - - regex: '; *(IS06|IS\d{2}PT)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Pantech' - model_replacement: '$1' - - regex: '; *(IS11S)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'SonyEricsson' - model_replacement: 'Xperia Acro' - - regex: '; *(IS11CA)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Casio' - model_replacement: 'GzOne $1' - - regex: '; *(IS11LG)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'LG' - model_replacement: 'Optimus X' - - regex: '; *(IS11N)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Medias' - model_replacement: '$1' - - regex: '; *(IS11PT)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Pantech' - model_replacement: 'MIRACH' - - regex: '; *(IS12F)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Fujitsu' - model_replacement: 'Arrows ES' - # @ref: https://ja.wikipedia.org/wiki/IS12M - - regex: '; *(IS12M)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Motorola' - model_replacement: 'XT909' - - regex: '; *(IS12S)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'SonyEricsson' - model_replacement: 'Xperia Acro HD' - - regex: '; *(ISW11F)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Fujitsu' - model_replacement: 'Arrowz Z' - - regex: '; *(ISW11HT)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'EVO' - - regex: '; *(ISW11K)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Kyocera' - model_replacement: 'DIGNO' - - regex: '; *(ISW11M)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Motorola' - model_replacement: 'Photon' - - regex: '; *(ISW11SC)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Samsung' - model_replacement: 'GALAXY S II WiMAX' - - regex: '; *(ISW12HT)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'EVO 3D' - - regex: '; *(ISW13HT)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'J' - - regex: '; *(ISW?[0-9]{2}[A-Z]{0,2})(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'KDDI' - model_replacement: '$1' - - regex: '; *(INFOBAR [^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'KDDI' - model_replacement: '$1' - - ######### - # Kingcom - # @ref: http://www.e-kingcom.com - ######### - - regex: '; *(JOYPAD|Joypad)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Kingcom' - model_replacement: '$1 $2' - - ######### - # Kobo - # @ref: https://en.wikipedia.org/wiki/Kobo_Inc. - # @ref: http://www.kobo.com/devices#tablets - ######### - - regex: '; *(Vox|VOX|Arc|K080)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Kobo' - model_replacement: '$1' - - regex: '\b(Kobo Touch)\b' - device_replacement: '$1' - brand_replacement: 'Kobo' - model_replacement: '$1' - - ######### - # K-Touch - # @ref: ?? - ######### - - regex: '; *(K-Touch)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'Ktouch' - model_replacement: '$2' - - ######### - # KT Tech - # @ref: http://www.kttech.co.kr - ######### - - regex: '; *((?:EV|KM)-S\d+[A-Z]?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'KTtech' - model_replacement: '$1' - - ######### - # Kyocera - # @ref: http://www.android.com/devices/?country=all&m=kyocera - ######### - - regex: '; *(Zio|Hydro|Torque|Event|EVENT|Echo|Milano|Rise|URBANO PROGRESSO|WX04K|WX06K|WX10K|KYL21|101K|C5[12]\d{2})(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Kyocera' - model_replacement: '$1' - - ######### - # Lava - # @ref: http://www.lavamobiles.com/ - ######### - - regex: '; *(?:LAVA[ _]|)IRIS[ _\-]?([^/;\)]+) *(?:;|\)|Build)' - regex_flag: 'i' - device_replacement: 'Iris $1' - brand_replacement: 'Lava' - model_replacement: 'Iris $1' - - regex: '; *LAVA[ _]([^;/]+) Build' - device_replacement: '$1' - brand_replacement: 'Lava' - model_replacement: '$1' - - ######### - # Lemon - # @ref: http://www.lemonmobiles.com/products.php?type=1 - ######### - - regex: '; *(?:(Aspire A1)|(?:LEMON|Lemon)[ _]([^;/]+))_?(?: Build|\) AppleWebKit)' - device_replacement: 'Lemon $1$2' - brand_replacement: 'Lemon' - model_replacement: '$1$2' - - ######### - # Lenco - # @ref: http://www.lenco.com/c/tablets/ - ######### - - regex: '; *(TAB-1012)(?: Build|\) AppleWebKit)' - device_replacement: 'Lenco $1' - brand_replacement: 'Lenco' - model_replacement: '$1' - - regex: '; Lenco ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Lenco $1' - brand_replacement: 'Lenco' - model_replacement: '$1' - - ######### - # Lenovo - # @ref: http://support.lenovo.com/en_GB/downloads/default.page?# - ######### - - regex: '; *(A1_07|A2107A-H|S2005A-H|S1-37AH0) Build' - device_replacement: '$1' - brand_replacement: 'Lenovo' - model_replacement: '$1' - - regex: '; *(Idea[Tp]ab)[ _]([^;/]+);? Build' - device_replacement: 'Lenovo $1 $2' - brand_replacement: 'Lenovo' - model_replacement: '$1 $2' - - regex: '; *(Idea(?:Tab|pad)) ?([^;/]+) Build' - device_replacement: 'Lenovo $1 $2' - brand_replacement: 'Lenovo' - model_replacement: '$1 $2' - - regex: '; *(ThinkPad) ?(Tablet) Build/' - device_replacement: 'Lenovo $1 $2' - brand_replacement: 'Lenovo' - model_replacement: '$1 $2' - - regex: '; *(?:LNV-|)(?:=?[Ll]enovo[ _\-]?|LENOVO[ _])(.+?)(?:Build|[;/\)])' - device_replacement: 'Lenovo $1' - brand_replacement: 'Lenovo' - model_replacement: '$1' - - regex: '[;,] (?:Vodafone |)(SmartTab) ?(II) ?(\d+) Build/' - device_replacement: 'Lenovo $1 $2 $3' - brand_replacement: 'Lenovo' - model_replacement: '$1 $2 $3' - - regex: '; *(?:Ideapad |)K1 Build/' - device_replacement: 'Lenovo Ideapad K1' - brand_replacement: 'Lenovo' - model_replacement: 'Ideapad K1' - - regex: '; *(3GC101|3GW10[01]|A390) Build/' - device_replacement: '$1' - brand_replacement: 'Lenovo' - model_replacement: '$1' - - regex: '\b(?:Lenovo|LENOVO)+[ _\-]?([^,;:/ ]+)' - device_replacement: 'Lenovo $1' - brand_replacement: 'Lenovo' - model_replacement: '$1' - - ######### - # Lexibook - # @ref: http://www.lexibook.com/fr - ######### - - regex: '; *(MFC\d+)[A-Z]{2}([^;,/]*),?(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Lexibook' - model_replacement: '$1$2' - - ######### - # LG - # @ref: http://www.lg.com/uk/mobile - ######### - - regex: '; *(E[34][0-9]{2}|LS[6-8][0-9]{2}|VS[6-9][0-9]+[^;/]+|Nexus 4|Nexus 5X?|GT540f?|Optimus (?:2X|G|4X HD)|OptimusX4HD) *(?:Build|;)' - device_replacement: '$1' - brand_replacement: 'LG' - model_replacement: '$1' - - regex: '[;:] *(L-\d+[A-Z]|LGL\d+[A-Z]?)(?:/V\d+|) *(?:Build|[;\)])' - device_replacement: '$1' - brand_replacement: 'LG' - model_replacement: '$1' - - regex: '; *(LG-)([A-Z]{1,2}\d{2,}[^,;/\)\(]*?)(?:Build| V\d+|[,;/\)\(]|$)' - device_replacement: '$1$2' - brand_replacement: 'LG' - model_replacement: '$2' - - regex: '; *(LG[ \-]|LG)([^;/]+)[;/]? Build' - device_replacement: '$1$2' - brand_replacement: 'LG' - model_replacement: '$2' - - regex: '^(LG)-([^;/]+)/ Mozilla/.*; Android' - device_replacement: '$1 $2' - brand_replacement: 'LG' - model_replacement: '$2' - - regex: '(Web0S); Linux/(SmartTV)' - device_replacement: 'LG $1 $2' - brand_replacement: 'LG' - model_replacement: '$1 $2' - - ######### - # Malata - # @ref: http://www.malata.com/en/products.aspx?classid=680 - ######### - - regex: '; *((?:SMB|smb)[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Malata' - model_replacement: '$1' - - regex: '; *(?:Malata|MALATA) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Malata' - model_replacement: '$1' - - ######### - # Manta - # @ref: http://www.manta.com.pl/en - ######### - - regex: '; *(MS[45][0-9]{3}|MID0[568][NS]?|MID[1-9]|MID[78]0[1-9]|MID970[1-9]|MID100[1-9])(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Manta' - model_replacement: '$1' - - ######### - # Match - # @ref: http://www.match.net.cn/products.asp - ######### - - regex: '; *(M1052|M806|M9000|M9100|M9701|MID100|MID120|MID125|MID130|MID135|MID140|MID701|MID710|MID713|MID727|MID728|MID731|MID732|MID733|MID735|MID736|MID737|MID760|MID800|MID810|MID820|MID830|MID833|MID835|MID860|MID900|MID930|MID933|MID960|MID980)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Match' - model_replacement: '$1' - - ######### - # Maxx - # @ref: http://www.maxxmobile.in/ - # @models: Maxx MSD7-Play, Maxx MX245+ Trance, Maxx AX8 Race, Maxx MSD7 3G- AX50, Maxx Genx Droid 7 - AX40, Maxx AX5 Duo, - # Maxx AX3 Duo, Maxx AX3, Maxx AX8 Note II (Note 2), Maxx AX8 Note I, Maxx AX8, Maxx AX5 Plus, Maxx MSD7 Smarty, - # Maxx AX9Z Race, - # Maxx MT150, Maxx MQ601, Maxx M2020, Maxx Sleek MX463neo, Maxx MX525, Maxx MX192-Tune, Maxx Genx Droid 7 AX353, - # @note: Need more User-Agents!!! - ######### - - regex: '; *(GenxDroid7|MSD7.*?|AX\d.*?|Tab 701|Tab 722)(?: Build|\) AppleWebKit)' - device_replacement: 'Maxx $1' - brand_replacement: 'Maxx' - model_replacement: '$1' - - ######### - # Mediacom - # @ref: http://www.mediacomeurope.it/ - ######### - - regex: '; *(M-PP[^;/]+|PhonePad ?\d{2,}[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Mediacom $1' - brand_replacement: 'Mediacom' - model_replacement: '$1' - - regex: '; *(M-MP[^;/]+|SmartPad ?\d{2,}[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Mediacom $1' - brand_replacement: 'Mediacom' - model_replacement: '$1' - - ######### - # Medion - # @ref: http://www.medion.com/en/ - ######### - - regex: '; *(?:MD_|)LIFETAB[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Medion Lifetab $1' - brand_replacement: 'Medion' - model_replacement: 'Lifetab $1' - - regex: '; *MEDION ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Medion $1' - brand_replacement: 'Medion' - model_replacement: '$1' - - ######### - # Meizu - # @ref: http://www.meizu.com - ######### - - regex: '; *(M030|M031|M035|M040|M065|m9)(?: Build|\) AppleWebKit)' - device_replacement: 'Meizu $1' - brand_replacement: 'Meizu' - model_replacement: '$1' - - regex: '; *(?:meizu_|MEIZU )(.+?) *(?:Build|[;\)])' - device_replacement: 'Meizu $1' - brand_replacement: 'Meizu' - model_replacement: '$1' - - ######### - # Micromax - # @ref: http://www.micromaxinfo.com - ######### - - regex: '; *(?:Micromax[ _](A111|A240)|(A111|A240)) Build' - regex_flag: 'i' - device_replacement: 'Micromax $1$2' - brand_replacement: 'Micromax' - model_replacement: '$1$2' - - regex: '; *Micromax[ _](A\d{2,3}[^;/]*) Build' - regex_flag: 'i' - device_replacement: 'Micromax $1' - brand_replacement: 'Micromax' - model_replacement: '$1' - # be carefull here with Acer e.g. A500 - - regex: '; *(A\d{2}|A[12]\d{2}|A90S|A110Q) Build' - regex_flag: 'i' - device_replacement: 'Micromax $1' - brand_replacement: 'Micromax' - model_replacement: '$1' - - regex: '; *Micromax[ _](P\d{3}[^;/]*) Build' - regex_flag: 'i' - device_replacement: 'Micromax $1' - brand_replacement: 'Micromax' - model_replacement: '$1' - - regex: '; *(P\d{3}|P\d{3}\(Funbook\)) Build' - regex_flag: 'i' - device_replacement: 'Micromax $1' - brand_replacement: 'Micromax' - model_replacement: '$1' - - ######### - # Mito - # @ref: http://new.mitomobile.com/ - ######### - - regex: '; *(MITO)[ _\-]?([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'Mito' - model_replacement: '$2' - - ######### - # Mobistel - # @ref: http://www.mobistel.com/ - ######### - - regex: '; *(Cynus)[ _](F5|T\d|.+?) *(?:Build|[;/\)])' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'Mobistel' - model_replacement: '$1 $2' - - ######### - # Modecom - # @ref: http://www.modecom.eu/tablets/portal/ - ######### - - regex: '; *(MODECOM |)(FreeTab) ?([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1$2 $3' - brand_replacement: 'Modecom' - model_replacement: '$2 $3' - - regex: '; *(MODECOM )([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'Modecom' - model_replacement: '$2' - - ######### - # Motorola - # @ref: http://www.motorola.com/us/shop-all-mobile-phones/ - ######### - - regex: '; *(MZ\d{3}\+?|MZ\d{3} 4G|Xoom|XOOM[^;/]*) Build' - device_replacement: 'Motorola $1' - brand_replacement: 'Motorola' - model_replacement: '$1' - - regex: '; *(Milestone )(XT[^;/]*) Build' - device_replacement: 'Motorola $1$2' - brand_replacement: 'Motorola' - model_replacement: '$2' - - regex: '; *(Motoroi ?x|Droid X|DROIDX) Build' - regex_flag: 'i' - device_replacement: 'Motorola $1' - brand_replacement: 'Motorola' - model_replacement: 'DROID X' - - regex: '; *(Droid[^;/]*|DROID[^;/]*|Milestone[^;/]*|Photon|Triumph|Devour|Titanium) Build' - device_replacement: 'Motorola $1' - brand_replacement: 'Motorola' - model_replacement: '$1' - - regex: '; *(A555|A85[34][^;/]*|A95[356]|ME[58]\d{2}\+?|ME600|ME632|ME722|MB\d{3}\+?|MT680|MT710|MT870|MT887|MT917|WX435|WX453|WX44[25]|XT\d{3,4}[A-Z\+]*|CL[iI]Q|CL[iI]Q XT) Build' - device_replacement: '$1' - brand_replacement: 'Motorola' - model_replacement: '$1' - - regex: '; *(Motorola MOT-|Motorola[ _\-]|MOT\-?)([^;/]+) Build' - device_replacement: '$1$2' - brand_replacement: 'Motorola' - model_replacement: '$2' - - regex: '; *(Moto[_ ]?|MOT\-)([^;/]+) Build' - device_replacement: '$1$2' - brand_replacement: 'Motorola' - model_replacement: '$2' - - ######### - # MpMan - # @ref: http://www.mpmaneurope.com - ######### - - regex: '; *((?:MP[DQ]C|MPG\d{1,4}|MP\d{3,4}|MID(?:(?:10[234]|114|43|7[247]|8[24]|7)C|8[01]1))[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Mpman' - model_replacement: '$1' - - ######### - # MSI - # @ref: http://www.msi.com/product/windpad/ - ######### - - regex: '; *(?:MSI[ _]|)(Primo\d+|Enjoy[ _\-][^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'Msi' - model_replacement: '$1' - - ######### - # Multilaser - # http://www.multilaser.com.br/listagem_produtos.php?cat=5 - ######### - - regex: '; *Multilaser[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Multilaser' - model_replacement: '$1' - - ######### - # MyPhone - # @ref: http://myphone.com.ph/ - ######### - - regex: '; *(My)[_]?(Pad)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2 $3' - brand_replacement: 'MyPhone' - model_replacement: '$1$2 $3' - - regex: '; *(My)\|?(Phone)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2 $3' - brand_replacement: 'MyPhone' - model_replacement: '$3' - - regex: '; *(A\d+)[ _](Duo|)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'MyPhone' - model_replacement: '$1 $2' - - ######### - # Mytab - # @ref: http://www.mytab.eu/en/category/mytab-products/ - ######### - - regex: '; *(myTab[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Mytab' - model_replacement: '$1' - - ######### - # Nabi - # @ref: https://www.nabitablet.com - ######### - - regex: '; *(NABI2?-)([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Nabi' - model_replacement: '$2' - - ######### - # Nec Medias - # @ref: http://www.n-keitai.com/ - ######### - - regex: '; *(N-\d+[CDE])(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Nec' - model_replacement: '$1' - - regex: '; ?(NEC-)(.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Nec' - model_replacement: '$2' - - regex: '; *(LT-NA7)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Nec' - model_replacement: 'Lifetouch Note' - - ######### - # Nextbook - # @ref: http://nextbookusa.com - ######### - - regex: '; *(NXM\d+[A-Za-z0-9_]*|Next\d[A-Za-z0-9_ \-]*|NEXT\d[A-Za-z0-9_ \-]*|Nextbook [A-Za-z0-9_ ]*|DATAM803HC|M805)(?: Build|[\);])' - device_replacement: '$1' - brand_replacement: 'Nextbook' - model_replacement: '$1' - - ######### - # Nokia - # @ref: http://www.nokia.com - ######### - - regex: '; *(Nokia)([ _\-]*)([^;/]*) Build' - regex_flag: 'i' - device_replacement: '$1$2$3' - brand_replacement: 'Nokia' - model_replacement: '$3' - - regex: '; *(TA\-\d{4})(?: Build|\) AppleWebKit)' - device_replacement: 'Nokia $1' - brand_replacement: 'Nokia' - model_replacement: '$1' - - ######### - # Nook - # @ref: - # TODO nook browser/1.0 - ######### - - regex: '; *(Nook ?|Barnes & Noble Nook |BN )([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Nook' - model_replacement: '$2' - - regex: '; *(NOOK |)(BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Nook' - model_replacement: '$2' - - regex: '; Build/(Nook)' - device_replacement: '$1' - brand_replacement: 'Nook' - model_replacement: 'Tablet' - - ######### - # Olivetti - # @ref: http://www.olivetti.de/EN/Page/t02/view_html?idp=348 - ######### - - regex: '; *(OP110|OliPad[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Olivetti $1' - brand_replacement: 'Olivetti' - model_replacement: '$1' - - ######### - # Omega - # @ref: http://omega-technology.eu/en/produkty/346/tablets - # @note: MID tablets might get matched by CobyKyros first - # @models: (T107|MID(?:700[2-5]|7031|7108|7132|750[02]|8001|8500|9001|971[12]) - ######### - - regex: '; *OMEGA[ _\-](MID[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Omega $1' - brand_replacement: 'Omega' - model_replacement: '$1' - - regex: '^(MID7500|MID\d+) Mozilla/5\.0 \(iPad;' - device_replacement: 'Omega $1' - brand_replacement: 'Omega' - model_replacement: '$1' - - ######### - # OpenPeak - # @ref: https://support.google.com/googleplay/answer/1727131?hl=en - ######### - - regex: '; *((?:CIUS|cius)[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'Openpeak $1' - brand_replacement: 'Openpeak' - model_replacement: '$1' - - ######### - # Oppo - # @ref: http://en.oppo.com/products/ - ######### - - regex: '; *(Find ?(?:5|7a)|R8[012]\d{1,2}|T703\d?|U70\d{1,2}T?|X90\d{1,2}|[AFR]\d{1,2}[a-z]{1,2})(?: Build|\) AppleWebKit)' - device_replacement: 'Oppo $1' - brand_replacement: 'Oppo' - model_replacement: '$1' - - regex: '; *OPPO ?([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Oppo $1' - brand_replacement: 'Oppo' - model_replacement: '$1' - - regex: '; *(CPH\d{1,4}|RMX\d{1,4}|P[A-Z]{3}\d{2})(?: Build|\) AppleWebKit)' - device_replacement: 'Oppo $1' - brand_replacement: 'Oppo' - - regex: '; *(A1601)(?: Build|\) AppleWebKit)' - device_replacement: 'Oppo F1s' - brand_replacement: 'Oppo' - model_replacement: '$1' - - ######### - # Odys - # @ref: http://odys.de - ######### - - regex: '; *(?:Odys\-|ODYS\-|ODYS )([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Odys $1' - brand_replacement: 'Odys' - model_replacement: '$1' - - regex: '; *(SELECT) ?(7)(?: Build|\) AppleWebKit)' - device_replacement: 'Odys $1 $2' - brand_replacement: 'Odys' - model_replacement: '$1 $2' - - regex: '; *(PEDI)_(PLUS)_(W)(?: Build|\) AppleWebKit)' - device_replacement: 'Odys $1 $2 $3' - brand_replacement: 'Odys' - model_replacement: '$1 $2 $3' - # Weltbild - Tablet PC 4 = Cat Phoenix = Odys Tablet PC 4? - - regex: '; *(AEON|BRAVIO|FUSION|FUSION2IN1|Genio|EOS10|IEOS[^;/]*|IRON|Loox|LOOX|LOOX Plus|Motion|NOON|NOON_PRO|NEXT|OPOS|PEDI[^;/]*|PRIME[^;/]*|STUDYTAB|TABLO|Tablet-PC-4|UNO_X8|XELIO[^;/]*|Xelio ?\d+ ?[Pp]ro|XENO10|XPRESS PRO)(?: Build|\) AppleWebKit)' - device_replacement: 'Odys $1' - brand_replacement: 'Odys' - model_replacement: '$1' - - ######### - # OnePlus - # @ref https://oneplus.net/ - ######### - - regex: '; (ONE [a-zA-Z]\d+)(?: Build|\) AppleWebKit)' - device_replacement: 'OnePlus $1' - brand_replacement: 'OnePlus' - model_replacement: '$1' - - regex: '; (ONEPLUS [a-zA-Z]\d+)(?: Build|\) AppleWebKit)' - device_replacement: 'OnePlus $1' - brand_replacement: 'OnePlus' - model_replacement: '$1' - - ######### - # Orion - # @ref: http://www.orion.ua/en/products/computer-products/tablet-pcs.html - ######### - - regex: '; *(TP-\d+)(?: Build|\) AppleWebKit)' - device_replacement: 'Orion $1' - brand_replacement: 'Orion' - model_replacement: '$1' - - ######### - # PackardBell - # @ref: http://www.packardbell.com/pb/en/AE/content/productgroup/tablets - ######### - - regex: '; *(G100W?)(?: Build|\) AppleWebKit)' - device_replacement: 'PackardBell $1' - brand_replacement: 'PackardBell' - model_replacement: '$1' - - ######### - # Panasonic - # @ref: http://panasonic.jp/mobile/ - # @models: T11, T21, T31, P11, P51, Eluga Power, Eluga DL1 - # @models: (tab) Toughpad FZ-A1, Toughpad JT-B1 - ######### - - regex: '; *(Panasonic)[_ ]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - # Toughpad - - regex: '; *(FZ-A1B|JT-B1)(?: Build|\) AppleWebKit)' - device_replacement: 'Panasonic $1' - brand_replacement: 'Panasonic' - model_replacement: '$1' - # Eluga Power - - regex: '; *(dL1|DL1)(?: Build|\) AppleWebKit)' - device_replacement: 'Panasonic $1' - brand_replacement: 'Panasonic' - model_replacement: '$1' - - ######### - # Pantech - # @href: http://www.pantech.co.kr/en/prod/prodList.do?gbrand=PANTECH - # @href: http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA - # @models: ADR8995, ADR910L, ADR930VW, C790, CDM8992, CDM8999, IS06, IS11PT, P2000, P2020, P2030, P4100, P5000, P6010, P6020, P6030, P7000, P7040, P8000, P8010, P9020, P9050, P9060, P9070, P9090, PT001, PT002, PT003, TXT8040, TXT8045, VEGA PTL21 - ######### - - regex: '; *(SKY[ _]|)(IM\-[AT]\d{3}[^;/]+).* Build/' - device_replacement: 'Pantech $1$2' - brand_replacement: 'Pantech' - model_replacement: '$1$2' - - regex: '; *((?:ADR8995|ADR910L|ADR930L|ADR930VW|PTL21|P8000)(?: 4G|)) Build/' - device_replacement: '$1' - brand_replacement: 'Pantech' - model_replacement: '$1' - - regex: '; *Pantech([^;/]+).* Build/' - device_replacement: 'Pantech $1' - brand_replacement: 'Pantech' - model_replacement: '$1' - - ######### - # Papayre - # @ref: http://grammata.es/ - ######### - - regex: '; *(papyre)[ _\-]([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'Papyre' - model_replacement: '$2' - - ######### - # Pearl - # @ref: http://www.pearl.de/c-1540.shtml - ######### - - regex: '; *(?:Touchlet )?(X10\.[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Pearl $1' - brand_replacement: 'Pearl' - model_replacement: '$1' - - ######### - # Phicomm - # @ref: http://www.phicomm.com.cn/ - ######### - - regex: '; PHICOMM (i800)(?: Build|\) AppleWebKit)' - device_replacement: 'Phicomm $1' - brand_replacement: 'Phicomm' - model_replacement: '$1' - - regex: '; PHICOMM ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Phicomm $1' - brand_replacement: 'Phicomm' - model_replacement: '$1' - - regex: '; *(FWS\d{3}[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Phicomm $1' - brand_replacement: 'Phicomm' - model_replacement: '$1' - - ######### - # Philips - # @ref: http://www.support.philips.com/support/catalog/products.jsp?_dyncharset=UTF-8&country=&categoryid=MOBILE_PHONES_SMART_SU_CN_CARE&userLanguage=en&navCount=2&groupId=PC_PRODUCTS_AND_PHONES_GR_CN_CARE&catalogType=&navAction=push&userCountry=cn&title=Smartphones&cateId=MOBILE_PHONES_CA_CN_CARE - # @TODO: Philips Tablets User-Agents missing! - # @ref: http://www.support.philips.com/support/catalog/products.jsp?_dyncharset=UTF-8&country=&categoryid=ENTERTAINMENT_TABLETS_SU_CN_CARE&userLanguage=en&navCount=0&groupId=&catalogType=&navAction=push&userCountry=cn&title=Entertainment+Tablets&cateId=TABLETS_CA_CN_CARE - ######### - # @note: this a best guess according to available philips models. Need more User-Agents - - regex: '; *(D633|D822|D833|T539|T939|V726|W335|W336|W337|W3568|W536|W5510|W626|W632|W6350|W6360|W6500|W732|W736|W737|W7376|W820|W832|W8355|W8500|W8510|W930)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Philips' - model_replacement: '$1' - - regex: '; *(?:Philips|PHILIPS)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Philips $1' - brand_replacement: 'Philips' - model_replacement: '$1' - - ######### - # Pipo - # @ref: http://www.pipo.cn/En/ - ######### - - regex: 'Android 4\..*; *(M[12356789]|U[12368]|S[123])\ ?(pro)?(?: Build|\) AppleWebKit)' - device_replacement: 'Pipo $1$2' - brand_replacement: 'Pipo' - model_replacement: '$1$2' - - ######### - # Ployer - # @ref: http://en.ployer.cn/ - ######### - - regex: '; *(MOMO[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Ployer' - model_replacement: '$1' - - ######### - # Polaroid/ Acho - # @ref: http://polaroidstore.com/store/start.asp?category_id=382&category_id2=0&order=title&filter1=&filter2=&filter3=&view=all - ######### - - regex: '; *(?:Polaroid[ _]|)((?:MIDC\d{3,}|PMID\d{2,}|PTAB\d{3,})[^;/]*?)(\/[^;/]*|)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Polaroid' - model_replacement: '$1' - - regex: '; *(?:Polaroid )(Tablet)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Polaroid' - model_replacement: '$1' - - ######### - # Pomp - # @ref: http://pompmobileshop.com/ - ######### - #~ TODO - - regex: '; *(POMP)[ _\-](.+?) *(?:Build|[;/\)])' - device_replacement: '$1 $2' - brand_replacement: 'Pomp' - model_replacement: '$2' - - ######### - # Positivo - # @ref: http://www.positivoinformatica.com.br/www/pessoal/tablet-ypy/ - ######### - - regex: '; *(TB07STA|TB10STA|TB07FTA|TB10FTA)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Positivo' - model_replacement: '$1' - - regex: '; *(?:Positivo |)((?:YPY|Ypy)[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Positivo' - model_replacement: '$1' - - ######### - # POV - # @ref: http://www.pointofview-online.com/default2.php - # @TODO: Smartphone Models MOB-3515, MOB-5045-B missing - ######### - - regex: '; *(MOB-[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'POV' - model_replacement: '$1' - - regex: '; *POV[ _\-]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'POV $1' - brand_replacement: 'POV' - model_replacement: '$1' - - regex: '; *((?:TAB-PLAYTAB|TAB-PROTAB|PROTAB|PlayTabPro|Mobii[ _\-]|TAB-P)[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'POV $1' - brand_replacement: 'POV' - model_replacement: '$1' - - ######### - # Prestigio - # @ref: http://www.prestigio.com/catalogue/MultiPhones - # @ref: http://www.prestigio.com/catalogue/MultiPads - ######### - - regex: '; *(?:Prestigio |)((?:PAP|PMP)\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Prestigio $1' - brand_replacement: 'Prestigio' - model_replacement: '$1' - - ######### - # Proscan - # @ref: http://www.proscanvideo.com/products-search.asp?itemClass=TABLET&itemnmbr= - ######### - - regex: '; *(PLT[0-9]{4}.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Proscan' - model_replacement: '$1' - - ######### - # QMobile - # @ref: http://www.qmobile.com.pk/ - ######### - - regex: '; *(A2|A5|A8|A900)_?(Classic|)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Qmobile' - model_replacement: '$1 $2' - - regex: '; *(Q[Mm]obile)_([^_]+)_([^_]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Qmobile $2 $3' - brand_replacement: 'Qmobile' - model_replacement: '$2 $3' - - regex: '; *(Q\-?[Mm]obile)[_ ](A[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Qmobile $2' - brand_replacement: 'Qmobile' - model_replacement: '$2' - - ######### - # Qmobilevn - # @ref: http://qmobile.vn/san-pham.html - ######### - - regex: '; *(Q\-Smart)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Qmobilevn' - model_replacement: '$2' - - regex: '; *(Q\-?[Mm]obile)[ _\-](S[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Qmobilevn' - model_replacement: '$2' - - ######### - # Quanta - # @ref: ? - ######### - - regex: '; *(TA1013)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Quanta' - model_replacement: '$1' - - ######### - # RCA - # @ref: http://rcamobilephone.com/ - ######### - - regex: '; (RCT\w+)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'RCA' - model_replacement: '$1' - - regex: '; RCA (\w+)(?: Build|\) AppleWebKit)' - device_replacement: 'RCA $1' - brand_replacement: 'RCA' - model_replacement: '$1' - - ######### - # Rockchip - # @ref: http://www.rock-chips.com/a/cn/product/index.html - # @note: manufacturer sells chipsets - I assume that these UAs are dev-boards - ######### - - regex: '; *(RK\d+),?(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Rockchip' - model_replacement: '$1' - - regex: ' Build/(RK\d+)' - device_replacement: '$1' - brand_replacement: 'Rockchip' - model_replacement: '$1' - - ######### - # Samsung Android Devices - # @ref: http://www.samsung.com/us/mobile/cell-phones/all-products - ######### - - regex: '; *(SAMSUNG |Samsung |)((?:Galaxy (?:Note II|S\d)|GT-I9082|GT-I9205|GT-N7\d{3}|SM-N9005)[^;/]*)\/?[^;/]* Build/' - device_replacement: 'Samsung $1$2' - brand_replacement: 'Samsung' - model_replacement: '$2' - - regex: '; *(Google |)(Nexus [Ss](?: 4G|)) Build/' - device_replacement: 'Samsung $1$2' - brand_replacement: 'Samsung' - model_replacement: '$2' - - regex: '; *(SAMSUNG |Samsung )([^\/]*)\/[^ ]* Build/' - device_replacement: 'Samsung $2' - brand_replacement: 'Samsung' - model_replacement: '$2' - - regex: '; *(Galaxy(?: Ace| Nexus| S ?II+|Nexus S| with MCR 1.2| Mini Plus 4G|)) Build/' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: '; *(SAMSUNG[ _\-]|)(?:SAMSUNG[ _\-])([^;/]+) Build' - device_replacement: 'Samsung $2' - brand_replacement: 'Samsung' - model_replacement: '$2' - - regex: '; *(SAMSUNG-|)(GT\-[BINPS]\d{4}[^\/]*)(\/[^ ]*) Build' - device_replacement: 'Samsung $1$2$3' - brand_replacement: 'Samsung' - model_replacement: '$2' - - regex: '(?:; *|^)((?:GT\-[BIiNPS]\d{4}|I9\d{2}0[A-Za-z\+]?\b)[^;/\)]*?)(?:Build|Linux|MIUI|[;/\)])' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: '; (SAMSUNG-)([A-Za-z0-9\-]+).* Build/' - device_replacement: 'Samsung $1$2' - brand_replacement: 'Samsung' - model_replacement: '$2' - - regex: '; *((?:SCH|SGH|SHV|SHW|SPH|SC|SM)\-[A-Za-z0-9 ]+)(/?[^ ]*|) Build' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: '; *((?:SC)\-[A-Za-z0-9 ]+)(/?[^ ]*|)\)' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: ' ((?:SCH)\-[A-Za-z0-9 ]+)(/?[^ ]*|) Build' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: '; *(Behold ?(?:2|II)|YP\-G[^;/]+|EK-GC100|SCL21|I9300) Build' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: '; *((?:SCH|SGH|SHV|SHW|SPH|SC|SM)\-[A-Za-z0-9]{5,6})[\)]' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - ######### - # Sharp - # @ref: http://www.sharp-phone.com/en/index.html - # @ref: http://www.android.com/devices/?country=all&m=sharp - ######### - - regex: '; *(SH\-?\d\d[^;/]+|SBM\d[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Sharp' - model_replacement: '$1' - - regex: '; *(SHARP[ -])([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Sharp' - model_replacement: '$2' - - ######### - # Simvalley - # @ref: http://www.simvalley-mobile.de/ - ######### - - regex: '; *(SPX[_\-]\d[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Simvalley' - model_replacement: '$1' - - regex: '; *(SX7\-PEARL\.GmbH)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Simvalley' - model_replacement: '$1' - - regex: '; *(SP[T]?\-\d{2}[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Simvalley' - model_replacement: '$1' - - ######### - # SK Telesys - # @ref: http://www.sk-w.com/phone/phone_list.jsp - # @ref: http://www.android.com/devices/?country=all&m=sk-telesys - ######### - - regex: '; *(SK\-.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'SKtelesys' - model_replacement: '$1' - - ######### - # Skytex - # @ref: http://skytex.com/android - ######### - - regex: '; *(?:SKYTEX|SX)-([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Skytex' - model_replacement: '$1' - - regex: '; *(IMAGINE [^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Skytex' - model_replacement: '$1' - - ######### - # SmartQ - # @ref: http://en.smartdevices.com.cn/Products/ - # @models: Z8, X7, U7H, U7, T30, T20, Ten3, V5-II, T7-3G, SmartQ5, K7, S7, Q8, T19, Ten2, Ten, R10, T7, R7, V5, V7, SmartQ7 - ######### - - regex: '; *(SmartQ) ?([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # Smartbitt - # @ref: http://www.smartbitt.com/ - # @missing: SBT Useragents - ######### - - regex: '; *(WF7C|WF10C|SBT[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Smartbitt' - model_replacement: '$1' - - ######### - # Softbank (Operator Branded Devices) - # @ref: http://www.ipentec.com/document/document.aspx?page=android-useragent - ######### - - regex: '; *(SBM(?:003SH|005SH|006SH|007SH|102SH)) Build' - device_replacement: '$1' - brand_replacement: 'Sharp' - model_replacement: '$1' - - regex: '; *(003P|101P|101P11C|102P) Build' - device_replacement: '$1' - brand_replacement: 'Panasonic' - model_replacement: '$1' - - regex: '; *(00\dZ) Build/' - device_replacement: '$1' - brand_replacement: 'ZTE' - model_replacement: '$1' - - regex: '; HTC(X06HT) Build' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: '$1' - - regex: '; *(001HT|X06HT) Build' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: '$1' - - regex: '; *(201M) Build' - device_replacement: '$1' - brand_replacement: 'Motorola' - model_replacement: 'XT902' - - ######### - # Trekstor - # @ref: http://www.trekstor.co.uk/surftabs-en.html - # @note: Must come before SonyEricsson - ######### - - regex: '; *(ST\d{4}.*)Build/ST' - device_replacement: 'Trekstor $1' - brand_replacement: 'Trekstor' - model_replacement: '$1' - - regex: '; *(ST\d{4}.*?)(?: Build|\) AppleWebKit)' - device_replacement: 'Trekstor $1' - brand_replacement: 'Trekstor' - model_replacement: '$1' - - ######### - # SonyEricsson - # @note: Must come before nokia since they also use symbian - # @ref: http://www.android.com/devices/?country=all&m=sony-ericssons - # @TODO: type! - ######### - # android matchers - - regex: '; *(Sony ?Ericsson ?)([^;/]+) Build' - device_replacement: '$1$2' - brand_replacement: 'SonyEricsson' - model_replacement: '$2' - - regex: '; *((?:SK|ST|E|X|LT|MK|MT|WT)\d{2}[a-z0-9]*(?:-o|)|R800i|U20i) Build' - device_replacement: '$1' - brand_replacement: 'SonyEricsson' - model_replacement: '$1' - # TODO X\d+ is wrong - - regex: '; *(Xperia (?:A8|Arc|Acro|Active|Live with Walkman|Mini|Neo|Play|Pro|Ray|X\d+)[^;/]*) Build' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'SonyEricsson' - model_replacement: '$1' - - ######### - # Sony - # @ref: http://www.sonymobile.co.jp/index.html - # @ref: http://www.sonymobile.com/global-en/products/phones/ - # @ref: http://www.sony.jp/tablet/ - ######### - - regex: '; Sony (Tablet[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Sony $1' - brand_replacement: 'Sony' - model_replacement: '$1' - - regex: '; Sony ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Sony $1' - brand_replacement: 'Sony' - model_replacement: '$1' - - regex: '; *(Sony)([A-Za-z0-9\-]+)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - regex: '; *(Xperia [^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Sony' - model_replacement: '$1' - - regex: '; *(C(?:1[0-9]|2[0-9]|53|55|6[0-9])[0-9]{2}|D[25]\d{3}|D6[56]\d{2})(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Sony' - model_replacement: '$1' - - regex: '; *(SGP\d{3}|SGPT\d{2})(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Sony' - model_replacement: '$1' - - regex: '; *(NW-Z1000Series)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Sony' - model_replacement: '$1' - - ########## - # Sony PlayStation - # @ref: http://playstation.com - # The Vita spoofs the Kindle - ########## - - regex: 'PLAYSTATION 3' - device_replacement: 'PlayStation 3' - brand_replacement: 'Sony' - model_replacement: 'PlayStation 3' - - regex: '(PlayStation (?:Portable|Vita|\d+))' - device_replacement: '$1' - brand_replacement: 'Sony' - model_replacement: '$1' - - ######### - # Spice - # @ref: http://www.spicemobilephones.co.in/ - ######### - - regex: '; *((?:CSL_Spice|Spice|SPICE|CSL)[ _\-]?|)([Mm][Ii])([ _\-]|)(\d{3}[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2$3$4' - brand_replacement: 'Spice' - model_replacement: 'Mi$4' - - ######### - # Sprint (Operator Branded Devices) - # @ref: - ######### - - regex: '; *(Sprint )(.+?) *(?:Build|[;/])' - device_replacement: '$1$2' - brand_replacement: 'Sprint' - model_replacement: '$2' - - regex: '\b(Sprint)[: ]([^;,/ ]+)' - device_replacement: '$1$2' - brand_replacement: 'Sprint' - model_replacement: '$2' - - ######### - # Tagi - # @ref: ?? - ######### - - regex: '; *(TAGI[ ]?)(MID) ?([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2$3' - brand_replacement: 'Tagi' - model_replacement: '$2$3' - - ######### - # Tecmobile - # @ref: http://www.tecmobile.com/ - ######### - - regex: '; *(Oyster500|Opal 800)(?: Build|\) AppleWebKit)' - device_replacement: 'Tecmobile $1' - brand_replacement: 'Tecmobile' - model_replacement: '$1' - - ######### - # Tecno - # @ref: www.tecno-mobile.com/‎ - ######### - - regex: '; *(TECNO[ _])([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Tecno' - model_replacement: '$2' - - ######### - # Telechips, Techvision evaluation boards - # @ref: - ######### - - regex: '; *Android for (Telechips|Techvision) ([^ ]+) ' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # Telstra - # @ref: http://www.telstra.com.au/home-phone/thub-2/ - # @ref: https://support.google.com/googleplay/answer/1727131?hl=en - ######### - - regex: '; *(T-Hub2)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Telstra' - model_replacement: '$1' - - ######### - # Terra - # @ref: http://www.wortmann.de/ - ######### - - regex: '; *(PAD) ?(100[12])(?: Build|\) AppleWebKit)' - device_replacement: 'Terra $1$2' - brand_replacement: 'Terra' - model_replacement: '$1$2' - - ######### - # Texet - # @ref: http://www.texet.ru/tablet/ - ######### - - regex: '; *(T[BM]-\d{3}[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Texet' - model_replacement: '$1' - - ######### - # Thalia - # @ref: http://www.thalia.de/shop/tolino-shine-ereader/show/ - ######### - - regex: '; *(tolino [^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Thalia' - model_replacement: '$1' - - regex: '; *Build/.* (TOLINO_BROWSER)' - device_replacement: '$1' - brand_replacement: 'Thalia' - model_replacement: 'Tolino Shine' - - ######### - # Thl - # @ref: http://en.thl.com.cn/Mobile - # @ref: http://thlmobilestore.com - ######### - - regex: '; *(?:CJ[ -])?(ThL|THL)[ -]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Thl' - model_replacement: '$2' - - regex: '; *(T100|T200|T5|W100|W200|W8s)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Thl' - model_replacement: '$1' - - ######### - # T-Mobile (Operator Branded Devices) - ######### - # @ref: https://en.wikipedia.org/wiki/HTC_Hero - - regex: '; *(T-Mobile[ _]G2[ _]Touch) Build' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'Hero' - # @ref: https://en.wikipedia.org/wiki/HTC_Desire_Z - - regex: '; *(T-Mobile[ _]G2) Build' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'Desire Z' - - regex: '; *(T-Mobile myTouch Q) Build' - device_replacement: '$1' - brand_replacement: 'Huawei' - model_replacement: 'U8730' - - regex: '; *(T-Mobile myTouch) Build' - device_replacement: '$1' - brand_replacement: 'Huawei' - model_replacement: 'U8680' - - regex: '; *(T-Mobile_Espresso) Build' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'Espresso' - - regex: '; *(T-Mobile G1) Build' - device_replacement: '$1' - brand_replacement: 'HTC' - model_replacement: 'Dream' - - regex: '\b(T-Mobile ?|)(myTouch)[ _]?([34]G)[ _]?([^\/]*) (?:Mozilla|Build)' - device_replacement: '$1$2 $3 $4' - brand_replacement: 'HTC' - model_replacement: '$2 $3 $4' - - regex: '\b(T-Mobile)_([^_]+)_(.*) Build' - device_replacement: '$1 $2 $3' - brand_replacement: 'Tmobile' - model_replacement: '$2 $3' - - regex: '\b(T-Mobile)[_ ]?(.*?)Build' - device_replacement: '$1 $2' - brand_replacement: 'Tmobile' - model_replacement: '$2' - - ######### - # Tomtec - # @ref: http://www.tom-tec.eu/pages/tablets.php - ######### - - regex: ' (ATP[0-9]{4})(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Tomtec' - model_replacement: '$1' - - ######### - # Tooky - # @ref: http://www.tookymobile.com/ - ######### - - regex: ' *(TOOKY)[ _\-]([^;/]+?) ?(?:Build|;)' - regex_flag: 'i' - device_replacement: '$1 $2' - brand_replacement: 'Tooky' - model_replacement: '$2' - - ######### - # Toshiba - # @ref: http://www.toshiba.co.jp/ - # @missing: LT170, Thrive 7, TOSHIBA STB10 - ######### - - regex: '\b(TOSHIBA_AC_AND_AZ|TOSHIBA_FOLIO_AND_A|FOLIO_AND_A)' - device_replacement: '$1' - brand_replacement: 'Toshiba' - model_replacement: 'Folio 100' - - regex: '; *([Ff]olio ?100)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Toshiba' - model_replacement: 'Folio 100' - - regex: '; *(AT[0-9]{2,3}(?:\-A|LE\-A|PE\-A|SE|a|)|AT7-A|AT1S0|Hikari-iFrame/WDPF-[^;/]+|THRiVE|Thrive)(?: Build|\) AppleWebKit)' - device_replacement: 'Toshiba $1' - brand_replacement: 'Toshiba' - model_replacement: '$1' - - ######### - # Touchmate - # @ref: http://touchmatepc.com/new/ - ######### - - regex: '; *(TM-MID\d+[^;/]+|TOUCHMATE|MID-750)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Touchmate' - model_replacement: '$1' - # @todo: needs verification user-agents missing - - regex: '; *(TM-SM\d+[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Touchmate' - model_replacement: '$1' - - ######### - # Treq - # @ref: http://www.treq.co.id/product - ######### - - regex: '; *(A10 [Bb]asic2?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Treq' - model_replacement: '$1' - - regex: '; *(TREQ[ _\-])([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1$2' - brand_replacement: 'Treq' - model_replacement: '$2' - - ######### - # Umeox - # @ref: http://umeox.com/ - # @models: A936|A603|X-5|X-3 - ######### - # @todo: guessed markers - - regex: '; *(X-?5|X-?3)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Umeox' - model_replacement: '$1' - # @todo: guessed markers - - regex: '; *(A502\+?|A936|A603|X1|X2)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Umeox' - model_replacement: '$1' - - ######### - # Versus - # @ref: http://versusuk.com/support.html - ######### - - regex: '(TOUCH(?:TAB|PAD).+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Versus $1' - brand_replacement: 'Versus' - model_replacement: '$1' - - ######### - # Vertu - # @ref: http://www.vertu.com/ - ######### - - regex: '(VERTU) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'Vertu' - model_replacement: '$2' - - ######### - # Videocon - # @ref: http://www.videoconmobiles.com - ######### - - regex: '; *(Videocon)[ _\-]([^;/]+?) *(?:Build|;)' - device_replacement: '$1 $2' - brand_replacement: 'Videocon' - model_replacement: '$2' - - regex: ' (VT\d{2}[A-Za-z]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Videocon' - model_replacement: '$1' - - ######### - # Viewsonic - # @ref: http://viewsonic.com - ######### - - regex: '; *((?:ViewPad|ViewPhone|VSD)[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Viewsonic' - model_replacement: '$1' - - regex: '; *(ViewSonic-)([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'Viewsonic' - model_replacement: '$2' - - regex: '; *(GTablet.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Viewsonic' - model_replacement: '$1' - - ######### - # vivo - # @ref: http://vivo.cn/ - ######### - - regex: '; *([Vv]ivo)[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'vivo' - model_replacement: '$2' - - ######### - # Vodafone (Operator Branded Devices) - # @ref: ?? - ######### - - regex: '(Vodafone) (.*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # Walton - # @ref: http://www.waltonbd.com/ - ######### - - regex: '; *(?:Walton[ _\-]|)(Primo[ _\-][^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Walton $1' - brand_replacement: 'Walton' - model_replacement: '$1' - - ######### - # Wiko - # @ref: http://fr.wikomobile.com/collection.php?s=Smartphones - ######### - - regex: '; *(?:WIKO[ \-]|)(CINK\+?|BARRY|BLOOM|DARKFULL|DARKMOON|DARKNIGHT|DARKSIDE|FIZZ|HIGHWAY|IGGY|OZZY|RAINBOW|STAIRWAY|SUBLIM|WAX|CINK [^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Wiko $1' - brand_replacement: 'Wiko' - model_replacement: '$1' - - ######### - # WellcoM - # @ref: ?? - ######### - - regex: '; *WellcoM-([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Wellcom $1' - brand_replacement: 'Wellcom' - model_replacement: '$1' - - ########## - # WeTab - # @ref: http://wetab.mobi/ - ########## - - regex: '(?:(WeTab)-Browser|; (wetab) Build)' - device_replacement: '$1' - brand_replacement: 'WeTab' - model_replacement: 'WeTab' - - ######### - # Wolfgang - # @ref: http://wolfgangmobile.com/ - ######### - - regex: '; *(AT-AS[^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Wolfgang $1' - brand_replacement: 'Wolfgang' - model_replacement: '$1' - - ######### - # Woxter - # @ref: http://www.woxter.es/es-es/categories/index - ######### - - regex: '; *(?:Woxter|Wxt) ([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'Woxter $1' - brand_replacement: 'Woxter' - model_replacement: '$1' - - ######### - # Yarvik Zania - # @ref: http://yarvik.com - ######### - - regex: '; *(?:Xenta |Luna |)(TAB[234][0-9]{2}|TAB0[78]-\d{3}|TAB0?9-\d{3}|TAB1[03]-\d{3}|SMP\d{2}-\d{3})(?: Build|\) AppleWebKit)' - device_replacement: 'Yarvik $1' - brand_replacement: 'Yarvik' - model_replacement: '$1' - - ######### - # Yifang - # @note: Needs to be at the very last as manufacturer builds for other brands. - # @ref: http://www.yifangdigital.com/ - # @models: M1010, M1011, M1007, M1008, M1005, M899, M899LP, M909, M8000, - # M8001, M8002, M8003, M849, M815, M816, M819, M805, M878, M780LPW, - # M778, M7000, M7000AD, M7000NBD, M7001, M7002, M7002KBD, M777, M767, - # M789, M799, M769, M757, M755, M753, M752, M739, M729, M723, M712, M727 - ######### - - regex: '; *([A-Z]{2,4})(M\d{3,}[A-Z]{2})([^;\)\/]*)(?: Build|[;\)])' - device_replacement: 'Yifang $1$2$3' - brand_replacement: 'Yifang' - model_replacement: '$2' - - ######### - # XiaoMi - # @ref: http://www.xiaomi.com/event/buyphone - ######### - - regex: '; *((Mi|MI|HM|MI-ONE|Redmi)[ -](NOTE |Note |)[^;/]*) (Build|MIUI)/' - device_replacement: 'XiaoMi $1' - brand_replacement: 'XiaoMi' - model_replacement: '$1' - - regex: '; *((Mi|MI|HM|MI-ONE|Redmi)[ -](NOTE |Note |)[^;/\)]*)' - device_replacement: 'XiaoMi $1' - brand_replacement: 'XiaoMi' - model_replacement: '$1' - - regex: '; *(MIX) (Build|MIUI)/' - device_replacement: 'XiaoMi $1' - brand_replacement: 'XiaoMi' - model_replacement: '$1' - - regex: '; *((MIX) ([^;/]*)) (Build|MIUI)/' - device_replacement: 'XiaoMi $1' - brand_replacement: 'XiaoMi' - model_replacement: '$1' - - ######### - # Xolo - # @ref: http://www.xolo.in/ - ######### - - regex: '; *XOLO[ _]([^;/]*tab.*)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Xolo $1' - brand_replacement: 'Xolo' - model_replacement: '$1' - - regex: '; *XOLO[ _]([^;/]+?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Xolo $1' - brand_replacement: 'Xolo' - model_replacement: '$1' - - regex: '; *(q\d0{2,3}[a-z]?)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: 'Xolo $1' - brand_replacement: 'Xolo' - model_replacement: '$1' - - ######### - # Xoro - # @ref: http://www.xoro.de/produkte/ - ######### - - regex: '; *(PAD ?[79]\d+[^;/]*|TelePAD\d+[^;/])(?: Build|\) AppleWebKit)' - device_replacement: 'Xoro $1' - brand_replacement: 'Xoro' - model_replacement: '$1' - - ######### - # Zopo - # @ref: http://www.zopomobiles.com/products.html - ######### - - regex: '; *(?:(?:ZOPO|Zopo)[ _]([^;/]+?)|(ZP ?(?:\d{2}[^;/]+|C2))|(C[2379]))(?: Build|\) AppleWebKit)' - device_replacement: '$1$2$3' - brand_replacement: 'Zopo' - model_replacement: '$1$2$3' - - ######### - # ZiiLabs - # @ref: http://www.ziilabs.com/products/platforms/androidreferencetablets.php - ######### - - regex: '; *(ZiiLABS) (Zii[^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'ZiiLabs' - model_replacement: '$2' - - regex: '; *(Zii)_([^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'ZiiLabs' - model_replacement: '$2' - - ######### - # ZTE - # @ref: http://www.ztedevices.com/ - ######### - - regex: '; *(ARIZONA|(?:ATLAS|Atlas) W|D930|Grand (?:[SX][^;]*?|Era|Memo[^;]*?)|JOE|(?:Kis|KIS)\b[^;]*?|Libra|Light [^;]*?|N8[056][01]|N850L|N8000|N9[15]\d{2}|N9810|NX501|Optik|(?:Vip )Racer[^;]*?|RacerII|RACERII|San Francisco[^;]*?|V9[AC]|V55|V881|Z[679][0-9]{2}[A-z]?)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'ZTE' - model_replacement: '$1' - - regex: '; *([A-Z]\d+)_USA_[^;]*(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'ZTE' - model_replacement: '$1' - - regex: '; *(SmartTab\d+)[^;]*(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'ZTE' - model_replacement: '$1' - - regex: '; *(?:Blade|BLADE|ZTE-BLADE)([^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'ZTE Blade$1' - brand_replacement: 'ZTE' - model_replacement: 'Blade$1' - - regex: '; *(?:Skate|SKATE|ZTE-SKATE)([^;/]*)(?: Build|\) AppleWebKit)' - device_replacement: 'ZTE Skate$1' - brand_replacement: 'ZTE' - model_replacement: 'Skate$1' - - regex: '; *(Orange |Optimus )(Monte Carlo|San Francisco)(?: Build|\) AppleWebKit)' - device_replacement: '$1$2' - brand_replacement: 'ZTE' - model_replacement: '$1$2' - - regex: '; *(?:ZXY-ZTE_|ZTE\-U |ZTE[\- _]|ZTE-C[_ ])([^;/]+?)(?: Build|\) AppleWebKit)' - device_replacement: 'ZTE $1' - brand_replacement: 'ZTE' - model_replacement: '$1' - # operator specific - - regex: '; (BASE) (lutea|Lutea 2|Tab[^;]*?)(?: Build|\) AppleWebKit)' - device_replacement: '$1 $2' - brand_replacement: 'ZTE' - model_replacement: '$1 $2' - - regex: '; (Avea inTouch 2|soft stone|tmn smart a7|Movistar[ _]Link)(?: Build|\) AppleWebKit)' - regex_flag: 'i' - device_replacement: '$1' - brand_replacement: 'ZTE' - model_replacement: '$1' - - regex: '; *(vp9plus)\)' - device_replacement: '$1' - brand_replacement: 'ZTE' - model_replacement: '$1' - - ########## - # Zync - # @ref: http://www.zync.in/index.php/our-products/tablet-phablets - ########## - - regex: '; ?(Cloud[ _]Z5|z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900)(?: Build|\) AppleWebKit)' - device_replacement: '$1' - brand_replacement: 'Zync' - model_replacement: '$1' - - ########## - # Kindle - # @note: Needs to be after Sony Playstation Vita as this UA contains Silk/3.2 - # @ref: https://developer.amazon.com/sdk/fire/specifications.html - # @ref: http://amazonsilk.wordpress.com/useful-bits/silk-user-agent/ - ########## - - regex: '; ?(KFOT|Kindle Fire) Build\b' - device_replacement: 'Kindle Fire' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire' - - regex: '; ?(KFOTE|Amazon Kindle Fire2) Build\b' - device_replacement: 'Kindle Fire 2' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire 2' - - regex: '; ?(KFTT) Build\b' - device_replacement: 'Kindle Fire HD' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HD 7"' - - regex: '; ?(KFJWI) Build\b' - device_replacement: 'Kindle Fire HD 8.9" WiFi' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HD 8.9" WiFi' - - regex: '; ?(KFJWA) Build\b' - device_replacement: 'Kindle Fire HD 8.9" 4G' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HD 8.9" 4G' - - regex: '; ?(KFSOWI) Build\b' - device_replacement: 'Kindle Fire HD 7" WiFi' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HD 7" WiFi' - - regex: '; ?(KFTHWI) Build\b' - device_replacement: 'Kindle Fire HDX 7" WiFi' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HDX 7" WiFi' - - regex: '; ?(KFTHWA) Build\b' - device_replacement: 'Kindle Fire HDX 7" 4G' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HDX 7" 4G' - - regex: '; ?(KFAPWI) Build\b' - device_replacement: 'Kindle Fire HDX 8.9" WiFi' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HDX 8.9" WiFi' - - regex: '; ?(KFAPWA) Build\b' - device_replacement: 'Kindle Fire HDX 8.9" 4G' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire HDX 8.9" 4G' - - regex: '; ?Amazon ([^;/]+) Build\b' - device_replacement: '$1' - brand_replacement: 'Amazon' - model_replacement: '$1' - - regex: '; ?(Kindle) Build\b' - device_replacement: 'Kindle' - brand_replacement: 'Amazon' - model_replacement: 'Kindle' - - regex: '; ?(Silk)/(\d+)\.(\d+)(?:\.([0-9\-]+)|) Build\b' - device_replacement: 'Kindle Fire' - brand_replacement: 'Amazon' - model_replacement: 'Kindle Fire$2' - - regex: ' (Kindle)/(\d+\.\d+)' - device_replacement: 'Kindle' - brand_replacement: 'Amazon' - model_replacement: '$1 $2' - - regex: ' (Silk|Kindle)/(\d+)\.' - device_replacement: 'Kindle' - brand_replacement: 'Amazon' - model_replacement: 'Kindle' - - ######### - # Devices from chinese manufacturer(s) - # @note: identified by x-wap-profile http://218.249.47.94/Xianghe/.* - ######### - - regex: '(sprd)\-([^/]+)/' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - # @ref: http://eshinechina.en.alibaba.com/ - - regex: '; *(H\d{2}00\+?) Build' - device_replacement: '$1' - brand_replacement: 'Hero' - model_replacement: '$1' - - regex: '; *(iphone|iPhone5) Build/' - device_replacement: 'Xianghe $1' - brand_replacement: 'Xianghe' - model_replacement: '$1' - - regex: '; *(e\d{4}[a-z]?_?v\d+|v89_[^;/]+)[^;/]+ Build/' - device_replacement: 'Xianghe $1' - brand_replacement: 'Xianghe' - model_replacement: '$1' - - ######### - # Cellular - # @ref: - # @note: Operator branded devices - ######### - - regex: '\bUSCC[_\-]?([^ ;/\)]+)' - device_replacement: '$1' - brand_replacement: 'Cellular' - model_replacement: '$1' - - ###################################################################### - # Windows Phone Parsers - ###################################################################### - - ######### - # Alcatel Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|)(?:ALCATEL)[^;]*; *([^;,\)]+)' - device_replacement: 'Alcatel $1' - brand_replacement: 'Alcatel' - model_replacement: '$1' - - ######### - # Asus Windows Phones - ######### - #~ - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|WpsLondonTest; ?|)(?:ASUS|Asus)[^;]*; *([^;,\)]+)' - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|WpsLondonTest; ?|)(?:ASUS|Asus)[^;]*; *([^;,\)]+)' - device_replacement: 'Asus $1' - brand_replacement: 'Asus' - model_replacement: '$1' - - ######### - # Dell Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|)(?:DELL|Dell)[^;]*; *([^;,\)]+)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: '$1' - - ######### - # HTC Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|WpsLondonTest; ?|)(?:HTC|Htc|HTC_blocked[^;]*)[^;]*; *(?:HTC|)([^;,\)]+)' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - - ######### - # Huawei Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|)(?:HUAWEI)[^;]*; *(?:HUAWEI |)([^;,\)]+)' - device_replacement: 'Huawei $1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - ######### - # LG Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|)(?:LG|Lg)[^;]*; *(?:LG[ \-]|)([^;,\)]+)' - device_replacement: 'LG $1' - brand_replacement: 'LG' - model_replacement: '$1' - - ######### - # Noka Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|)(?:rv:11; |)(?:NOKIA|Nokia)[^;]*; *(?:NOKIA ?|Nokia ?|LUMIA ?|[Ll]umia ?|)(\d{3,10}[^;\)]*)' - device_replacement: 'Lumia $1' - brand_replacement: 'Nokia' - model_replacement: 'Lumia $1' - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|)(?:NOKIA|Nokia)[^;]*; *(RM-\d{3,})' - device_replacement: 'Nokia $1' - brand_replacement: 'Nokia' - model_replacement: '$1' - - regex: '(?:Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)]|WPDesktop;) ?(?:ARM; ?Touch; ?|Touch; ?|)(?:NOKIA|Nokia)[^;]*; *(?:NOKIA ?|Nokia ?|LUMIA ?|[Ll]umia ?|)([^;\)]+)' - device_replacement: 'Nokia $1' - brand_replacement: 'Nokia' - model_replacement: '$1' - - ######### - # Microsoft Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|)(?:Microsoft(?: Corporation|))[^;]*; *([^;,\)]+)' - device_replacement: 'Microsoft $1' - brand_replacement: 'Microsoft' - model_replacement: '$1' - - ######### - # Samsung Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|WpsLondonTest; ?|)(?:SAMSUNG)[^;]*; *(?:SAMSUNG |)([^;,\.\)]+)' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - ######### - # Toshiba Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|WpsLondonTest; ?|)(?:TOSHIBA|FujitsuToshibaMobileCommun)[^;]*; *([^;,\)]+)' - device_replacement: 'Toshiba $1' - brand_replacement: 'Toshiba' - model_replacement: '$1' - - ######### - # Generic Windows Phones - ######### - - regex: 'Windows Phone [^;]+; .*?IEMobile/[^;\)]+[;\)] ?(?:ARM; ?Touch; ?|Touch; ?|WpsLondonTest; ?|)([^;]+); *([^;,\)]+)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ###################################################################### - # Other Devices Parser - ###################################################################### - - ######### - # Samsung Bada Phones - ######### - - regex: '(?:^|; )SAMSUNG\-([A-Za-z0-9\-]+).* Bada/' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - ######### - # Firefox OS - ######### - - regex: '\(Mobile; ALCATEL ?(One|ONE) ?(Touch|TOUCH) ?([^;/]+?)(?:/[^;]+|); rv:[^\)]+\) Gecko/[^\/]+ Firefox/' - device_replacement: 'Alcatel $1 $2 $3' - brand_replacement: 'Alcatel' - model_replacement: 'One Touch $3' - - regex: '\(Mobile; (?:ZTE([^;]+)|(OpenC)); rv:[^\)]+\) Gecko/[^\/]+ Firefox/' - device_replacement: 'ZTE $1$2' - brand_replacement: 'ZTE' - model_replacement: '$1$2' - - ######### - # KaiOS - ######### - - regex: '\(Mobile; ALCATEL([A-Za-z0-9\-]+); rv:[^\)]+\) Gecko/[^\/]+ Firefox/[^\/]+ KaiOS/' - device_replacement: 'Alcatel $1' - brand_replacement: 'Alcatel' - model_replacement: '$1' - - regex: '\(Mobile; LYF\/([A-Za-z0-9\-]+)\/.+;.+rv:[^\)]+\) Gecko/[^\/]+ Firefox/[^\/]+ KAIOS/' - device_replacement: 'LYF $1' - brand_replacement: 'LYF' - model_replacement: '$1' - - regex: '\(Mobile; Nokia_([A-Za-z0-9\-]+)_.+; rv:[^\)]+\) Gecko/[^\/]+ Firefox/[^\/]+ KAIOS/' - device_replacement: 'Nokia $1' - brand_replacement: 'Nokia' - model_replacement: '$1' - - ########## - # NOKIA - # @note: NokiaN8-00 comes before iphone. Sometimes spoofs iphone - ########## - - regex: 'Nokia(N[0-9]+)([A-Za-z_\-][A-Za-z0-9_\-]*)' - device_replacement: 'Nokia $1' - brand_replacement: 'Nokia' - model_replacement: '$1$2' - - regex: '(?:NOKIA|Nokia)(?:\-| *)(?:([A-Za-z0-9]+)\-[0-9a-f]{32}|([A-Za-z0-9\-]+)(?:UCBrowser)|([A-Za-z0-9\-]+))' - device_replacement: 'Nokia $1$2$3' - brand_replacement: 'Nokia' - model_replacement: '$1$2$3' - - regex: 'Lumia ([A-Za-z0-9\-]+)' - device_replacement: 'Lumia $1' - brand_replacement: 'Nokia' - model_replacement: 'Lumia $1' - # UCWEB Browser on Symbian - - regex: '\(Symbian; U; S60 V5; [A-z]{2}\-[A-z]{2}; (SonyEricsson|Samsung|Nokia|LG)([^;/]+?)\)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - # Nokia Symbian - - regex: '\(Symbian(?:/3|); U; ([^;]+);' - device_replacement: 'Nokia $1' - brand_replacement: 'Nokia' - model_replacement: '$1' - - ########## - # BlackBerry - # @ref: http://www.useragentstring.com/pages/BlackBerry/ - ########## - - regex: 'BB10; ([A-Za-z0-9\- ]+)\)' - device_replacement: 'BlackBerry $1' - brand_replacement: 'BlackBerry' - model_replacement: '$1' - - regex: 'Play[Bb]ook.+RIM Tablet OS' - device_replacement: 'BlackBerry Playbook' - brand_replacement: 'BlackBerry' - model_replacement: 'Playbook' - - regex: 'Black[Bb]erry ([0-9]+);' - device_replacement: 'BlackBerry $1' - brand_replacement: 'BlackBerry' - model_replacement: '$1' - - regex: 'Black[Bb]erry([0-9]+)' - device_replacement: 'BlackBerry $1' - brand_replacement: 'BlackBerry' - model_replacement: '$1' - - regex: 'Black[Bb]erry;' - device_replacement: 'BlackBerry' - brand_replacement: 'BlackBerry' - - ########## - # PALM / HP - # @note: some palm devices must come before iphone. sometimes spoofs iphone in ua - ########## - - regex: '(Pre|Pixi)/\d+\.\d+' - device_replacement: 'Palm $1' - brand_replacement: 'Palm' - model_replacement: '$1' - - regex: 'Palm([0-9]+)' - device_replacement: 'Palm $1' - brand_replacement: 'Palm' - model_replacement: '$1' - - regex: 'Treo([A-Za-z0-9]+)' - device_replacement: 'Palm Treo $1' - brand_replacement: 'Palm' - model_replacement: 'Treo $1' - - regex: 'webOS.*(P160U(?:NA|))/(\d+).(\d+)' - device_replacement: 'HP Veer' - brand_replacement: 'HP' - model_replacement: 'Veer' - - regex: '(Touch[Pp]ad)/\d+\.\d+' - device_replacement: 'HP TouchPad' - brand_replacement: 'HP' - model_replacement: 'TouchPad' - - regex: 'HPiPAQ([A-Za-z0-9]+)/\d+.\d+' - device_replacement: 'HP iPAQ $1' - brand_replacement: 'HP' - model_replacement: 'iPAQ $1' - - regex: 'PDA; (PalmOS)/sony/model ([a-z]+)/Revision' - device_replacement: '$1' - brand_replacement: 'Sony' - model_replacement: '$1 $2' - - ########## - # AppleTV - # No built in browser that I can tell - # Stack Overflow indicated iTunes-AppleTV/4.1 as a known UA for app available and I'm seeing it in live traffic - ########## - - regex: '(Apple\s?TV)' - device_replacement: 'AppleTV' - brand_replacement: 'Apple' - model_replacement: 'AppleTV' - - ######### - # Tesla Model S - ######### - - regex: '(QtCarBrowser)' - device_replacement: 'Tesla Model S' - brand_replacement: 'Tesla' - model_replacement: 'Model S' - - ########## - # iSTUFF - # @note: complete but probably catches spoofs - # ipad and ipod must be parsed before iphone - # cannot determine specific device type from ua string. (3g, 3gs, 4, etc) - ########## - # @note: on some ua the device can be identified e.g. iPhone5,1 - - regex: '(iPhone|iPad|iPod)(\d+,\d+)' - device_replacement: '$1' - brand_replacement: 'Apple' - model_replacement: '$1$2' - # @note: iPad needs to be before iPhone - - regex: '(iPad)(?:;| Simulator;)' - device_replacement: '$1' - brand_replacement: 'Apple' - model_replacement: '$1' - - regex: '(iPod)(?:;| touch;| Simulator;)' - device_replacement: '$1' - brand_replacement: 'Apple' - model_replacement: '$1' - - regex: '(iPhone)(?:;| Simulator;)' - device_replacement: '$1' - brand_replacement: 'Apple' - model_replacement: '$1' - - regex: '(Watch)(\d+,\d+)' - device_replacement: 'Apple $1' - brand_replacement: 'Apple' - model_replacement: '$1$2' - - regex: '(Apple Watch)(?:;| Simulator;)' - device_replacement: '$1' - brand_replacement: 'Apple' - model_replacement: '$1' - - regex: '(HomePod)(?:;| Simulator;)' - device_replacement: '$1' - brand_replacement: 'Apple' - model_replacement: '$1' - - regex: 'iPhone' - device_replacement: 'iPhone' - brand_replacement: 'Apple' - model_replacement: 'iPhone' - # @note: desktop applications show device info - - regex: 'CFNetwork/.* Darwin/\d.*\(((?:Mac|iMac|PowerMac|PowerBook)[^\d]*)(\d+)(?:,|%2C)(\d+)' - device_replacement: '$1$2,$3' - brand_replacement: 'Apple' - model_replacement: '$1$2,$3' - # @note: newer desktop applications don't show device info - # This is here so as to not have them recorded as iOS-Device - - regex: 'CFNetwork/.* Darwin/\d+\.\d+\.\d+ \(x86_64\)' - device_replacement: 'Mac' - brand_replacement: 'Apple' - model_replacement: 'Mac' - # @note: iOS applications do not show device info - - regex: 'CFNetwork/.* Darwin/\d' - device_replacement: 'iOS-Device' - brand_replacement: 'Apple' - model_replacement: 'iOS-Device' - - ########################## - # Outlook on iOS >= 2.62.0 - ########################## - - regex: 'Outlook-(iOS)/\d+\.\d+\.prod\.iphone' - brand_replacement: 'Apple' - device_replacement: 'iPhone' - model_replacement: 'iPhone' - - ########## - # Acer - ########## - - regex: 'acer_([A-Za-z0-9]+)_' - device_replacement: 'Acer $1' - brand_replacement: 'Acer' - model_replacement: '$1' - - ########## - # Alcatel - ########## - - regex: '(?:ALCATEL|Alcatel)-([A-Za-z0-9\-]+)' - device_replacement: 'Alcatel $1' - brand_replacement: 'Alcatel' - model_replacement: '$1' - - ########## - # Amoi - ########## - - regex: '(?:Amoi|AMOI)\-([A-Za-z0-9]+)' - device_replacement: 'Amoi $1' - brand_replacement: 'Amoi' - model_replacement: '$1' - - ########## - # Asus - ########## - - regex: '(?:; |\/|^)((?:Transformer (?:Pad|Prime) |Transformer |PadFone[ _]?)[A-Za-z0-9]*)' - device_replacement: 'Asus $1' - brand_replacement: 'Asus' - model_replacement: '$1' - - regex: '(?:asus.*?ASUS|Asus|ASUS|asus)[\- ;]*((?:Transformer (?:Pad|Prime) |Transformer |Padfone |Nexus[ _]|)[A-Za-z0-9]+)' - device_replacement: 'Asus $1' - brand_replacement: 'Asus' - model_replacement: '$1' - - regex: '(?:ASUS)_([A-Za-z0-9\-]+)' - device_replacement: 'Asus $1' - brand_replacement: 'Asus' - model_replacement: '$1' - - - ########## - # Bird - ########## - - regex: '\bBIRD[ \-\.]([A-Za-z0-9]+)' - device_replacement: 'Bird $1' - brand_replacement: 'Bird' - model_replacement: '$1' - - ########## - # Dell - ########## - - regex: '\bDell ([A-Za-z0-9]+)' - device_replacement: 'Dell $1' - brand_replacement: 'Dell' - model_replacement: '$1' - - ########## - # DoCoMo - ########## - - regex: 'DoCoMo/2\.0 ([A-Za-z0-9]+)' - device_replacement: 'DoCoMo $1' - brand_replacement: 'DoCoMo' - model_replacement: '$1' - - regex: '([A-Za-z0-9]+)_W;FOMA' - device_replacement: 'DoCoMo $1' - brand_replacement: 'DoCoMo' - model_replacement: '$1' - - regex: '([A-Za-z0-9]+);FOMA' - device_replacement: 'DoCoMo $1' - brand_replacement: 'DoCoMo' - model_replacement: '$1' - - ########## - # htc - ########## - - regex: '\b(?:HTC/|HTC/[a-z0-9]+/|)HTC[ _\-;]? *(.*?)(?:-?Mozilla|fingerPrint|[;/\(\)]|$)' - device_replacement: 'HTC $1' - brand_replacement: 'HTC' - model_replacement: '$1' - - ########## - # Huawei - ########## - - regex: 'Huawei([A-Za-z0-9]+)' - device_replacement: 'Huawei $1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - regex: 'HUAWEI-([A-Za-z0-9]+)' - device_replacement: 'Huawei $1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - regex: 'HUAWEI ([A-Za-z0-9\-]+)' - device_replacement: 'Huawei $1' - brand_replacement: 'Huawei' - model_replacement: '$1' - - regex: 'vodafone([A-Za-z0-9]+)' - device_replacement: 'Huawei Vodafone $1' - brand_replacement: 'Huawei' - model_replacement: 'Vodafone $1' - - ########## - # i-mate - ########## - - regex: 'i\-mate ([A-Za-z0-9]+)' - device_replacement: 'i-mate $1' - brand_replacement: 'i-mate' - model_replacement: '$1' - - ########## - # kyocera - ########## - - regex: 'Kyocera\-([A-Za-z0-9]+)' - device_replacement: 'Kyocera $1' - brand_replacement: 'Kyocera' - model_replacement: '$1' - - regex: 'KWC\-([A-Za-z0-9]+)' - device_replacement: 'Kyocera $1' - brand_replacement: 'Kyocera' - model_replacement: '$1' - - ########## - # lenovo - ########## - - regex: 'Lenovo[_\-]([A-Za-z0-9]+)' - device_replacement: 'Lenovo $1' - brand_replacement: 'Lenovo' - model_replacement: '$1' - - ########## - # HbbTV (European and Australian standard) - # written before the LG regexes, as LG is making HbbTV too - ########## - - regex: '(HbbTV)/[0-9]+\.[0-9]+\.[0-9]+ \( ?;(LG)E ?;([^;]{0,30})' - device_replacement: '$1' - brand_replacement: '$2' - model_replacement: '$3' - - regex: '(HbbTV)/1\.1\.1.*CE-HTML/1\.\d;(Vendor/|)(THOM[^;]*?)[;\s].{0,30}(LF[^;]+);?' - device_replacement: '$1' - brand_replacement: 'Thomson' - model_replacement: '$4' - - regex: '(HbbTV)(?:/1\.1\.1|) ?(?: \(;;;;;\)|); *CE-HTML(?:/1\.\d|); *([^ ]+) ([^;]+);' - device_replacement: '$1' - brand_replacement: '$2' - model_replacement: '$3' - - regex: '(HbbTV)/1\.1\.1 \(;;;;;\) Maple_2011' - device_replacement: '$1' - brand_replacement: 'Samsung' - - regex: '(HbbTV)/[0-9]+\.[0-9]+\.[0-9]+ \([^;]{0,30}; ?(?:CUS:([^;]*)|([^;]+)) ?; ?([^;]{0,30})' - device_replacement: '$1' - brand_replacement: '$2$3' - model_replacement: '$4' - - regex: '(HbbTV)/[0-9]+\.[0-9]+\.[0-9]+' - device_replacement: '$1' - - ########## - # LGE NetCast TV - ########## - - regex: 'LGE; (?:Media\/|)([^;]*);[^;]*;[^;]*;?\); "?LG NetCast(\.TV|\.Media|)-\d+' - device_replacement: 'NetCast$2' - brand_replacement: 'LG' - model_replacement: '$1' - - ########## - # InettvBrowser - ########## - - regex: 'InettvBrowser/[0-9]+\.[0-9A-Z]+ \([^;]*;(Sony)([^;]*);[^;]*;[^\)]*\)' - device_replacement: 'Inettv' - brand_replacement: '$1' - model_replacement: '$2' - - regex: 'InettvBrowser/[0-9]+\.[0-9A-Z]+ \([^;]*;([^;]*);[^;]*;[^\)]*\)' - device_replacement: 'Inettv' - brand_replacement: 'Generic_Inettv' - model_replacement: '$1' - - regex: '(?:InettvBrowser|TSBNetTV|NETTV|HBBTV)' - device_replacement: 'Inettv' - brand_replacement: 'Generic_Inettv' - - ########## - # lg - ########## - # LG Symbian Phones - - regex: 'Series60/\d\.\d (LG)[\-]?([A-Za-z0-9 \-]+)' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - # other LG phones - - regex: '\b(?:LGE[ \-]LG\-(?:AX|)|LGE |LGE?-LG|LGE?[ \-]|LG[ /\-]|lg[\-])([A-Za-z0-9]+)\b' - device_replacement: 'LG $1' - brand_replacement: 'LG' - model_replacement: '$1' - - regex: '(?:^LG[\-]?|^LGE[\-/]?)([A-Za-z]+[0-9]+[A-Za-z]*)' - device_replacement: 'LG $1' - brand_replacement: 'LG' - model_replacement: '$1' - - regex: '^LG([0-9]+[A-Za-z]*)' - device_replacement: 'LG $1' - brand_replacement: 'LG' - model_replacement: '$1' - - ########## - # microsoft - ########## - - regex: '(KIN\.[^ ]+) (\d+)\.(\d+)' - device_replacement: 'Microsoft $1' - brand_replacement: 'Microsoft' - model_replacement: '$1' - - regex: '(?:MSIE|XBMC).*\b(Xbox)\b' - device_replacement: '$1' - brand_replacement: 'Microsoft' - model_replacement: '$1' - - regex: '; ARM; Trident/6\.0; Touch[\);]' - device_replacement: 'Microsoft Surface RT' - brand_replacement: 'Microsoft' - model_replacement: 'Surface RT' - - ########## - # motorola - ########## - - regex: 'Motorola\-([A-Za-z0-9]+)' - device_replacement: 'Motorola $1' - brand_replacement: 'Motorola' - model_replacement: '$1' - - regex: 'MOTO\-([A-Za-z0-9]+)' - device_replacement: 'Motorola $1' - brand_replacement: 'Motorola' - model_replacement: '$1' - - regex: 'MOT\-([A-z0-9][A-z0-9\-]*)' - device_replacement: 'Motorola $1' - brand_replacement: 'Motorola' - model_replacement: '$1' - - ########## - # nintendo - ########## - - regex: 'Nintendo WiiU' - device_replacement: 'Nintendo Wii U' - brand_replacement: 'Nintendo' - model_replacement: 'Wii U' - - regex: 'Nintendo (DS|3DS|DSi|Wii);' - device_replacement: 'Nintendo $1' - brand_replacement: 'Nintendo' - model_replacement: '$1' - - ########## - # pantech - ########## - - regex: '(?:Pantech|PANTECH)[ _-]?([A-Za-z0-9\-]+)' - device_replacement: 'Pantech $1' - brand_replacement: 'Pantech' - model_replacement: '$1' - - ########## - # philips - ########## - - regex: 'Philips([A-Za-z0-9]+)' - device_replacement: 'Philips $1' - brand_replacement: 'Philips' - model_replacement: '$1' - - regex: 'Philips ([A-Za-z0-9]+)' - device_replacement: 'Philips $1' - brand_replacement: 'Philips' - model_replacement: '$1' - - ########## - # Samsung - ########## - # Samsung Smart-TV - - regex: '(SMART-TV); .* Tizen ' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - # Samsung Symbian Devices - - regex: 'SymbianOS/9\.\d.* Samsung[/\-]([A-Za-z0-9 \-]+)' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - regex: '(Samsung)(SGH)(i[0-9]+)' - device_replacement: '$1 $2$3' - brand_replacement: '$1' - model_replacement: '$2-$3' - - regex: 'SAMSUNG-ANDROID-MMS/([^;/]+)' - device_replacement: '$1' - brand_replacement: 'Samsung' - model_replacement: '$1' - # Other Samsung - #- regex: 'SAMSUNG(?:; |-)([A-Za-z0-9\-]+)' - - regex: 'SAMSUNG(?:; |[ -/])([A-Za-z0-9\-]+)' - regex_flag: 'i' - device_replacement: 'Samsung $1' - brand_replacement: 'Samsung' - model_replacement: '$1' - - ########## - # Sega - ########## - - regex: '(Dreamcast)' - device_replacement: 'Sega $1' - brand_replacement: 'Sega' - model_replacement: '$1' - - ########## - # Siemens mobile - ########## - - regex: '^SIE-([A-Za-z0-9]+)' - device_replacement: 'Siemens $1' - brand_replacement: 'Siemens' - model_replacement: '$1' - - ########## - # Softbank - ########## - - regex: 'Softbank/[12]\.0/([A-Za-z0-9]+)' - device_replacement: 'Softbank $1' - brand_replacement: 'Softbank' - model_replacement: '$1' - - ########## - # SonyEricsson - ########## - - regex: 'SonyEricsson ?([A-Za-z0-9\-]+)' - device_replacement: 'Ericsson $1' - brand_replacement: 'SonyEricsson' - model_replacement: '$1' - - ########## - # Sony - ########## - - regex: 'Android [^;]+; ([^ ]+) (Sony)/' - device_replacement: '$2 $1' - brand_replacement: '$2' - model_replacement: '$1' - - regex: '(Sony)(?:BDP\/|\/|)([^ /;\)]+)[ /;\)]' - device_replacement: '$1 $2' - brand_replacement: '$1' - model_replacement: '$2' - - ######### - # Puffin Browser Device detect - # A=Android, I=iOS, P=Phone, T=Tablet - # AT=Android+Tablet - ######### - - regex: 'Puffin/[\d\.]+IT' - device_replacement: 'iPad' - brand_replacement: 'Apple' - model_replacement: 'iPad' - - regex: 'Puffin/[\d\.]+IP' - device_replacement: 'iPhone' - brand_replacement: 'Apple' - model_replacement: 'iPhone' - - regex: 'Puffin/[\d\.]+AT' - device_replacement: 'Generic Tablet' - brand_replacement: 'Generic' - model_replacement: 'Tablet' - - regex: 'Puffin/[\d\.]+AP' - device_replacement: 'Generic Smartphone' - brand_replacement: 'Generic' - model_replacement: 'Smartphone' - - ######### - # Android General Device Matching (far from perfect) - ######### - - regex: 'Android[\- ][\d]+\.[\d]+; [A-Za-z]{2}\-[A-Za-z]{0,2}; WOWMobile (.+)( Build[/ ]|\))' - brand_replacement: 'Generic_Android' - model_replacement: '$1' - - regex: 'Android[\- ][\d]+\.[\d]+\-update1; [A-Za-z]{2}\-[A-Za-z]{0,2} *; *(.+?)( Build[/ ]|\))' - brand_replacement: 'Generic_Android' - model_replacement: '$1' - - regex: 'Android[\- ][\d]+(?:\.[\d]+)(?:\.[\d]+|); *[A-Za-z]{2}[_\-][A-Za-z]{0,2}\-? *; *(.+?)( Build[/ ]|\))' - brand_replacement: 'Generic_Android' - model_replacement: '$1' - - regex: 'Android[\- ][\d]+(?:\.[\d]+)(?:\.[\d]+|); *[A-Za-z]{0,2}\- *; *(.+?)( Build[/ ]|\))' - brand_replacement: 'Generic_Android' - model_replacement: '$1' - # No build info at all - "Build" follows locale immediately - - regex: 'Android[\- ][\d]+(?:\.[\d]+)(?:\.[\d]+|); *[a-z]{0,2}[_\-]?[A-Za-z]{0,2};?( Build[/ ]|\))' - device_replacement: 'Generic Smartphone' - brand_replacement: 'Generic' - model_replacement: 'Smartphone' - - regex: 'Android[\- ][\d]+(?:\.[\d]+)(?:\.[\d]+|); *\-?[A-Za-z]{2}; *(.+?)( Build[/ ]|\))' - brand_replacement: 'Generic_Android' - model_replacement: '$1' - - regex: 'Android \d+?(?:\.\d+|)(?:\.\d+|); ([^;]+?)(?: Build|\) AppleWebKit).+? Mobile Safari' - brand_replacement: 'Generic_Android' - model_replacement: '$1' - - regex: 'Android \d+?(?:\.\d+|)(?:\.\d+|); ([^;]+?)(?: Build|\) AppleWebKit).+? Safari' - brand_replacement: 'Generic_Android_Tablet' - model_replacement: '$1' - - regex: 'Android \d+?(?:\.\d+|)(?:\.\d+|); ([^;]+?)(?: Build|\))' - brand_replacement: 'Generic_Android' - model_replacement: '$1' - - ########## - # Google TV - ########## - - regex: '(GoogleTV)' - brand_replacement: 'Generic_Inettv' - model_replacement: '$1' - - ########## - # WebTV - ########## - - regex: '(WebTV)/\d+.\d+' - brand_replacement: 'Generic_Inettv' - model_replacement: '$1' - # Roku Digital-Video-Players https://www.roku.com/ - - regex: '^(Roku)/DVP-\d+\.\d+' - brand_replacement: 'Generic_Inettv' - model_replacement: '$1' - - ########## - # Generic Tablet - ########## - - regex: '(Android 3\.\d|Opera Tablet|Tablet; .+Firefox/|Android.*(?:Tab|Pad))' - regex_flag: 'i' - device_replacement: 'Generic Tablet' - brand_replacement: 'Generic' - model_replacement: 'Tablet' - - ########## - # Generic Smart Phone - ########## - - regex: '(Symbian|\bS60(Version|V\d)|\bS60\b|\((Series 60|Windows Mobile|Palm OS|Bada); Opera Mini|Windows CE|Opera Mobi|BREW|Brew|Mobile; .+Firefox/|iPhone OS|Android|MobileSafari|Windows *Phone|\(webOS/|PalmOS)' - device_replacement: 'Generic Smartphone' - brand_replacement: 'Generic' - model_replacement: 'Smartphone' - - regex: '(hiptop|avantgo|plucker|xiino|blazer|elaine)' - regex_flag: 'i' - device_replacement: 'Generic Smartphone' - brand_replacement: 'Generic' - model_replacement: 'Smartphone' - - ########## - # Spiders (this is a hack...) - ########## - - regex: '(bot|BUbiNG|zao|borg|DBot|oegp|silk|Xenu|zeal|^NING|CCBot|crawl|htdig|lycos|slurp|teoma|voila|yahoo|Sogou|CiBra|Nutch|^Java/|^JNLP/|Daumoa|Daum|Genieo|ichiro|larbin|pompos|Scrapy|snappy|speedy|spider|msnbot|msrbot|vortex|^vortex|crawler|favicon|indexer|Riddler|scooter|scraper|scrubby|WhatWeb|WinHTTP|bingbot|BingPreview|openbot|gigabot|furlbot|polybot|seekbot|^voyager|archiver|Icarus6j|mogimogi|Netvibes|blitzbot|altavista|charlotte|findlinks|Retreiver|TLSProber|WordPress|SeznamBot|ProoXiBot|wsr\-agent|Squrl Java|EtaoSpider|PaperLiBot|SputnikBot|A6\-Indexer|netresearch|searchsight|baiduspider|YisouSpider|ICC\-Crawler|http%20client|Python-urllib|dataparksearch|converacrawler|Screaming Frog|AppEngine-Google|YahooCacheSystem|fast\-webcrawler|Sogou Pic Spider|semanticdiscovery|Innovazion Crawler|facebookexternalhit|Google.*/\+/web/snippet|Google-HTTP-Java-Client|BlogBridge|IlTrovatore-Setaccio|InternetArchive|GomezAgent|WebThumbnail|heritrix|NewsGator|PagePeeker|Reaper|ZooShot|holmes|NL-Crawler|Pingdom|StatusCake|WhatsApp|masscan|Google Web Preview|Qwantify|Yeti|OgScrper)' - regex_flag: 'i' - device_replacement: 'Spider' - brand_replacement: 'Spider' - model_replacement: 'Desktop' - - ########## - # Generic Feature Phone - # take care to do case insensitive matching - ########## - - regex: '^(1207|3gso|4thp|501i|502i|503i|504i|505i|506i|6310|6590|770s|802s|a wa|acer|acs\-|airn|alav|asus|attw|au\-m|aur |aus |abac|acoo|aiko|alco|alca|amoi|anex|anny|anyw|aptu|arch|argo|bmobile|bell|bird|bw\-n|bw\-u|beck|benq|bilb|blac|c55/|cdm\-|chtm|capi|comp|cond|dall|dbte|dc\-s|dica|ds\-d|ds12|dait|devi|dmob|doco|dopo|dorado|el(?:38|39|48|49|50|55|58|68)|el[3456]\d{2}dual|erk0|esl8|ex300|ez40|ez60|ez70|ezos|ezze|elai|emul|eric|ezwa|fake|fly\-|fly_|g\-mo|g1 u|g560|gf\-5|grun|gene|go.w|good|grad|hcit|hd\-m|hd\-p|hd\-t|hei\-|hp i|hpip|hs\-c|htc |htc\-|htca|htcg)' - regex_flag: 'i' - device_replacement: 'Generic Feature Phone' - brand_replacement: 'Generic' - model_replacement: 'Feature Phone' - - regex: '^(htcp|htcs|htct|htc_|haie|hita|huaw|hutc|i\-20|i\-go|i\-ma|i\-mobile|i230|iac|iac\-|iac/|ig01|im1k|inno|iris|jata|kddi|kgt|kgt/|kpt |kwc\-|klon|lexi|lg g|lg\-a|lg\-b|lg\-c|lg\-d|lg\-f|lg\-g|lg\-k|lg\-l|lg\-m|lg\-o|lg\-p|lg\-s|lg\-t|lg\-u|lg\-w|lg/k|lg/l|lg/u|lg50|lg54|lge\-|lge/|leno|m1\-w|m3ga|m50/|maui|mc01|mc21|mcca|medi|meri|mio8|mioa|mo01|mo02|mode|modo|mot |mot\-|mt50|mtp1|mtv |mate|maxo|merc|mits|mobi|motv|mozz|n100|n101|n102|n202|n203|n300|n302|n500|n502|n505|n700|n701|n710|nec\-|nem\-|newg|neon)' - regex_flag: 'i' - device_replacement: 'Generic Feature Phone' - brand_replacement: 'Generic' - model_replacement: 'Feature Phone' - - regex: '^(netf|noki|nzph|o2 x|o2\-x|opwv|owg1|opti|oran|ot\-s|p800|pand|pg\-1|pg\-2|pg\-3|pg\-6|pg\-8|pg\-c|pg13|phil|pn\-2|pt\-g|palm|pana|pire|pock|pose|psio|qa\-a|qc\-2|qc\-3|qc\-5|qc\-7|qc07|qc12|qc21|qc32|qc60|qci\-|qwap|qtek|r380|r600|raks|rim9|rove|s55/|sage|sams|sc01|sch\-|scp\-|sdk/|se47|sec\-|sec0|sec1|semc|sgh\-|shar|sie\-|sk\-0|sl45|slid|smb3|smt5|sp01|sph\-|spv |spv\-|sy01|samm|sany|sava|scoo|send|siem|smar|smit|soft|sony|t\-mo|t218|t250|t600|t610|t618|tcl\-|tdg\-|telm|tim\-|ts70|tsm\-|tsm3|tsm5|tx\-9|tagt)' - regex_flag: 'i' - device_replacement: 'Generic Feature Phone' - brand_replacement: 'Generic' - model_replacement: 'Feature Phone' - - regex: '^(talk|teli|topl|tosh|up.b|upg1|utst|v400|v750|veri|vk\-v|vk40|vk50|vk52|vk53|vm40|vx98|virg|vertu|vite|voda|vulc|w3c |w3c\-|wapj|wapp|wapu|wapm|wig |wapi|wapr|wapv|wapy|wapa|waps|wapt|winc|winw|wonu|x700|xda2|xdag|yas\-|your|zte\-|zeto|aste|audi|avan|blaz|brew|brvw|bumb|ccwa|cell|cldc|cmd\-|dang|eml2|fetc|hipt|http|ibro|idea|ikom|ipaq|jbro|jemu|jigs|keji|kyoc|kyok|libw|m\-cr|midp|mmef|moto|mwbp|mywa|newt|nok6|o2im|pant|pdxg|play|pluc|port|prox|rozo|sama|seri|smal|symb|treo|upsi|vx52|vx53|vx60|vx61|vx70|vx80|vx81|vx83|vx85|wap\-|webc|whit|wmlb|xda\-|xda_)' - regex_flag: 'i' - device_replacement: 'Generic Feature Phone' - brand_replacement: 'Generic' - model_replacement: 'Feature Phone' - - regex: '^(Ice)$' - device_replacement: 'Generic Feature Phone' - brand_replacement: 'Generic' - model_replacement: 'Feature Phone' - - regex: '(wap[\-\ ]browser|maui|netfront|obigo|teleca|up\.browser|midp|Opera Mini)' - regex_flag: 'i' - device_replacement: 'Generic Feature Phone' - brand_replacement: 'Generic' - model_replacement: 'Feature Phone' - - ######### - # Apple - # @ref: https://www.apple.com/mac/ - # @note: lookup Mac OS, but exclude iPad, Apple TV, a HTC phone, Kindle, LG - # @note: put this at the end, since it is hard to implement contains foo, but not contain bar1, bar 2, bar 3 in go's re2 - ######### - - regex: 'Mac OS' - device_replacement: 'Mac' - brand_replacement: 'Apple' - model_replacement: 'Mac' \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj index fda78974db..06ad3945b7 100644 --- a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj +++ b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj @@ -900,7 +900,6 @@ MvcLocalization.de.Designer.cs Designer - Designer From a599ae42704a53ad4062ce1db277312b96258d59 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Mon, 10 Aug 2020 22:49:01 +0200 Subject: [PATCH 024/695] Updated CromExpressionDescriptor package to v2.15.0 --- .../SmartStore.Services.csproj | 5 +- .../SmartStore.Services/packages.config | 2 +- src/Presentation/SmartStore.Web/Web.config | 350 +++++++++--------- 3 files changed, 178 insertions(+), 179 deletions(-) diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index a7e54c6e61..ffd98f34b2 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -76,9 +76,8 @@ ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll True - - ..\..\packages\CronExpressionDescriptor.1.21.2\lib\net45\CronExpressionDescriptor.dll - True + + ..\..\packages\CronExpressionDescriptor.2.15.0\lib\netstandard2.0\CronExpressionDescriptor.dll ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index 0b21ff4a14..ef25b4b8b4 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -3,7 +3,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/Web.config b/src/Presentation/SmartStore.Web/Web.config index 005758563b..9f5c1343d2 100644 --- a/src/Presentation/SmartStore.Web/Web.config +++ b/src/Presentation/SmartStore.Web/Web.config @@ -1,47 +1,47 @@ - + -
+
-
-
-
-
+
+
+
+
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - - - - - - - + + + + + + + - - + + - + - + - - + + - - - - + + + + - - - + + + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + - + - + - - - - + + + + - - - - - - - + + + + + + + - - + + - - + + - - - + + + - - + + - - + + - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - - - - - - - - + + + + + + + + + + - + - + - + - + @@ -378,81 +378,81 @@ - + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - + - + - + - + - - - - - - - - - - + + + + + + + + + + - + - - + + - + \ No newline at end of file From 23bb224ee6a774cbc2934d84ac181cc520761d40 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Tue, 11 Aug 2020 00:37:57 +0200 Subject: [PATCH 025/695] Updated MiniProfiler package to v4.2.1 --- .../Setup/MigrateDatabaseInitializer.cs | 22 +++++----- .../SmartStore.DevTools/ProfilerHttpModule.cs | 4 +- .../SmartStore.DevTools.csproj | 23 ++++++++--- src/Plugins/SmartStore.DevTools/Starter.cs | 41 ++++--------------- .../Views/DevTools/MiniProfiler.cshtml | 4 +- src/Plugins/SmartStore.DevTools/Web.config | 2 +- .../SmartStore.DevTools/packages.config | 7 +++- .../SmartStore.Web/Content/shared/_utils.scss | 2 +- .../SmartStore.Web/SmartStore.Web.csproj | 6 +++ .../SmartStore.Web/packages.config | 2 + 10 files changed, 58 insertions(+), 55 deletions(-) diff --git a/src/Libraries/SmartStore.Data/Setup/MigrateDatabaseInitializer.cs b/src/Libraries/SmartStore.Data/Setup/MigrateDatabaseInitializer.cs index 0bd1830c92..47442fd09d 100644 --- a/src/Libraries/SmartStore.Data/Setup/MigrateDatabaseInitializer.cs +++ b/src/Libraries/SmartStore.Data/Setup/MigrateDatabaseInitializer.cs @@ -4,6 +4,7 @@ using System.Data.Entity.Infrastructure; using System.Data.Entity.Migrations; using System.Linq; +using SmartStore.Collections; using SmartStore.Core.Data; using SmartStore.Data.Caching; using SmartStore.Data.Migrations; @@ -19,7 +20,7 @@ public class MigrateDatabaseInitializer : IDatabaseInitialize where TContext : DbContext, new() where TConfig : DbMigrationsConfiguration, new() { - #region Ctor + private static readonly SyncedCollection _initializedContextTypes = new List().AsSynchronized(); public MigrateDatabaseInitializer() { @@ -30,10 +31,6 @@ public MigrateDatabaseInitializer(string connectionString) this.ConnectionString = connectionString; } - #endregion - - #region Properties - public IEnumerable> DataSeeders { get; @@ -52,8 +49,6 @@ public string ConnectionString private set; } - #endregion - #region Interface members /// @@ -62,6 +57,11 @@ public string ConnectionString /// The context. public virtual void InitializeDatabase(TContext context) { + if (_initializedContextTypes.Contains(context.GetType())) + { + return; + } + if (!context.Database.Exists()) { throw Error.InvalidOperation("Database migration failed because the target database does not exist. Ensure the database was initialized and seeded with the 'InstallDatabaseInitializer'."); @@ -81,10 +81,10 @@ public virtual void InitializeDatabase(TContext context) } else { - // DB is up-to-date and no migration ran. - EfMappingViewCacheFactory.SetContext(context); + // DB is up-to-date and no migration ran. + EfMappingViewCacheFactory.SetContext(context); - if (config is MigrationsConfiguration coreConfig && context is SmartObjectContext ctx) + if (config is MigrationsConfiguration coreConfig && context is SmartObjectContext ctx) { // Call the main Seed method anyway (on every startup), // we could have locale resources or settings to add/update. @@ -94,6 +94,8 @@ public virtual void InitializeDatabase(TContext context) // not needed anymore this.DataSeeders = null; + + _initializedContextTypes.Add(context.GetType()); } } diff --git a/src/Plugins/SmartStore.DevTools/ProfilerHttpModule.cs b/src/Plugins/SmartStore.DevTools/ProfilerHttpModule.cs index ab616910d6..33cc3da676 100644 --- a/src/Plugins/SmartStore.DevTools/ProfilerHttpModule.cs +++ b/src/Plugins/SmartStore.DevTools/ProfilerHttpModule.cs @@ -26,7 +26,7 @@ private static void OnAcquireRequestState(object sender, EventArgs e) var app = (HttpApplication)sender; if (!MiniProfilerStarted(app) && ShouldProfile(app)) { - MiniProfiler.Start(); + MiniProfiler.StartNew(); if (app.Context != null && app.Context.Items != null) { app.Context.Items[MP_KEY] = true; @@ -39,7 +39,7 @@ private static void OnEndRequest(object sender, EventArgs e) var app = (HttpApplication)sender; if (MiniProfilerStarted(app)) { - MiniProfiler.Stop(); + MiniProfiler.Current?.Stop(); } } diff --git a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj index 940f54c632..6b784b14a8 100644 --- a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj +++ b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj @@ -104,17 +104,24 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + False + ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll False - - ..\..\packages\MiniProfiler.3.2.0.157\lib\net40\MiniProfiler.dll + + ..\..\packages\MiniProfiler.4.2.1\lib\net461\MiniProfiler.dll + True + + + ..\..\packages\MiniProfiler.EF6.4.2.1\lib\net461\MiniProfiler.EF6.dll True - - False - ..\..\packages\MiniProfiler.EF6.3.0.11\lib\net40\MiniProfiler.EntityFramework6.dll + + ..\..\packages\MiniProfiler.Shared.4.2.1\lib\net461\MiniProfiler.Shared.dll True @@ -124,6 +131,12 @@ + + ..\..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + False + + + diff --git a/src/Plugins/SmartStore.DevTools/Starter.cs b/src/Plugins/SmartStore.DevTools/Starter.cs index 6511b8f581..32b6edfced 100644 --- a/src/Plugins/SmartStore.DevTools/Starter.cs +++ b/src/Plugins/SmartStore.DevTools/Starter.cs @@ -6,6 +6,8 @@ using StackExchange.Profiling.Storage; using System; using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; namespace SmartStore.DevTools { @@ -22,9 +24,12 @@ public class ProfilerStartupTask : IApplicationStart { public void Start() { - StackExchange.Profiling.MiniProfiler.Settings.MaxUnviewedProfiles = 5; - StackExchange.Profiling.MiniProfiler.Settings.Storage = new HttpRuntimeCacheStorage(TimeSpan.FromMinutes(1)); - //StackExchange.Profiling.MiniProfiler.Settings.Results_List_Authorize = (req) => true; + StackExchange.Profiling.MiniProfiler.Configure(new MiniProfilerOptions + { + MaxUnviewedProfiles = 5, + Storage = new MemoryCacheStorage(TimeSpan.FromMinutes(1)), + //ResultsAuthorize = req => true, + }); StackExchange.Profiling.EntityFramework6.MiniProfilerEF6.Initialize(); @@ -37,34 +42,4 @@ public int Order get { return int.MinValue; } } } - - internal class NullProfilerStorage : IStorage - { - public List GetUnviewedIds(string user) - { - return new List(); - } - - public IEnumerable List(int maxResults, DateTime? start = default(DateTime?), DateTime? finish = default(DateTime?), ListResultsOrder orderBy = ListResultsOrder.Descending) - { - return new List(); - } - - public MiniProfiler Load(Guid id) - { - return null; - } - - public void Save(MiniProfiler profiler) - { - } - - public void SetUnviewed(string user, Guid id) - { - } - - public void SetViewed(string user, Guid id) - { - } - } } \ No newline at end of file diff --git a/src/Plugins/SmartStore.DevTools/Views/DevTools/MiniProfiler.cshtml b/src/Plugins/SmartStore.DevTools/Views/DevTools/MiniProfiler.cshtml index ba456f87eb..bf83d685e0 100644 --- a/src/Plugins/SmartStore.DevTools/Views/DevTools/MiniProfiler.cshtml +++ b/src/Plugins/SmartStore.DevTools/Views/DevTools/MiniProfiler.cshtml @@ -1,8 +1,10 @@ @model dynamic +@using StackExchange.Profiling + @if (base.ViewContext.IsBareBonePage()) { return; } -@StackExchange.Profiling.MiniProfiler.RenderIncludes(useExistingjQuery: true, showControls: true) \ No newline at end of file +@(StackExchange.Profiling.MiniProfiler.Current?.RenderIncludes(showControls: true)) \ No newline at end of file diff --git a/src/Plugins/SmartStore.DevTools/Web.config b/src/Plugins/SmartStore.DevTools/Web.config index 936ba70d6f..bdf8a1df13 100644 --- a/src/Plugins/SmartStore.DevTools/Web.config +++ b/src/Plugins/SmartStore.DevTools/Web.config @@ -111,7 +111,7 @@ - + diff --git a/src/Plugins/SmartStore.DevTools/packages.config b/src/Plugins/SmartStore.DevTools/packages.config index 1898961fd7..1583e8026b 100644 --- a/src/Plugins/SmartStore.DevTools/packages.config +++ b/src/Plugins/SmartStore.DevTools/packages.config @@ -9,8 +9,11 @@ + - - + + + + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Content/shared/_utils.scss b/src/Presentation/SmartStore.Web/Content/shared/_utils.scss index a53b46ffb5..a9354ac465 100644 --- a/src/Presentation/SmartStore.Web/Content/shared/_utils.scss +++ b/src/Presentation/SmartStore.Web/Content/shared/_utils.scss @@ -404,7 +404,7 @@ table th { // ------------------------------------------------------ @include media-breakpoint-down(sm) { - .profiler-results { + .mp-results { display: none !important; } } diff --git a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj index 06ad3945b7..766aabe98b 100644 --- a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj +++ b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj @@ -143,6 +143,9 @@ ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + True ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll @@ -165,6 +168,9 @@ True ..\..\packages\Microsoft.SqlServer.Compact.4.0.8876.1\lib\net40\System.Data.SqlServerCe.dll + + ..\..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll diff --git a/src/Presentation/SmartStore.Web/packages.config b/src/Presentation/SmartStore.Web/packages.config index 4c8b1b1872..212f98819d 100644 --- a/src/Presentation/SmartStore.Web/packages.config +++ b/src/Presentation/SmartStore.Web/packages.config @@ -28,6 +28,7 @@ + @@ -35,6 +36,7 @@ + \ No newline at end of file From 294b496590d29de140499cb1eaf1ad36490d06b2 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Tue, 11 Aug 2020 02:09:44 +0200 Subject: [PATCH 026/695] Updated DynamicLinq package --- .../SmartStore.Core/Linq/Expanders/LambdaPathExpander.cs | 2 +- src/Libraries/SmartStore.Core/SmartStore.Core.csproj | 5 ++--- src/Libraries/SmartStore.Core/packages.config | 2 +- .../SmartStore.Services/Media/MediaService.Folder.cs | 2 +- src/Libraries/SmartStore.Services/Media/MediaService.cs | 2 +- .../SmartStore.Services/Media/Search/MediaSearcher.cs | 2 +- src/Libraries/SmartStore.Services/SmartStore.Services.csproj | 5 ++--- src/Libraries/SmartStore.Services/packages.config | 2 +- .../SmartStore.Web/Administration/SmartStore.Admin.csproj | 4 ++-- 9 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Libraries/SmartStore.Core/Linq/Expanders/LambdaPathExpander.cs b/src/Libraries/SmartStore.Core/Linq/Expanders/LambdaPathExpander.cs index ce8c87c8b1..135a404a50 100644 --- a/src/Libraries/SmartStore.Core/Linq/Expanders/LambdaPathExpander.cs +++ b/src/Libraries/SmartStore.Core/Linq/Expanders/LambdaPathExpander.cs @@ -104,7 +104,7 @@ private void DoExpand(Type type, string path) var entityParam = Expression.Parameter(type, "x"); // {x} path = String.Concat("x.", path.Trim('.')); - var expression = System.Linq.Dynamic.DynamicExpression.ParseLambda( + var expression = System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda( new ParameterExpression[] { entityParam }, typeof(object), path.Trim('.')); diff --git a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj index 1bbc86c10d..57b7c776d2 100644 --- a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj +++ b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj @@ -111,9 +111,8 @@ True - - ..\..\packages\System.Linq.Dynamic.1.0.7\lib\net40\System.Linq.Dynamic.dll - True + + ..\..\packages\System.Linq.Dynamic.Core.1.2.1\lib\net46\System.Linq.Dynamic.Core.dll diff --git a/src/Libraries/SmartStore.Core/packages.config b/src/Libraries/SmartStore.Core/packages.config index f8558c42cd..27fcfe462d 100644 --- a/src/Libraries/SmartStore.Core/packages.config +++ b/src/Libraries/SmartStore.Core/packages.config @@ -14,5 +14,5 @@ - + \ No newline at end of file diff --git a/src/Libraries/SmartStore.Services/Media/MediaService.Folder.cs b/src/Libraries/SmartStore.Services/Media/MediaService.Folder.cs index df0b93f4e9..4b4325cef7 100644 --- a/src/Libraries/SmartStore.Services/Media/MediaService.Folder.cs +++ b/src/Libraries/SmartStore.Services/Media/MediaService.Folder.cs @@ -3,7 +3,7 @@ using System.IO; using System.Linq; using System.Linq.Expressions; -using System.Linq.Dynamic; +using System.Linq.Dynamic.Core; using SmartStore.Core.Data; using SmartStore.Core.Domain.Media; using System.Runtime.CompilerServices; diff --git a/src/Libraries/SmartStore.Services/Media/MediaService.cs b/src/Libraries/SmartStore.Services/Media/MediaService.cs index b92f2a8a00..ce62fb0ba7 100644 --- a/src/Libraries/SmartStore.Services/Media/MediaService.cs +++ b/src/Libraries/SmartStore.Services/Media/MediaService.cs @@ -5,7 +5,7 @@ using System.Drawing; using System.IO; using System.Linq; -using System.Linq.Dynamic; +using System.Linq.Dynamic.Core; using System.Runtime.CompilerServices; using System.Threading.Tasks; using SmartStore.Core.Data; diff --git a/src/Libraries/SmartStore.Services/Media/Search/MediaSearcher.cs b/src/Libraries/SmartStore.Services/Media/Search/MediaSearcher.cs index acae9d5821..c04b45786e 100644 --- a/src/Libraries/SmartStore.Services/Media/Search/MediaSearcher.cs +++ b/src/Libraries/SmartStore.Services/Media/Search/MediaSearcher.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Data.Entity; using System.Linq; -using System.Linq.Dynamic; +using System.Linq.Dynamic.Core; using SmartStore.Linq; using SmartStore.Core; using SmartStore.Core.Data; diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index ffd98f34b2..c9d5c77c23 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -136,9 +136,8 @@ - - ..\..\packages\System.Linq.Dynamic.1.0.7\lib\net40\System.Linq.Dynamic.dll - True + + ..\..\packages\System.Linq.Dynamic.Core.1.2.1\lib\net46\System.Linq.Dynamic.Core.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index ef25b4b8b4..ad072f1a76 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -21,6 +21,6 @@ - + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj index d1146ddf9a..69ebd0a824 100644 --- a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj +++ b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj @@ -74,11 +74,11 @@ False - ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + ..\..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll True - ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll True From b8600f1076ed79e760abd277cbacbfca698546f0 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Tue, 11 Aug 2020 02:26:51 +0200 Subject: [PATCH 027/695] Resolves #2037: Make SQL Server the default database option during installation --- .../SmartStore.Services/SmartStore.Services.csproj | 5 ++--- src/Libraries/SmartStore.Services/packages.config | 2 +- .../Localization/Installation/installation.de.xml | 4 ++-- .../Localization/Installation/installation.en.xml | 2 +- .../SmartStore.Web/Controllers/InstallController.cs | 4 ++-- .../SmartStore.Web/Views/Install/Index.cshtml | 8 ++++---- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index c9d5c77c23..3e31ccff40 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -117,9 +117,8 @@ ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\packages\NReco.PdfGenerator.1.1.15\lib\net20\NReco.PdfGenerator.dll - True + + ..\..\packages\NReco.PdfGenerator.1.2.0\lib\net45\NReco.PdfGenerator.dll ..\..\packages\NuGet.Core.2.14.0\lib\net40-Client\NuGet.Core.dll diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index ad072f1a76..207c0356f2 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -18,7 +18,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.de.xml b/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.de.xml index 974726bfe4..6e032bf7a4 100644 --- a/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.de.xml +++ b/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.de.xml @@ -63,7 +63,7 @@ Verbindungszeichenfolge angeben (Connection string) - (Empfohlen) + (empfohlen) Installation neu starten @@ -78,7 +78,7 @@ SQL Server Authentifizierung - Integrierte Datenbank verwenden (SQL Server Compact) + SQL Server Compact (ungeeignet im Produktivmodus) SQL Server Name diff --git a/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.en.xml b/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.en.xml index 8f3a768575..e746ce986a 100644 --- a/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.en.xml +++ b/src/Presentation/SmartStore.Web/App_Data/Localization/Installation/installation.en.xml @@ -75,7 +75,7 @@ Use SQL Server account - Use built-in data storage (SQL Server Compact) + SQL Server Compact (not suitable in production mode) SQL Server name diff --git a/src/Presentation/SmartStore.Web/Controllers/InstallController.cs b/src/Presentation/SmartStore.Web/Controllers/InstallController.cs index fd5665b58f..6cb7447ef3 100644 --- a/src/Presentation/SmartStore.Web/Controllers/InstallController.cs +++ b/src/Presentation/SmartStore.Web/Controllers/InstallController.cs @@ -189,8 +189,8 @@ public ActionResult Index() //ConfirmPassword = "admin", InstallSampleData = false, DatabaseConnectionString = "", - DataProvider = "sqlce", // "sqlserver", - SqlAuthenticationType = "sqlauthentication", + DataProvider = "sqlserver", // "sqlce" + SqlAuthenticationType = "sqlauthentication", SqlConnectionInfo = "sqlconnectioninfo_values", SqlServerCreateDatabase = false, UseCustomCollation = false, diff --git a/src/Presentation/SmartStore.Web/Views/Install/Index.cshtml b/src/Presentation/SmartStore.Web/Views/Install/Index.cshtml index cad7fa2ca1..3b5000a164 100644 --- a/src/Presentation/SmartStore.Web/Views/Install/Index.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Install/Index.cshtml @@ -137,10 +137,10 @@
- + @Html.ValidationMessageFor(x => x.DataProvider)
From 6ee1b3d4314106f896e394e892351b529d75d3ac Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Tue, 11 Aug 2020 16:13:25 +0200 Subject: [PATCH 028/695] API: custom routing convention (in progress) --- .../Controllers/OData/CustomersController.cs | 83 +++--- .../Controllers/OData/ProductsController.cs | 273 ++++++++++-------- .../Services/CustomRoutingConvention.cs | 130 +++++++-- 3 files changed, 307 insertions(+), 179 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 1065d36d18..7d1301d6ac 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -105,52 +105,74 @@ public async Task Delete(int key) #region Navigation properties - /// - /// Handle address assignments - /// - /// Customer id - /// Address id - /// Address + [WebApiQueryable(PagingOptional = true)] + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public HttpResponseMessage GetAddresses(int key, int relatedKey = 0 /*addressId*/) + { + var addresses = GetRelatedCollection(key, x => x.Addresses); + + if (relatedKey != 0) + { + var address = addresses.FirstOrDefault(x => x.Id == relatedKey); + + return Request.CreateResponseForEntity(address, relatedKey); + } + + return Request.CreateResponseForEntity(addresses, key); + } + [WebApiAuthenticate(Permission = Permissions.Customer.EditAddress)] - public HttpResponseMessage NavigationAddresses(int key, int relatedKey) + public HttpResponseMessage PostAddresses(int key, int relatedKey /*addressId*/) { - Address address = null; var entity = GetExpandedEntity(key, x => x.Addresses); + var address = entity.Addresses.FirstOrDefault(x => x.Id == relatedKey); - if (Request.Method == HttpMethod.Delete) + if (address == null) { - if (relatedKey == 0) - { - entity.BillingAddress = null; - entity.ShippingAddress = null; - entity.Addresses.Clear(); - Service.UpdateCustomer(entity); - } - else if ((address = _addressService.Value.GetAddressById(relatedKey)) != null) + // No assignment yet. + address = _addressService.Value.GetAddressById(relatedKey); + if (address == null) { - entity.RemoveAddress(address); - Service.UpdateCustomer(entity); + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(relatedKey)); } - return Request.CreateResponse(HttpStatusCode.NoContent); + entity.Addresses.Add(address); + Service.UpdateCustomer(entity); + + return Request.CreateResponse(HttpStatusCode.Created, address); } - address = _addressService.Value.GetAddressById(relatedKey); + return Request.CreateResponse(HttpStatusCode.OK, address); + } + + [WebApiAuthenticate(Permission = Permissions.Customer.EditAddress)] + public HttpResponseMessage DeleteAddresses(int key, int relatedKey = 0 /*addressId*/) + { + var entity = GetExpandedEntity(key, x => x.Addresses); - if (Request.Method == HttpMethod.Post) + if (relatedKey == 0) + { + // Remove assignments of all addresses. + entity.BillingAddress = null; + entity.ShippingAddress = null; + entity.Addresses.Clear(); + Service.UpdateCustomer(entity); + } + else { - if (address != null && entity.Addresses.FindAddress(address) == null) + // Remove assignment of certain address. + var address = _addressService.Value.GetAddressById(relatedKey); + if (address != null) { - entity.Addresses.Add(address); + entity.RemoveAddress(address); Service.UpdateCustomer(entity); - - return Request.CreateResponse(HttpStatusCode.Created, address); } } - return Request.CreateResponseForEntity(address, relatedKey); + return Request.CreateResponse(HttpStatusCode.NoContent); } + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] public SingleResult
GetBillingAddress(int key) @@ -189,13 +211,6 @@ public IQueryable GetReturnRequests(int key) return GetRelatedCollection(key, x => x.ReturnRequests); } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public IQueryable
GetAddresses(int key) - { - return GetRelatedCollection(key, x => x.Addresses); - } - [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] public IQueryable GetCustomerRoleMappings(int key) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index a1afbbe125..c79e74c746 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -132,174 +132,211 @@ public async Task Delete(int key) return result; } - #region Navigation properties + #region Navigation properties + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] + public SingleResult GetDeliveryTime(int key) + { + return GetRelatedEntity(key, x => x.DeliveryTime); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] + public SingleResult GetQuantityUnit(int key) + { + return GetRelatedEntity(key, x => x.QuantityUnit); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public SingleResult GetCountryOfOrigin(int key) + { + return GetRelatedEntity(key, x => x.CountryOfOrigin); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] + public SingleResult GetSampleDownload(int key) + { + return GetRelatedEntity(key, x => x.SampleDownload); + } + + + [WebApiQueryable(PagingOptional = true)] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProductCategories(int key, int relatedKey = 0 /*categoryId*/) + { + var productCategories = _categoryService.Value.GetProductCategoriesByProductId(key, true); + + if (relatedKey != 0) + { + var productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey); + + return Request.CreateResponseForEntity(productCategory, relatedKey); + } + + return Request.CreateResponseForEntity(productCategories, key); + } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] - public HttpResponseMessage NavigationProductCategories(int key, int relatedKey) + public HttpResponseMessage PostProductCategories(int key, int relatedKey /*categoryId*/) { - ProductCategory productCategory = null; var productCategories = _categoryService.Value.GetProductCategoriesByProductId(key, true); + var productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey); - if (Request.Method == HttpMethod.Delete) + if (productCategory == null) { - if (relatedKey == 0) - { - productCategories.Each(x => _categoryService.Value.DeleteProductCategory(x)); - } - else if ((productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey)) != null) - { - _categoryService.Value.DeleteProductCategory(productCategory); - } + productCategory = ReadContent() ?? new ProductCategory(); + productCategory.ProductId = key; + productCategory.CategoryId = relatedKey; - return Request.CreateResponse(HttpStatusCode.NoContent); + _categoryService.Value.InsertProductCategory(productCategory); + + return Request.CreateResponse(HttpStatusCode.Created, productCategory); } - productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey); + return Request.CreateResponse(HttpStatusCode.OK, productCategory); + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] + public HttpResponseMessage DeleteProductCategories(int key, int relatedKey = 0 /*categoryId*/) + { + var productCategories = _categoryService.Value.GetProductCategoriesByProductId(key, true); - if (Request.Method == HttpMethod.Post) + if (relatedKey == 0) { - if (productCategory == null) + productCategories.Each(x => _categoryService.Value.DeleteProductCategory(x)); + } + else + { + var productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey); + if (productCategory != null) { - productCategory = ReadContent() ?? new ProductCategory(); - productCategory.ProductId = key; - productCategory.CategoryId = relatedKey; - - _categoryService.Value.InsertProductCategory(productCategory); - - return Request.CreateResponse(HttpStatusCode.Created, productCategory); + _categoryService.Value.DeleteProductCategory(productCategory); } } - return Request.CreateResponseForEntity(productCategory, relatedKey); + return Request.CreateResponse(HttpStatusCode.NoContent); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] - public HttpResponseMessage NavigationProductManufacturers(int key, int relatedKey) + + [WebApiQueryable(PagingOptional = true)] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProductManufacturers(int key, int relatedKey = 0 /*manufacturerId*/) { - ProductManufacturer productManufacturer = null; var productManufacturers = _manufacturerService.Value.GetProductManufacturersByProductId(key, true); - if (Request.Method == HttpMethod.Delete) + if (relatedKey != 0) { - if (relatedKey == 0) - { - productManufacturers.Each(x => _manufacturerService.Value.DeleteProductManufacturer(x)); - } - else if ((productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey)) != null) - { - _manufacturerService.Value.DeleteProductManufacturer(productManufacturer); - } + var productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey); - return Request.CreateResponse(HttpStatusCode.NoContent); + return Request.CreateResponseForEntity(productManufacturer, relatedKey); } - productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey); + return Request.CreateResponseForEntity(productManufacturers, key); + } + + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] + public HttpResponseMessage PostProductManufacturers(int key, int relatedKey /*manufacturerId*/) + { + var productManufacturers = _manufacturerService.Value.GetProductManufacturersByProductId(key, true); + var productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey); - if (Request.Method == HttpMethod.Post) + if (productManufacturer == null) { - if (productManufacturer == null) - { - productManufacturer = ReadContent() ?? new ProductManufacturer(); - productManufacturer.ProductId = key; - productManufacturer.ManufacturerId = relatedKey; + productManufacturer = ReadContent() ?? new ProductManufacturer(); + productManufacturer.ProductId = key; + productManufacturer.ManufacturerId = relatedKey; - _manufacturerService.Value.InsertProductManufacturer(productManufacturer); + _manufacturerService.Value.InsertProductManufacturer(productManufacturer); - return Request.CreateResponse(HttpStatusCode.Created, productManufacturer); - } + return Request.CreateResponse(HttpStatusCode.Created, productManufacturer); } - return Request.CreateResponseForEntity(productManufacturer, relatedKey); + return Request.CreateResponse(HttpStatusCode.OK, productManufacturer); } - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] - public HttpResponseMessage NavigationProductPictures(int key, int relatedKey) - { - ProductMediaFile productPicture = null; - var productPictures = Service.GetProductPicturesByProductId(key); - - if (Request.Method == HttpMethod.Delete) - { - if (relatedKey == 0) - { - productPictures.Each(x => Service.DeleteProductPicture(x)); - } - else if ((productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey)) != null) - { - Service.DeleteProductPicture(productPicture); - } - - return Request.CreateResponse(HttpStatusCode.NoContent); - } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] + public HttpResponseMessage DeleteProductManufacturers(int key, int relatedKey = 0 /*manufacturerId*/) + { + var productManufacturers = _manufacturerService.Value.GetProductManufacturersByProductId(key, true); - productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey); + if (relatedKey == 0) + { + productManufacturers.Each(x => _manufacturerService.Value.DeleteProductManufacturer(x)); + } + else + { + var productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey); + if (productManufacturer != null) + { + _manufacturerService.Value.DeleteProductManufacturer(productManufacturer); + } + } - if (Request.Method == HttpMethod.Post) - { - if (productPicture == null) - { - productPicture = ReadContent() ?? new ProductMediaFile(); - productPicture.ProductId = key; - productPicture.MediaFileId = relatedKey; + return Request.CreateResponse(HttpStatusCode.NoContent); + } - Service.InsertProductPicture(productPicture); + + [WebApiQueryable(PagingOptional = true)] + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProductPictures(int key, int relatedKey = 0 /*mediaFileId*/) + { + var productPictures = Service.GetProductPicturesByProductId(key); - return Request.CreateResponse(HttpStatusCode.Created, productPicture); - } - } + if (relatedKey != 0) + { + var productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey); - return Request.CreateResponseForEntity(productPicture, relatedKey); - } + return Request.CreateResponseForEntity(productPicture, relatedKey); + } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] - public SingleResult GetDeliveryTime(int key) - { - return GetRelatedEntity(key, x => x.DeliveryTime); + return Request.CreateResponseForEntity(productPictures, key); } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult GetQuantityUnit(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] + public HttpResponseMessage PostProductPictures(int key, int relatedKey /*mediaFileId*/) { - return GetRelatedEntity(key, x => x.QuantityUnit); - } + var productPictures = Service.GetProductPicturesByProductId(key); + var productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey); - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetCountryOfOrigin(int key) - { - return GetRelatedEntity(key, x => x.CountryOfOrigin); - } + if (productPicture == null) + { + productPicture = ReadContent() ?? new ProductMediaFile(); + productPicture.ProductId = key; + productPicture.MediaFileId = relatedKey; - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] - public SingleResult GetSampleDownload(int key) - { - return GetRelatedEntity(key, x => x.SampleDownload); - } + Service.InsertProductPicture(productPicture); - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductCategories(int key) - { - return GetRelatedCollection(key, x => x.ProductCategories); - } + return Request.CreateResponse(HttpStatusCode.Created, productPicture); + } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductManufacturers(int key) - { - return GetRelatedCollection(key, x => x.ProductManufacturers); + return Request.CreateResponse(HttpStatusCode.OK, productPicture); } - [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductPictures(int key) + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] + public HttpResponseMessage DeleteProductPictures(int key, int relatedKey = 0 /*mediaFileId*/) { - return GetRelatedCollection(key, x => x.ProductPictures); + var productPictures = Service.GetProductPicturesByProductId(key); + + if (relatedKey == 0) + { + productPictures.Each(x => Service.DeleteProductPicture(x)); + } + else + { + var productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey); + if (productPicture != null) + { + Service.DeleteProductPicture(productPicture); + } + } + + return Request.CreateResponse(HttpStatusCode.NoContent); } + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] public IQueryable GetProductSpecificationAttributes(int key) diff --git a/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs b/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs index 893d9bb112..f2eba422c0 100644 --- a/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs +++ b/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs @@ -3,61 +3,126 @@ using System.Web.Http.Controllers; using System.Web.OData.Routing; using System.Web.OData.Routing.Conventions; +using SmartStore.Utilities; using SmartStore.Web.Framework.WebApi; namespace SmartStore.WebApi.Services { + /// + /// Used to serve URL paths that are ignored by OData by default. + /// + /// public class CustomRoutingConvention : EntitySetRoutingConvention { public override string SelectAction(ODataPath odataPath, HttpControllerContext context, ILookup actionMap) { var method = context.Request.Method; + var path = odataPath.PathTemplate; - if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation/key")) + if (path.IsCaseInsensitiveEqual("~/entityset/key/navigation/key") || + path.IsCaseInsensitiveEqual("~/entityset/key/navigation")) { + // We ignore standard OData path cause they differ: + // ~/entityset/key/$links/navigation (OData 3 "link"), ~/entityset/key/navigation/$ref (OData 4 "reference"). + if (method == HttpMethod.Get || method == HttpMethod.Post || method == HttpMethod.Delete) { - // We ignore standard OData path cause they differ: - // ~/entityset/key/$links/navigation (OData 3 "link"), ~/entityset/key/navigation/$ref (OData 4 "reference") - - var navigationProperty = GetNavigation(odataPath, 2); + // Add keys to route data, so they will bind to action parameters. + var navigationProperty = GetNavigationName(odataPath, 2); if (navigationProperty.IsEmpty()) { throw context.Request.BadRequestException(WebApiGlobal.Error.NoNavigationFromPath); } - var methodName = string.Concat("Navigation", navigationProperty); + if (GetNormalizedKey(odataPath, 1, out var key) && key != 0) + { + context.RouteData.Values[ODataRouteConstants.Key] = key; + } + else + { + throw context.Request.BadRequestException(WebApiGlobal.Error.NoKeyFromPath); + } + + // Allow relatedKey = 0 to remove all assignments. + if (GetNormalizedKey(odataPath, 3, out var relatedKey)) + { + context.RouteData.Values[ODataRouteConstants.RelatedKey] = relatedKey; + } + else if (method == HttpMethod.Post) + { + // relatedKey is mandatory. + throw context.Request.BadRequestException(WebApiGlobal.Error.NoRelatedKeyFromPath); + } + + var methodName = Inflector.Capitalize(method.ToString()) + navigationProperty; + if (actionMap.Contains(methodName)) + { + return methodName; + } - $"process custom path {methodName}".Dump(); + //$"process custom path {methodName} {actionMap.Contains(methodName)}".Dump(); } } + else if (path.IsCaseInsensitiveEqual("~/entityset/key/property")) + { + if (method == HttpMethod.Get) + { + if (GetNormalizedKey(odataPath, 1, out var key) && key != 0) + { + context.RouteData.Values[ODataRouteConstants.Key] = key; + } + else + { + throw context.Request.BadRequestException(WebApiGlobal.Error.NoKeyFromPath); + } - // Not a match. + var propertyName = GetPropertyName(odataPath, 2); + + if (propertyName.IsEmpty()) + { + throw context.Request.BadRequestException(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(string.Empty)); + } + + //GetProperty + var methodName = Inflector.Capitalize(method.ToString()) + propertyName; + if (actionMap.Contains(methodName)) + { + return methodName; + } + } + } + + // Not a match. We do not support requested path. return null; } #region Utilities - // public static bool GetNormalizedKey(this ODataPath odataPath, int segmentIndex, out int key) - //{ - // if (odataPath.Segments.Count > segmentIndex) - // { - // string rawKey = (odataPath.Segments[segmentIndex] as KeyValuePathSegment).Value; - // if (rawKey.HasValue()) - // { - // if (rawKey.StartsWith("'")) - // rawKey = rawKey.Substring(1, rawKey.Length - 2); - - // if (int.TryParse(rawKey, out key)) - // return true; - // } - // } - // key = 0; - // return false; - //} - - private static string GetNavigation(ODataPath odataPath, int segmentIndex) + private static bool GetNormalizedKey(ODataPath odataPath, int segmentIndex, out int key) + { + if (odataPath.Segments.Count > segmentIndex) + { + var rawKey = (odataPath.Segments[segmentIndex] as KeyValuePathSegment).Value; + if (rawKey.HasValue()) + { + if (rawKey.StartsWith("'")) + { + rawKey = rawKey.Substring(1, rawKey.Length - 2); + } + + if (int.TryParse(rawKey, out key)) + { + return true; + } + } + } + + key = 0; + return false; + } + + private static string GetNavigationName(ODataPath odataPath, int segmentIndex) { if (odataPath.Segments.Count > segmentIndex) { @@ -68,6 +133,17 @@ private static string GetNavigation(ODataPath odataPath, int segmentIndex) return null; } + private static string GetPropertyName(ODataPath odataPath, int segmentIndex) + { + if (odataPath.Segments.Count > segmentIndex) + { + var propertyName = (odataPath.Segments[segmentIndex] as PropertyAccessPathSegment).PropertyName; + return propertyName; + } + + return null; + } + #endregion } } \ No newline at end of file From bccaa31bcb19fe514881c8bf59ae10360b2122c9 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Tue, 11 Aug 2020 21:54:13 +0200 Subject: [PATCH 029/695] API: custom routing convention (final) --- .../Controllers/OData/AddressesController.cs | 7 + .../OData/BlogCommentsController.cs | 7 + .../Controllers/OData/BlogPostsController.cs | 7 + .../Controllers/OData/CategoriesController.cs | 7 + .../Controllers/OData/CountriesController.cs | 7 + .../Controllers/OData/CurrenciesController.cs | 7 + .../OData/CustomerRoleMappingsController.cs | 7 + .../OData/CustomerRolesController.cs | 7 + .../Controllers/OData/CustomersController.cs | 6 + .../OData/DeliveryTimesController.cs | 7 + .../Controllers/OData/DiscountsController.cs | 7 + .../Controllers/OData/DownloadsController.cs | 7 + .../OData/GenericAttributesController.cs | 6 + .../Controllers/OData/LanguagesController.cs | 7 + .../OData/LocalizedPropertiesController.cs | 6 + .../OData/ManufacturersController.cs | 9 +- .../OData/MeasureDimensionsController.cs | 9 +- .../OData/MeasureWeightsController.cs | 9 +- .../NewsLetterSubscriptionsController.cs | 14 +- .../Controllers/OData/OrderItemsController.cs | 7 + .../Controllers/OData/OrderNotesController.cs | 11 +- .../Controllers/OData/OrdersController.cs | 6 + .../OData/PaymentMethodsController.cs | 7 + .../ProductAttributeOptionsController.cs | 7 + .../ProductAttributeOptionsSetsController.cs | 7 + .../OData/ProductAttributesController.cs | 7 + .../OData/ProductBundleItemsController.cs | 7 + .../OData/ProductCategoriesController.cs | 7 + .../OData/ProductManufacturersController.cs | 7 + .../OData/ProductPicturesController.cs | 7 + ...roductSpecificationAttributesController.cs | 7 + ...tVariantAttributeCombinationsController.cs | 7 + ...ProductVariantAttributeValuesController.cs | 7 + .../ProductVariantAttributesController.cs | 7 + .../Controllers/OData/ProductsController.cs | 6 + .../OData/QuantityUnitsController.cs | 7 + .../OData/RelatedProductsController.cs | 7 + .../OData/ReturnRequestsController.cs | 7 + .../Controllers/OData/SettingsController.cs | 7 + .../OData/ShipmentItemsController.cs | 7 + .../Controllers/OData/ShipmentsController.cs | 7 + .../OData/ShippingMethodsController.cs | 7 + ...SpecificationAttributeOptionsController.cs | 7 + .../SpecificationAttributesController.cs | 7 + .../OData/StateProvincesController.cs | 7 + .../OData/StoreMappingsController.cs | 6 + .../Controllers/OData/StoresController.cs | 7 + .../OData/SyncMappingsController.cs | 6 + .../OData/TaxCategoriesController.cs | 7 + .../Controllers/OData/TierPricesController.cs | 7 + .../Controllers/OData/UrlRecordsController.cs | 6 + src/Plugins/SmartStore.WebApi/Description.txt | 2 +- .../Services/CustomRoutingConvention.cs | 95 +- .../SmartStore.WebApi.csproj | 3 - src/Plugins/SmartStore.WebApi/changelog.md | 104 -- .../WebApi/WebApiEntityController.cs | 955 +----------------- 56 files changed, 448 insertions(+), 1077 deletions(-) delete mode 100644 src/Plugins/SmartStore.WebApi/changelog.md diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs index 1eef895022..abc1ce01e0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -44,6 +45,12 @@ public SingleResult
Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Customer.Create)] public IHttpActionResult Post(Address entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs index 7fbdcc6651..691280cc65 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -51,6 +52,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Create)] public IHttpActionResult Post(BlogComment entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs index 2f5c151f3e..1dd55e6d51 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -47,6 +48,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Create)] public IHttpActionResult Post(BlogPost entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs index da335af975..a7821927c0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -47,6 +48,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Create)] public IHttpActionResult Post(Category entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs index 0c0599a620..49bd885456 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Create)] public IHttpActionResult Post(Country entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs index 6abbd30456..a78a6c9ec5 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Create)] public IHttpActionResult Post(Currency entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs index 9c21dc55cf..1d89824fa0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Customer.EditRole)] public IHttpActionResult Post(CustomerRoleMapping entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs index bd7a3d1091..bace05aee0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Net; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -28,6 +29,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Customer.Role.Create)] public IHttpActionResult Post(CustomerRole entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 7d1301d6ac..93cddb03c3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -50,6 +50,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Customer.Create)] public IHttpActionResult Post(Customer entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs index 649ce3194f..a9bd1a19b9 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Create)] public IHttpActionResult Post(DeliveryTime entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs index 1dd70f414f..df4efe9c77 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -28,6 +29,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Create)] public IHttpActionResult Post(Discount entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs index ea82ca2836..856f5a462f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Media.Download.Create)] public IHttpActionResult Post(Download entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs index 7aedad51ae..9a073846b7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -25,6 +26,11 @@ public SingleResult Get(int key) return GetSingleResult(key); } + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + public IHttpActionResult Post(GenericAttribute entity) { var result = Insert(entity, () => Service.InsertAttribute(entity)); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs index 2d1f4afaf6..ec58bc0c56 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Create)] public IHttpActionResult Post(Language entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs index e24b3ab85f..dc8f046299 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -25,6 +26,11 @@ public SingleResult Get(int key) return GetSingleResult(key); } + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + public IHttpActionResult Post(LocalizedProperty entity) { var result = Insert(entity, () => Service.InsertLocalizedProperty(entity)); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs index 67d7a85b59..c89c03e7a9 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -34,7 +35,7 @@ from x in this.Repository.Table } [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] public IQueryable Get() { return GetEntitySet(); @@ -47,6 +48,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Create)] public IHttpActionResult Post(Manufacturer entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs index 10e83615f7..5e1ff6dc6f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -14,7 +15,7 @@ namespace SmartStore.WebApi.Controllers.OData public class MeasureDimensionsController : WebApiEntityController { [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] public IQueryable Get() { return GetEntitySet(); @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] public IHttpActionResult Post(MeasureDimension entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs index 7170408664..9d5c27d0d3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -14,7 +15,7 @@ namespace SmartStore.WebApi.Controllers.OData public class MeasureWeightsController : WebApiEntityController { [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] public IQueryable Get() { return GetEntitySet(); @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] public IHttpActionResult Post(MeasureWeight entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs index e950390cce..7ca5fb06f5 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -14,18 +15,25 @@ namespace SmartStore.WebApi.Controllers.OData public class NewsLetterSubscriptionsController : WebApiEntityController { [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public IQueryable Get() + [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Read)] + public IQueryable Get() { return GetEntitySet(); } [WebApiQueryable] - public SingleResult Get(int key) + [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Read)] + public SingleResult Get(int key) { return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + // There is no insert permission because a subscription is always created by customer. [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Update)] public IHttpActionResult Post(NewsLetterSubscription entity) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs index f73fc2a2ca..80487b446e 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Net; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -41,6 +42,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] public IHttpActionResult Post(OrderItem entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs index c539d054a7..aa7bf8296a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Net; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -23,11 +24,17 @@ public IQueryable Get() [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult GetOrderNote(int key) + public SingleResult Get(int key) { return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Order.Update)] public IHttpActionResult Post(OrderNote entity) { @@ -36,7 +43,7 @@ public IHttpActionResult Post(OrderNote entity) var order = Service.GetOrderById(entity.OrderId); if (order == null || order.Deleted) { - throw ExceptionEntityNotFound(entity.OrderId); + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(entity.OrderId)); } Service.AddOrderNote(order, entity.Note, entity.DisplayToCustomer); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index 8abc376d50..32c0f3dca7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -57,6 +57,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Order.Create)] public IHttpActionResult Post(Order entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs index 53c6c18136..d4a4f73082 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Net; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -28,6 +29,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + // Update permission sufficient here. [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Update)] public IHttpActionResult Post(PaymentMethod entity) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs index a820cf0e27..7a91ca362c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] public IHttpActionResult Post(ProductAttributeOption entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs index c5dbdc8e7b..55c54bb588 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.EditSet)] public IHttpActionResult Post(ProductAttributeOptionsSet entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs index fc828f1e23..60295fcb38 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Create)] public IHttpActionResult Post(ProductAttribute entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs index b70f6ce115..58631b8fb0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditBundle)] public IHttpActionResult Post(ProductBundleItem entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs index 2dad9fb4ac..8a691b80ef 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] public IHttpActionResult Post(ProductCategory entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs index d56460f60e..60a4ef3c0f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] public IHttpActionResult Post(ProductManufacturer entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs index 3203b4f6fe..07597a77c7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -28,6 +29,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] public IHttpActionResult Post(ProductMediaFile entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs index ce1d3f528b..39eb2c9548 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditAttribute)] public IHttpActionResult Post(ProductSpecificationAttribute entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs index 545df638d8..ce2709fb5b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -28,6 +29,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] public IHttpActionResult Post(ProductVariantAttributeCombination entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs index 5b42d5be4c..c103c54d51 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] public IHttpActionResult Post(ProductVariantAttributeValue entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs index 449d3274e8..b404129266 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] public IHttpActionResult Post(ProductVariantAttribute entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index c79e74c746..de5f207710 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -77,6 +77,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Create)] public IHttpActionResult Post(Product entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs index bc73ed1586..03a19c0a7c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Create)] public IHttpActionResult Post(QuantityUnit entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs index adeee5d791..7785aed816 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPromotion)] public IHttpActionResult Post(RelatedProduct entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs index 91f5467cfc..56a34ae9c5 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Net; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,6 +30,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Customer.Create)] public IHttpActionResult Post(ReturnRequest entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs index 9e19004f8a..1136d56b84 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Create)] public IHttpActionResult Post(Setting entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs index 0be2285599..a5da584fef 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] public IHttpActionResult Post(ShipmentItem entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs index 12b02ef6dd..7faead5cdb 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] public IHttpActionResult Post(Shipment entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs index bb9928fb93..b172febdec 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Create)] public IHttpActionResult Post(ShippingMethod entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs index 8c54098f66..01b82d5a21 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.EditOption)] public IHttpActionResult Post(SpecificationAttributeOption entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs index 2994d7c258..b8c4a4c6b6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Create)] public IHttpActionResult Post(SpecificationAttribute entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs index b450dba788..7da8f87f11 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Create)] public IHttpActionResult Post(StateProvince entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs index 82c20ecb18..c61016b7af 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -25,6 +26,11 @@ public SingleResult Get(int key) return GetSingleResult(key); } + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + public IHttpActionResult Post(StoreMapping entity) { var result = Insert(entity, () => Service.InsertStoreMapping(entity)); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs index 715dccbd3c..64570cabad 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Create)] public IHttpActionResult Post(Store entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs index 5fbd37ba7a..969f45ba9f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -25,6 +26,11 @@ public SingleResult Get(int key) return GetSingleResult(key); } + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + public IHttpActionResult Post(SyncMapping entity) { var result = Insert(entity, () => Service.InsertSyncMapping(entity)); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs index dfc94d598c..5add9b60c4 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Create)] public IHttpActionResult Post(TaxCategory entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs index 543dc6a7e3..9bc0ab575f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -27,6 +28,12 @@ public SingleResult Get(int key) return GetSingleResult(key); } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditTierPrice)] public IHttpActionResult Post(TierPrice entity) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs index bbc1aca985..4889655ac5 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs @@ -1,5 +1,6 @@ using System.Linq; using System.Net; +using System.Net.Http; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Seo; @@ -25,6 +26,11 @@ public SingleResult Get(int key) return GetSingleResult(key); } + public HttpResponseMessage GetProperty(int key, string propertyName) + { + return GetPropertyValue(key, propertyName); + } + public IHttpActionResult Post(UrlRecord entity) { throw new HttpResponseException(HttpStatusCode.Forbidden); diff --git a/src/Plugins/SmartStore.WebApi/Description.txt b/src/Plugins/SmartStore.WebApi/Description.txt index ef2e93639e..6c569e9191 100644 --- a/src/Plugins/SmartStore.WebApi/Description.txt +++ b/src/Plugins/SmartStore.WebApi/Description.txt @@ -1,6 +1,6 @@ FriendlyName: Smartstore Web API SystemName: Smartstore.WebApi -Group: Api +Group: API Version: 4.0.1 MinAppVersion: 4.0.1 Author: SmartStore AG diff --git a/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs b/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs index f2eba422c0..5675411cb9 100644 --- a/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs +++ b/src/Plugins/SmartStore.WebApi/Services/CustomRoutingConvention.cs @@ -11,30 +11,42 @@ namespace SmartStore.WebApi.Services /// /// Used to serve URL paths that are ignored by OData by default. /// + /// /// public class CustomRoutingConvention : EntitySetRoutingConvention { + private static readonly string[] _navigationPaths = new string[] + { + "~/entityset/key/navigation/key", + "~/entityset/key/navigation" + }; + + private static readonly string[] _propertyPaths = new string[] + { + "~/entityset/key/property", + "~/entityset/key/cast/property", + "~/singleton/property", + "~/singleton/cast/property" + }; + public override string SelectAction(ODataPath odataPath, HttpControllerContext context, ILookup actionMap) { - var method = context.Request.Method; - var path = odataPath.PathTemplate; + var path = odataPath?.PathTemplate; + var method = context?.Request?.Method; - if (path.IsCaseInsensitiveEqual("~/entityset/key/navigation/key") || - path.IsCaseInsensitiveEqual("~/entityset/key/navigation")) + if (path == null || method == null) { - // We ignore standard OData path cause they differ: + return null; + } + + if (_navigationPaths.Contains(path)) + { + // Standard OData path differ: // ~/entityset/key/$links/navigation (OData 3 "link"), ~/entityset/key/navigation/$ref (OData 4 "reference"). if (method == HttpMethod.Get || method == HttpMethod.Post || method == HttpMethod.Delete) { // Add keys to route data, so they will bind to action parameters. - var navigationProperty = GetNavigationName(odataPath, 2); - - if (navigationProperty.IsEmpty()) - { - throw context.Request.BadRequestException(WebApiGlobal.Error.NoNavigationFromPath); - } - if (GetNormalizedKey(odataPath, 1, out var key) && key != 0) { context.RouteData.Values[ODataRouteConstants.Key] = key; @@ -44,6 +56,12 @@ public override string SelectAction(ODataPath odataPath, HttpControllerContext c throw context.Request.BadRequestException(WebApiGlobal.Error.NoKeyFromPath); } + var navPropertyName = (odataPath.Segments[2] as NavigationPathSegment)?.NavigationPropertyName; + if (navPropertyName.IsEmpty()) + { + throw context.Request.BadRequestException(WebApiGlobal.Error.NoNavigationFromPath); + } + // Allow relatedKey = 0 to remove all assignments. if (GetNormalizedKey(odataPath, 3, out var relatedKey)) { @@ -55,37 +73,40 @@ public override string SelectAction(ODataPath odataPath, HttpControllerContext c throw context.Request.BadRequestException(WebApiGlobal.Error.NoRelatedKeyFromPath); } - var methodName = Inflector.Capitalize(method.ToString()) + navigationProperty; + var methodName = Inflector.Capitalize(method.ToString()) + navPropertyName; if (actionMap.Contains(methodName)) { return methodName; } - - //$"process custom path {methodName} {actionMap.Contains(methodName)}".Dump(); } } - else if (path.IsCaseInsensitiveEqual("~/entityset/key/property")) + else if (_propertyPaths.Contains(path)) { if (method == HttpMethod.Get) { - if (GetNormalizedKey(odataPath, 1, out var key) && key != 0) + if (path.StartsWith("~/entityset/key")) { - context.RouteData.Values[ODataRouteConstants.Key] = key; + if (GetNormalizedKey(odataPath, 1, out var key) && key != 0) + { + context.RouteData.Values[ODataRouteConstants.Key] = key; + } + else + { + throw context.Request.BadRequestException(WebApiGlobal.Error.NoKeyFromPath); + } } - else + + var propertyName = (odataPath.Segments.Last() as PropertyAccessPathSegment)?.PropertyName; + if (propertyName.HasValue()) { - throw context.Request.BadRequestException(WebApiGlobal.Error.NoKeyFromPath); + context.RouteData.Values["propertyName"] = propertyName; } - - var propertyName = GetPropertyName(odataPath, 2); - - if (propertyName.IsEmpty()) + else { throw context.Request.BadRequestException(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(string.Empty)); } - //GetProperty - var methodName = Inflector.Capitalize(method.ToString()) + propertyName; + var methodName = Inflector.Capitalize(method.ToString()) + "Property"; if (actionMap.Contains(methodName)) { return methodName; @@ -122,28 +143,6 @@ private static bool GetNormalizedKey(ODataPath odataPath, int segmentIndex, out return false; } - private static string GetNavigationName(ODataPath odataPath, int segmentIndex) - { - if (odataPath.Segments.Count > segmentIndex) - { - var navigationProperty = (odataPath.Segments[segmentIndex] as NavigationPathSegment).NavigationPropertyName; - return navigationProperty; - } - - return null; - } - - private static string GetPropertyName(ODataPath odataPath, int segmentIndex) - { - if (odataPath.Segments.Count > segmentIndex) - { - var propertyName = (odataPath.Segments[segmentIndex] as PropertyAccessPathSegment).PropertyName; - return propertyName; - } - - return null; - } - #endregion } } \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index f2fe3a6b8f..3944793f73 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -340,9 +340,6 @@ - - PreserveNewest - Designer diff --git a/src/Plugins/SmartStore.WebApi/changelog.md b/src/Plugins/SmartStore.WebApi/changelog.md deleted file mode 100644 index e6231f2392..0000000000 --- a/src/Plugins/SmartStore.WebApi/changelog.md +++ /dev/null @@ -1,104 +0,0 @@ -#Release Notes - -##Web Api 4.0.0.0 -###New Features -* #1809 Added a parameter to start an import after uploading import files. -* #1801 Added endpoints for ProductPicture, ProductCategory, ProductManufacturer to allow to update DisplayOrder. -* Added endpoints for CustomerRoleMapping. - -##Web Api 3.1.5.1 -###New Features -* Added endpoints for ProductSpecificationAttribute. - -##Web Api 3.0.3.1 -###New Features -* Added endpoint to get order in PDF format. -* Added endpoint to complete an order. -* Added endpoints for MeasureWeight and MeasureDimension. -###Bugfixes -* Fixed instance must not be null exception. - -##Web Api 3.0.0.1 -###New Features -* Added endpoints for blog post and blog comment. - -##Web Api 2.6.0.5 -###New Features -* #1072 Add support for TaxCategory. -* #1074 Extend product image upload to allow updating of images. -* #1064 Deleting all product categories/manufacturers per product in one go. -* #1063 Adding product category/manufacturer ignores any other property like DisplayOrder. -* Added endpoint "Infos" for order and order item entity for additional information like aggregated data. -* Added endpoints for new entity ProductAttributeOption. -###Improvements -* #1073 Settings for maximum pagesize ($top) and maximum expansion depth ($expand). - -##Web Api 2.6.0.4 -###Improvements -* Filter options for user grid on configuration page - -##Web Api 2.6.0.3 -###Bugfixes -* Products.ManageAttributes with Synchronize set to true should only delete an attribute if it has no values and if its control type supports configuring values - -##Web Api 2.6.0.2 -###New Features -* Integration of Swagger documentation - -##Web Api 2.6.0.1 -###New Features -* #1002 Add support for addresses and customer roles navigation property of customer entity - -##Web Api 2.5.0.1 -###New Features -* Option to allow authentification without MD5 content hash - -##Web Api 2.2.0.5 -###New Features -* Bridge to import framework: uploading import files to import profile directory - -##Web Api 2.2.0.4 -###New Features -* Added OData endpoint for shipment items -* Added OData action to add a shipment to an order and to set it as shipped -###Improvements -* OData actions should return SingleResult (instead of entity instance) to let expand option be recognized - -##Web Api 2.2.0.3 -###New Features -* Added OData endpoint for payment method -* #727 Option to deactivate TimestampOlderThanLastRequest validation -* #731 Allow deletion and inserting of product category and manufacturer assignments -###Improvements -* Using header timestamp as last user request date rather than API server date - -##Web Api 2.2.0.2 -###Improvements -* WebApiAuthenticate attribute can be applied on methods too -* Product image upload requires manage catalog permission - -##Web Api 2.2.0.1 -###New Features -* #652 Support for file upload and multipart mime - -##Web Api 1.32 -###New Features -* #618 Add endpoint for quantity units - -##Web Api 1.31 -###Bugfixes -* WebApiController requires more permission checks - -##Web Api 1.23 -###New Features -* #431 Add support for localized properties - -##Web Api 1.22 -###New Features -* #393 Implement OData actions for simpler working with product attributes -> added ProductsController.ManageAttributes and ProductsController.CreateAttributeCombinations - -##Web Api 1.21 -###Improvements -* #384 Inserting sluged recources like products require an URL record -###Bugfixes -* PUT implementation was incomplete \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index 3f164e0760..f18661dbe8 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -10,10 +10,6 @@ using System.Web.Http; using System.Web.OData; using System.Web.OData.Formatter; -//using System.Web.Http.OData; -//using System.Web.Http.OData.Extensions; -//using System.Web.Http.OData.Formatter; -//using System.Web.Http.OData.Routing; using Autofac; using SmartStore.ComponentModel; using SmartStore.Core; @@ -42,24 +38,9 @@ public abstract class WebApiEntityController : ODataControlle ///
public virtual ICommonServices Services { get; set; } - protected internal HttpResponseException ExceptionEntityNotFound(TKey key) - { - var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - - return new HttpResponseException(response); - } - - protected internal HttpResponseException ExceptionNotExpanded(Expression> path) - { - // NotFound cause of nullable properties. - var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.PropertyNotExpanded.FormatInvariant(path.ToString())); - - return new HttpResponseException(response); - } - protected internal virtual IQueryable GetEntitySet() { - return this.Repository.Table; + return Repository.Table; } protected internal virtual IQueryable GetExpandedEntitySet(Expression> path) @@ -83,12 +64,15 @@ protected internal virtual IQueryable GetExpandedEntitySet(string prope protected internal virtual TEntity GetEntityByKeyNotNull(int key) { if (!ModelState.IsValid) + { throw this.InvalidModelStateException(); + } - var entity = this.Repository.GetById(key); - + var entity = Repository.GetById(key); if (entity == null) - throw ExceptionEntityNotFound(key); + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } return entity; } @@ -103,7 +87,6 @@ protected internal virtual SingleResult GetSingleResult(int key) var entity = GetEntitySet().FirstOrDefault(x => x.Id == key); return GetSingleResult(entity); - //return SingleResult.Create(GetEntitySet().Where(x => x.Id == key)); } protected internal virtual SingleResult GetSingleResult(TEntity entity) @@ -114,14 +97,17 @@ protected internal virtual SingleResult GetSingleResult(TEntity entity) protected internal virtual TEntity GetExpandedEntity(int key, Expression> path) { if (!ModelState.IsValid) + { throw this.InvalidModelStateException(); + } var query = GetExpandedEntitySet(path); - var entity = query.FirstOrDefault(x => x.Id == key); if (entity == null) - throw ExceptionEntityNotFound(key); + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } return entity; } @@ -129,14 +115,17 @@ protected internal virtual TEntity GetExpandedEntity(int key, Express protected internal virtual TEntity GetExpandedEntity(int key, string properties) { if (!ModelState.IsValid) + { throw this.InvalidModelStateException(); + } var query = GetExpandedEntitySet(properties); - var entity = query.FirstOrDefault(x => x.Id == key); if (entity == null) - throw ExceptionEntityNotFound(key); + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } return entity; } @@ -151,9 +140,10 @@ protected internal virtual TEntity GetExpandedEntity(int key, SingleResult x.Id == key); - if (entity == null) - throw ExceptionEntityNotFound(key); + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } return entity; } @@ -166,7 +156,9 @@ protected internal virtual TProperty GetExpandedProperty(int key, Exp var property = expression.Invoke(entity); if (property == null) - throw ExceptionNotExpanded(path); + { + throw Request.NotFoundException(WebApiGlobal.Error.PropertyNotExpanded.FormatInvariant(path.ToString())); + } return property; } @@ -209,6 +201,25 @@ protected internal virtual SingleResult GetRelatedEntity( return SingleResult.Create(query); } + protected internal virtual HttpResponseMessage GetPropertyValue(int key, string propertyName) + { + var entity = GetEntitySet().FirstOrDefault(x => x.Id == key); + if (entity == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } + + var prop = FastProperty.GetProperty(entity.GetType(), propertyName); + if (prop == null) + { + throw Request.BadRequestException(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName.EmptyNull())); + } + + var propertyValue = prop.GetValue(entity); + + return Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); + } + protected internal virtual IHttpActionResult Insert(TEntity entity, Action insert) { if (!ModelState.IsValid) @@ -382,886 +393,4 @@ protected internal virtual T ReadContent() return Request.Content.ReadAsAsync(formatters).Result; } } - - #region Old WebApiEntityController - - //public abstract class WebApiEntityController : EntitySetController - // where TEntity : BaseEntity, new() - //{ - - // protected internal HttpResponseException ExceptionEntityNotFound(TKey key) - // { - // var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, - // WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - - // return new HttpResponseException(response); - // } - - // protected internal HttpResponseException ExceptionNotExpanded(Expression> path) - // { - // // NotFound cause of nullable properties - // var response = Request.CreateErrorResponse(HttpStatusCode.NotFound, - // WebApiGlobal.Error.PropertyNotExpanded.FormatInvariant(path.ToString())); - - // return new HttpResponseException(response); - // } - - // public override HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) - // { - // if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/property") || - // odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/cast/property") || - // odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/unresolved")) - // { - // if (Request.Method == HttpMethod.Get || Request.Method == HttpMethod.Post) - // { - // return UnmappedGetProperty(odataPath); - // } - // } - // else if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation/key")) - // { - // if (Request.Method == HttpMethod.Get || Request.Method == HttpMethod.Post || Request.Method == HttpMethod.Delete) - // { - // // we ignore standard odata path cause they differ: - // // ~/entityset/key/$links/navigation (odata 3 "link"), ~/entityset/key/navigation/$ref (odata 4 "reference") - - // return UnmappedGetNavigation(odataPath); - // } - // } - // else if (odataPath.PathTemplate.IsCaseInsensitiveEqual("~/entityset/key/navigation")) - // { - // if (Request.Method == HttpMethod.Delete) - // { - // return UnmappedGetNavigation(odataPath); - // } - // } - - // return base.HandleUnmappedRequest(odataPath); - // } - - // protected virtual internal HttpResponseMessage UnmappedGetProperty(ODataPath odataPath) - // { - // int key; - - // if (!odataPath.GetNormalizedKey(1, out key)) - // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoKeyFromPath); - - // var entity = GetEntityByKey(key); - - // if (entity == null) - // return Request.CreateErrorResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - - // FastProperty prop = null; - // string propertyName = null; - // var lastSegment = odataPath.Segments.Last(); - // var propertySegment = (lastSegment as PropertyAccessPathSegment); - - // if (propertySegment == null) - // propertyName = lastSegment.ToString(); - // else - // propertyName = propertySegment.PropertyName; - - // if (propertyName.HasValue()) - // prop = FastProperty.GetProperty(entity.GetType(), propertyName); - - // if (prop == null) - // return UnmappedGetProperty(entity, propertyName ?? ""); - - // var propertyValue = prop.GetValue(entity); - - // return Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); - // } - - // protected virtual internal HttpResponseMessage UnmappedGetProperty(TEntity entity, string propertyName) - // { - // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName)); - // } - - // protected virtual internal HttpResponseMessage UnmappedGetNavigation(ODataPath odataPath) - // { - // int key, relatedKey; - - // if (!odataPath.GetNormalizedKey(1, out key)) - // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoKeyFromPath); - - // var navigationProperty = odataPath.GetNavigation(2); - - // if (navigationProperty.IsEmpty()) - // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoNavigationFromPath); - - // if (!odataPath.GetNormalizedKey(3, out relatedKey) && Request.Method != HttpMethod.Delete) - // return Request.CreateErrorResponse(HttpStatusCode.BadRequest, WebApiGlobal.Error.NoRelatedKeyFromPath); - - // var methodName = string.Concat("Navigation", navigationProperty); - // var methodInfo = GetType().GetMethod(methodName); - - // if (methodInfo != null) - // { - // HttpResponseMessage response = null; - - // this.ProcessEntity(() => - // { - // response = (HttpResponseMessage)methodInfo.Invoke(this, new object[] { key, relatedKey }); - // }); - - // return response; - // } - // return base.HandleUnmappedRequest(odataPath); - // } - - // /// - // /// Auto injected by Autofac - // /// - // public virtual IRepository Repository - // { - // get; - // set; - // } - - // /// - // /// Auto injected by Autofac - // /// - // public virtual TService Service - // { - // get; - // set; - // } - - // /// - // /// Auto injected by Autofac - // /// - // public virtual ICommonServices Services - // { - // get; - // set; - // } - - // public override IQueryable Get() - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // return this.GetEntitySet(); - // } - - // protected internal virtual IQueryable GetEntitySet() - // { - // return this.Repository.Table; - // } - - // protected internal virtual IQueryable GetExpandedEntitySet(Expression> path) - // { - // var query = GetEntitySet().Expand(path); - // return query; - // } - - // protected internal virtual IQueryable GetExpandedEntitySet(string properties) - // { - // var query = GetEntitySet(); - - // foreach (var property in properties.SplitSafe(",")) - // { - // query = query.Expand(property.Trim()); - // } - - // return query; - // } - - // protected override int GetKey(TEntity entity) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // return entity.Id; - // } - - // protected override TEntity GetEntityByKey(int key) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // return this.Repository.GetById(key); - // } - - // protected internal virtual TEntity GetEntityByKeyNotNull(int key) - // { - // var entity = GetEntityByKey(key); - - // if (entity == null) - // throw ExceptionEntityNotFound(key); - - // return entity; - // } - - // protected internal virtual SingleResult GetSingleResult(int key) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // return SingleResult.Create(GetEntitySet().Where(x => x.Id == key)); - // } - - // protected internal virtual TEntity GetExpandedEntity(int key, Expression> path) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // var query = GetExpandedEntitySet(path); - - // var entity = query.FirstOrDefault(x => x.Id == key); - - // if (entity == null) - // throw ExceptionEntityNotFound(key); - - // return entity; - // } - // protected internal virtual TEntity GetExpandedEntity(int key, string properties) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // var query = GetExpandedEntitySet(properties); - - // var entity = query.FirstOrDefault(x => x.Id == key); - - // if (entity == null) - // throw ExceptionEntityNotFound(key); - - // return entity; - // } - - // protected internal virtual TEntity GetExpandedEntity(int key, SingleResult result, string path) - // { - // var query = result.Queryable; - - // foreach (var property in path.SplitSafe(",")) - // { - // query = query.Expand(property.Trim()); - // } - - // var entity = query.FirstOrDefault(x => x.Id == key); - - // if (entity == null) - // throw ExceptionEntityNotFound(key); - - // return entity; - // } - - // protected internal virtual TProperty GetExpandedProperty(int key, Expression> path) - // { - // var entity = GetExpandedEntity(key, path); - - // var expression = path.CompileFast(PropertyCachingStrategy.EagerCached); - // var property = expression.Invoke(entity); - - // if (property == null) - // throw ExceptionNotExpanded(path); - - // return property; - // } - - // protected internal virtual IQueryable GetRelatedCollection( - // int key, - // Expression>> navigationProperty) - // { - // Guard.NotNull(navigationProperty, nameof(navigationProperty)); - - // var query = GetEntitySet().Where(x => x.Id.Equals(key)); - // return query.SelectMany(navigationProperty); - // } - - // protected internal virtual IQueryable GetRelatedCollection( - // int key, - // string navigationProperty) - // { - // Guard.NotEmpty(navigationProperty, nameof(navigationProperty)); - - // var ctx = (DbContext)Repository.Context; - // var product = GetEntityByKey(key); - // var entry = ctx.Entry(product); - // var query = entry.Collection(navigationProperty).Query(); - - // return query.Cast(); - // } - - // protected internal virtual SingleResult GetRelatedEntity( - // int key, - // Expression> navigationProperty) - // { - // Guard.NotNull(navigationProperty, nameof(navigationProperty)); - - // var query = GetEntitySet().Where(x => x.Id.Equals(key)).Select(navigationProperty); - // return SingleResult.Create(query); - // } - - // protected internal virtual SingleResult GetRelatedEntity( - // int key, - // string navigationProperty) - // { - // Guard.NotEmpty(navigationProperty, nameof(navigationProperty)); - - // var ctx = (DbContext)Repository.Context; - // var product = GetEntityByKey(key); - // var entry = ctx.Entry(product); - // var query = entry.Reference(navigationProperty).Query().Cast(); - - // return SingleResult.Create(query); - // } - - // public override HttpResponseMessage Post(TEntity entity) - // { - // var response = Request.CreateResponse(HttpStatusCode.OK, CreateEntity(entity)); - - // try - // { - // var entityUrl = Url.CreateODataLink( - // new EntitySetPathSegment(entity.GetType().Name.EnsureEndsWith("s")), - // new KeyValuePathSegment(entity.Id.ToString()) - // ); - - // response.Headers.Location = new Uri(entityUrl); - // } - // catch { } - - // return response; - // } - - // protected override TEntity CreateEntity(TEntity entity) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // if (entity == null) - // throw this.ExceptionBadRequest(WebApiGlobal.Error.NoDataToInsert); - - // Insert(FulfillPropertiesOn(entity)); - - // return entity; - // } - - // protected internal virtual void Insert(TEntity entity) - // { - // Repository.Insert(entity); - // } - - // public override HttpResponseMessage Put(int key, TEntity update) - // { - // return Request.CreateResponse(HttpStatusCode.OK, UpdateEntity(key, update)); - // } - - // protected override TEntity UpdateEntity(int key, TEntity update) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // var originalEntity = GetEntityByKeyNotNull(key); - - // var context = ((IObjectContextAdapter)this.Repository.Context).ObjectContext; - // var container = context.MetadataWorkspace.GetEntityContainer(context.DefaultContainerName, DataSpace.CSpace); - - // string entityName = typeof(TEntity).Name; - // string entitySetName = container.BaseEntitySets.First(x => x.ElementType.Name == entityName).Name; - - // update.Id = key; - // var entity = context.ApplyCurrentValues(entitySetName, update); - - // Update(FulfillPropertiesOn(entity)); - - // return entity; - // } - - // protected internal virtual void Update(TEntity entity) - // { - // Repository.Update(entity); - // } - - // public override HttpResponseMessage Patch(int key, Delta patch) - // { - // return Request.CreateResponse(HttpStatusCode.OK, PatchEntity(key, patch)); - // } - - // protected override TEntity PatchEntity(int key, Delta patch) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // var entity = GetEntityByKeyNotNull(key); - - // if (patch != null) - // patch.Patch(entity); - - // Update(FulfillPropertiesOn(entity)); - - // return entity; - // } - - // public override void Delete(int key) - // { - // if (!ModelState.IsValid) - // throw this.ExceptionInvalidModelState(); - - // var entity = GetEntityByKeyNotNull(key); - - // Delete(entity); - // } - - // protected internal virtual void Delete(TEntity entity) - // { - // Repository.Delete(entity); - // } - - // protected internal virtual object FulfillPropertyOn(TEntity entity, string propertyName, string queryValue) - // { - // var container = Services.Container; - - // if (propertyName.IsCaseInsensitiveEqual("Country")) - // { - // return container.Resolve().GetCountryByTwoOrThreeLetterIsoCode(queryValue); - // } - // else if (propertyName.IsCaseInsensitiveEqual("StateProvince")) - // { - // return container.Resolve().GetStateProvinceByAbbreviation(queryValue); - // } - // else if (propertyName.IsCaseInsensitiveEqual("Language")) - // { - // return container.Resolve().GetLanguageByCulture(queryValue); - // } - // else if (propertyName.IsCaseInsensitiveEqual("Currency")) - // { - // return container.Resolve().GetCurrencyByCode(queryValue); - // } - - // return null; - // } - - // protected internal virtual TEntity FulfillPropertiesOn(TEntity entity) - // { - // try - // { - // if (entity == null) - // return entity; - - // var queries = Request.RequestUri.ParseQueryString(); - - // if (queries == null || queries.Count <= 0) - // return entity; - - // foreach (string key in queries.AllKeys.Where(x => x.StartsWith(WebApiGlobal.QueryOption.Fulfill))) - // { - // string propertyName = key.Substring(WebApiGlobal.QueryOption.Fulfill.Length); - // string queryValue = queries.Get(key); - - // if (propertyName.HasValue() && queryValue.HasValue()) - // { - // var prop = FastProperty.GetProperty(entity.GetType(), propertyName); - // if (prop != null) - // { - // var propertyValue = prop.GetValue(entity); - // if (propertyValue == null) - // { - // object value = FulfillPropertyOn(entity, propertyName, queryValue); - - // // there's no requirement to set a property value of null - // if (value != null) - // { - // prop.SetValue(entity, value); - // } - // } - // } - // } - // } - // } - // catch (Exception ex) - // { - // throw this.ExceptionUnprocessableEntity(ex.Message); - // } - - // return entity; - // } - - // protected internal virtual T ReadContent() - // { - // var formatters = ODataMediaTypeFormatters.Create() - // .Select(formatter => formatter.GetPerRequestFormatterInstance(typeof(T), Request, Request.Content.Headers.ContentType)); - - // return Request.Content.ReadAsAsync(formatters).Result; - // } - //} - - #endregion - - #region Old OData3 EntitySetController - - //[CLSCompliant(false)] - //[ODataNullValue] - //public abstract class EntitySetController : ODataController - //where TEntity : class - //{ - // /// Gets the OData path of the current request. - // public ODataPath ODataPath - // { - // get - // { - // return EntitySetControllerHelpers.GetODataPath(this); - // } - // } - - // /// Gets the OData query options of the current request. - // public ODataQueryOptions QueryOptions - // { - // get - // { - // return EntitySetControllerHelpers.CreateQueryOptions(this); - // } - // } - - // protected EntitySetController() - // { - // } - - // /// This method should be overridden to create a new entity in the entity set. - // /// The created entity. - // /// The entity to add to the entity set. - // protected internal virtual TEntity CreateEntity(TEntity entity) - // { - // throw EntitySetControllerHelpers.CreateEntityNotImplementedResponse(base.get_Request()); - // } - - // /// This method should be overridden to handle POST and PUT requests that attempt to create a link between two entities. - // /// The key of the entity with the navigation property. - // /// The name of the navigation property. - // /// The URI of the entity to link. - // [AcceptVerbs(new string[] { "POST", "PUT" })] - // public virtual void CreateLink([FromODataUri] TKey key, string navigationProperty, [FromBody] Uri link) - // { - // throw EntitySetControllerHelpers.CreateLinkNotImplementedResponse(base.get_Request(), navigationProperty); - // } - - // /// This method should be overriden to handle DELETE requests for deleting existing entities from the entity set. - // /// The entity key of the entity to delete. - // public virtual void Delete([FromODataUri] TKey key) - // { - // throw EntitySetControllerHelpers.DeleteEntityNotImplementedResponse(base.get_Request()); - // } - - // /// This method should be overridden to handle DELETE requests that attempt to break a relationship between two entities. - // /// The key of the entity with the navigation property. - // /// The name of the navigation property. - // /// The URI of the entity to remove from the navigation property. - // public virtual void DeleteLink([FromODataUri] TKey key, string navigationProperty, [FromBody] Uri link) - // { - // throw EntitySetControllerHelpers.DeleteLinkNotImplementedResponse(base.get_Request(), navigationProperty); - // } - - // /// This method should be overridden to handle DELETE requests that attempt to break a relationship between two entities. - // /// The key of the entity with the navigation property. - // /// The key of the related entity. - // /// The name of the navigation property. - // public virtual void DeleteLink([FromODataUri] TKey key, string relatedKey, string navigationProperty) - // { - // throw EntitySetControllerHelpers.DeleteLinkNotImplementedResponse(base.get_Request(), navigationProperty); - // } - - // /// This method should be overridden to handle GET requests that attempt to retrieve entities from the entity set. - // /// The matching entities from the entity set. - // public virtual IQueryable Get() - // { - // throw EntitySetControllerHelpers.GetNotImplementedResponse(base.get_Request()); - // } - - // /// Handles GET requests that attempt to retrieve an individual entity by key from the entity set. - // /// The response message to send back to the client. - // /// The entity key of the entity to retrieve. - // public virtual HttpResponseMessage Get([FromODataUri] TKey key) - // { - // TEntity entityByKey = this.GetEntityByKey(key); - // return EntitySetControllerHelpers.GetByKeyResponse(base.get_Request(), entityByKey); - // } - - // /// This method should be overridden to retrieve an entity by key from the entity set. - // /// The retrieved entity, or null if an entity with the specified entity key cannot be found in the entity set. - // /// The entity key of the entity to retrieve. - // protected internal virtual TEntity GetEntityByKey(TKey key) - // { - // throw EntitySetControllerHelpers.GetEntityByKeyNotImplementedResponse(base.get_Request()); - // } - - // /// This method should be overridden to get the entity key of the specified entity. - // /// The entity key value - // /// The entity. - // protected internal virtual TKey GetKey(TEntity entity) - // { - // throw EntitySetControllerHelpers.GetKeyNotImplementedResponse(base.get_Request()); - // } - - // /// This method should be overridden to handle all unmapped OData requests. - // /// The response message to send back to the client. - // /// The OData path of the request. - // [AcceptVerbs(new string[] { "GET", "POST", "PUT", "PATCH", "MERGE", "DELETE" })] - // public virtual HttpResponseMessage HandleUnmappedRequest(ODataPath odataPath) - // { - // throw EntitySetControllerHelpers.UnmappedRequestResponse(base.get_Request(), odataPath); - // } - - // /// Handles PATCH and MERGE requests to partially update a single entity in the entity set. - // /// The response message to send back to the client. - // /// The entity key of the entity to update. - // /// The patch representing the partial update. - // [AcceptVerbs(new string[] { "PATCH", "MERGE" })] - // public virtual HttpResponseMessage Patch([FromODataUri] TKey key, Delta patch) - // { - // TEntity tEntity = this.PatchEntity(key, patch); - // return EntitySetControllerHelpers.PatchResponse(base.get_Request(), tEntity); - // } - - // /// This method should be overridden to apply a partial update to an existing entity in the entity set. - // /// The updated entity. - // /// The entity key of the entity to update. - // /// The patch representing the partial update. - // protected internal virtual TEntity PatchEntity(TKey key, Delta patch) - // { - // throw EntitySetControllerHelpers.PatchEntityNotImplementedResponse(base.get_Request()); - // } - - // /// Handles POST requests that create new entities in the entity set. - // /// The response message to send back to the client. - // /// The entity to insert into the entity set. - // public virtual HttpResponseMessage Post([FromBody] TEntity entity) - // { - // TEntity tEntity = this.CreateEntity(entity); - // return EntitySetControllerHelpers.PostResponse(this, tEntity, this.GetKey(entity)); - // } - - // /// Handles PUT requests that attempt to replace a single entity in the entity set. - // /// The response message to send back to the client. - // /// The entity key of the entity to replace. - // /// The updated entity. - // public virtual HttpResponseMessage Put([FromODataUri] TKey key, [FromBody] TEntity update) - // { - // TEntity tEntity = this.UpdateEntity(key, update); - // return EntitySetControllerHelpers.PutResponse(base.get_Request(), tEntity); - // } - - // /// This method should be overridden to update an existing entity in the entity set. - // /// The updated entity. - // /// The entity key of the entity to update. - // /// The updated entity. - // protected internal virtual TEntity UpdateEntity(TKey key, TEntity update) - // { - // throw EntitySetControllerHelpers.UpdateEntityNotImplementedResponse(base.get_Request()); - // } - //} - - - //internal static class EntitySetControllerHelpers - //{ - // private const string PreferHeaderName = "Prefer"; - - // private const string PreferenceAppliedHeaderName = "Preference-Applied"; - - // private const string ReturnContentHeaderValue = "return-content"; - - // private const string ReturnNoContentHeaderValue = "return-no-content"; - - // public static HttpResponseException CreateEntityNotImplementedResponse(HttpRequestMessage request) - // { - // ODataError oDataError = new ODataError(); - // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedCreate); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; - // object[] objArray = new object[] { "POST" }; - // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static HttpResponseException CreateLinkNotImplementedResponse(HttpRequestMessage request, string navigationProperty) - // { - // ODataError oDataError = new ODataError(); - // string entitySetControllerUnsupportedCreateLink = SRResources.EntitySetControllerUnsupportedCreateLink; - // object[] objArray = new object[] { navigationProperty }; - // oDataError.set_Message(Error.Format(entitySetControllerUnsupportedCreateLink, objArray)); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnsupportedCreateLinkErrorCode); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static ODataQueryOptions CreateQueryOptions(ApiController controller) - // { - // ODataQueryContext oDataQueryContext = new ODataQueryContext(controller.get_Request().ODataProperties().Model, typeof(TEntity)); - // return new ODataQueryOptions(oDataQueryContext, controller.get_Request()); - // } - - // public static HttpResponseException DeleteEntityNotImplementedResponse(HttpRequestMessage request) - // { - // ODataError oDataError = new ODataError(); - // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedDelete); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; - // object[] objArray = new object[] { "DELETE" }; - // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static HttpResponseException DeleteLinkNotImplementedResponse(HttpRequestMessage request, string navigationProperty) - // { - // ODataError oDataError = new ODataError(); - // string entitySetControllerUnsupportedDeleteLink = SRResources.EntitySetControllerUnsupportedDeleteLink; - // object[] objArray = new object[] { navigationProperty }; - // oDataError.set_Message(Error.Format(entitySetControllerUnsupportedDeleteLink, objArray)); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnsupportedDeleteLinkErrorCode); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static HttpResponseMessage GetByKeyResponse(HttpRequestMessage request, TEntity entity) - // { - // if (entity == null) - // { - // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotFound); - // } - // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.OK, entity); - // } - - // public static HttpResponseException GetEntityByKeyNotImplementedResponse(HttpRequestMessage request) - // { - // ODataError oDataError = new ODataError(); - // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedGetByKey); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnsupportedGetByKeyErrorCode); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static HttpResponseException GetKeyNotImplementedResponse(HttpRequestMessage request) - // { - // ODataError oDataError = new ODataError(); - // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedGetKey); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; - // object[] objArray = new object[] { "POST" }; - // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static HttpResponseException GetNotImplementedResponse(HttpRequestMessage request) - // { - // ODataError oDataError = new ODataError(); - // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedGet); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; - // object[] objArray = new object[] { "GET" }; - // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static ODataPath GetODataPath(ApiController controller) - // { - // return controller.get_Request().ODataProperties().Path; - // } - - // public static HttpResponseException PatchEntityNotImplementedResponse(HttpRequestMessage request) - // { - // ODataError oDataError = new ODataError(); - // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedPatch); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; - // object[] objArray = new object[] { "PATCH" }; - // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static HttpResponseMessage PatchResponse(HttpRequestMessage request, TEntity patchedEntity) - // { - // if (!EntitySetControllerHelpers.RequestPrefersReturnContent(request)) - // { - // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NoContent); - // } - // HttpResponseMessage httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.OK, patchedEntity); - // httpResponseMessage.Headers.Add("Preference-Applied", "return-content"); - // return httpResponseMessage; - // } - - // public static HttpResponseMessage PostResponse(ApiController controller, TEntity createdEntity, TKey entityKey) - // { - // HttpResponseMessage httpResponseMessage = null; - // HttpRequestMessage request = controller.get_Request(); - // if (!EntitySetControllerHelpers.RequestPrefersReturnNoContent(request)) - // { - // httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.Created, createdEntity); - // } - // else - // { - // httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NoContent); - // httpResponseMessage.Headers.Add("Preference-Applied", "return-no-content"); - // } - // ODataPath path = request.ODataProperties().Path; - // if (path == null) - // { - // throw Error.InvalidOperation(SRResources.LocationHeaderMissingODataPath, new object[0]); - // } - // EntitySetPathSegment entitySetPathSegment = path.Segments.FirstOrDefault() as EntitySetPathSegment; - // if (entitySetPathSegment == null) - // { - // throw Error.InvalidOperation(SRResources.LocationHeaderDoesNotStartWithEntitySet, new object[0]); - // } - // UrlHelper url = controller.get_Url() ?? new UrlHelper(request); - // HttpResponseHeaders headers = httpResponseMessage.Headers; - // ODataPathSegment[] keyValuePathSegment = new ODataPathSegment[] { entitySetPathSegment, new KeyValuePathSegment(ODataUriUtils.ConvertToUriLiteral(entityKey, 2)) }; - // headers.Location = new Uri(url.CreateODataLink(keyValuePathSegment)); - // return httpResponseMessage; - // } - - // public static HttpResponseMessage PutResponse(HttpRequestMessage request, TEntity updatedEntity) - // { - // if (!EntitySetControllerHelpers.RequestPrefersReturnContent(request)) - // { - // return HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NoContent); - // } - // HttpResponseMessage httpResponseMessage = HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.OK, updatedEntity); - // httpResponseMessage.Headers.Add("Preference-Applied", "return-content"); - // return httpResponseMessage; - // } - - // internal static bool RequestPrefersReturnContent(HttpRequestMessage request) - // { - // IEnumerable strs = null; - // if (!request.Headers.TryGetValues("Prefer", out strs)) - // { - // return false; - // } - // return strs.Contains("return-content"); - // } - - // internal static bool RequestPrefersReturnNoContent(HttpRequestMessage request) - // { - // IEnumerable strs = null; - // if (!request.Headers.TryGetValues("Prefer", out strs)) - // { - // return false; - // } - // return strs.Contains("return-no-content"); - // } - - // public static HttpResponseException UnmappedRequestResponse(HttpRequestMessage request, ODataPath odataPath) - // { - // ODataError oDataError = new ODataError(); - // string entitySetControllerUnmappedRequest = SRResources.EntitySetControllerUnmappedRequest; - // object[] pathTemplate = new object[] { odataPath.PathTemplate }; - // oDataError.set_Message(Error.Format(entitySetControllerUnmappedRequest, pathTemplate)); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // oDataError.set_ErrorCode(SRResources.EntitySetControllerUnmappedRequestErrorCode); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - - // public static HttpResponseException UpdateEntityNotImplementedResponse(HttpRequestMessage request) - // { - // ODataError oDataError = new ODataError(); - // oDataError.set_Message(SRResources.EntitySetControllerUnsupportedUpdate); - // oDataError.set_MessageLanguage(SRResources.EntitySetControllerErrorMessageLanguage); - // string entitySetControllerUnsupportedMethodErrorCode = SRResources.EntitySetControllerUnsupportedMethodErrorCode; - // object[] objArray = new object[] { "PUT" }; - // oDataError.set_ErrorCode(Error.Format(entitySetControllerUnsupportedMethodErrorCode, objArray)); - // return new HttpResponseException(HttpRequestMessageExtensions.CreateResponse(request, HttpStatusCode.NotImplemented, oDataError)); - // } - //} - - #endregion } From 9b50d20dddc0dc02359e535cf28e9b88619233f8 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Wed, 12 Aug 2020 02:15:09 +0200 Subject: [PATCH 030/695] (perf) Migration: MoveCustomerFields() ~10x faster now --- .../Extensions/DateTimeExtensions.cs | 8 + .../201807051830375_MoveCustomerFields.cs | 25 +-- ...1908050758298_MoveFurtherCustomerFields.cs | 20 ++- .../SmartStore.Data/Utilities/DataMigrator.cs | 152 +++++++++++++----- 4 files changed, 139 insertions(+), 66 deletions(-) diff --git a/src/Libraries/SmartStore.Core/Extensions/DateTimeExtensions.cs b/src/Libraries/SmartStore.Core/Extensions/DateTimeExtensions.cs index 847572155a..47dfe31a32 100644 --- a/src/Libraries/SmartStore.Core/Extensions/DateTimeExtensions.cs +++ b/src/Libraries/SmartStore.Core/Extensions/DateTimeExtensions.cs @@ -201,6 +201,14 @@ public static string ToNativeString(this DateTime value, string format, IFormatP provider = provider ?? CultureInfo.CurrentCulture; return value.ToString(format, provider).ReplaceNativeDigits(provider); } + + /// + /// Converts a DateTime to ISO 8601 string + /// + public static string ToIso8601String(this DateTime value) + { + return value.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); + } } } diff --git a/src/Libraries/SmartStore.Data/Migrations/201807051830375_MoveCustomerFields.cs b/src/Libraries/SmartStore.Data/Migrations/201807051830375_MoveCustomerFields.cs index bf0b6b0b43..4bc48f7cc5 100644 --- a/src/Libraries/SmartStore.Data/Migrations/201807051830375_MoveCustomerFields.cs +++ b/src/Libraries/SmartStore.Data/Migrations/201807051830375_MoveCustomerFields.cs @@ -1,7 +1,8 @@ namespace SmartStore.Data.Migrations { using System; - using System.Data.Entity.Migrations; + using System.Collections.Generic; + using System.Data.Entity.Migrations; using System.Linq; using SmartStore.Core.Domain.Common; using SmartStore.Core.Domain.Customers; @@ -54,35 +55,35 @@ public void Seed(SmartObjectContext context) var candidates = new[] { "Title", "FirstName", "LastName", "Company", "CustomerNumber", "DateOfBirth" }; var numUpdatedCustomers = DataMigrator.MoveCustomerFields(context, UpdateCustomer, candidates); - } + } - private static void UpdateCustomer(Customer customer, GenericAttribute attr) + private static void UpdateCustomer(IDictionary columns, string key, string value) { - switch (attr.Key) + switch (key) { case "Title": - customer.Title = attr.Value?.Truncate(100); + columns[key] = value?.Truncate(50); break; case "FirstName": - customer.FirstName = attr.Value?.Truncate(225); + columns[key] = value?.Truncate(199); break; case "LastName": - customer.LastName = attr.Value?.Truncate(225); + columns[key] = value?.Truncate(199); break; case "Company": - customer.Company = attr.Value?.Truncate(255); + columns[key] = value?.Truncate(255); break; case "CustomerNumber": - customer.CustomerNumber = attr.Value?.Truncate(100); + columns[key] = value?.Truncate(100); break; case "DateOfBirth": - customer.BirthDate = attr.Value?.Convert(); + columns["BirthDate"] = value?.Convert(); break; } // Update FullName - var parts = new[] { customer.Title, customer.FirstName, customer.LastName }; - customer.FullName = string.Join(" ", parts.Where(x => x.HasValue())).NullEmpty(); + var parts = new string[] { (string)columns.Get("Title"), (string)columns.Get("FirstName"), (string)columns.Get("LastName") }; + columns["FullName"] = string.Join(" ", parts.Where(x => x.HasValue())).NullEmpty(); } public void MigrateLocaleResources(LocaleResourcesBuilder builder) diff --git a/src/Libraries/SmartStore.Data/Migrations/201908050758298_MoveFurtherCustomerFields.cs b/src/Libraries/SmartStore.Data/Migrations/201908050758298_MoveFurtherCustomerFields.cs index 193a185e41..f7080a68b1 100644 --- a/src/Libraries/SmartStore.Data/Migrations/201908050758298_MoveFurtherCustomerFields.cs +++ b/src/Libraries/SmartStore.Data/Migrations/201908050758298_MoveFurtherCustomerFields.cs @@ -5,6 +5,7 @@ namespace SmartStore.Data.Migrations using SmartStore.Data.Setup; using SmartStore.Data.Utilities; using System; + using System.Collections.Generic; using System.Data.Entity.Migrations; public partial class MoveFurtherCustomerFields : DbMigration, IDataSeeder @@ -51,31 +52,28 @@ public void Seed(SmartObjectContext context) var numUpdatedCustomers = DataMigrator.MoveCustomerFields(context, UpdateCustomer, candidates); } - private static void UpdateCustomer(Customer customer, GenericAttribute attr) + private static void UpdateCustomer(IDictionary columns, string key, string value) { - switch (attr.Key) + switch (key) { case "Gender": - customer.Gender = attr.Value?.Truncate(100); + columns[key] = value?.Truncate(100); break; case "VatNumberStatusId": - customer.VatNumberStatusId = attr.Value.Convert(); + columns[key] = value.Convert(); break; case "TimeZoneId": - customer.TimeZoneId = attr.Value?.Truncate(255); + columns[key] = value?.Truncate(255); break; case "TaxDisplayTypeId": - customer.TaxDisplayTypeId = attr.Value.Convert(); + columns[key] = value.Convert(); break; case "LastForumVisit": - customer.LastForumVisit = attr.Value.Convert(); + columns[key] = value.Convert(); break; case "LastUserAgent": - customer.LastUserAgent = attr.Value.Convert(); - break; case "LastUserDeviceType": - // TODO: split - customer.LastUserDeviceType = attr.Value.Convert(); + columns[key] = value; break; } } diff --git a/src/Libraries/SmartStore.Data/Utilities/DataMigrator.cs b/src/Libraries/SmartStore.Data/Utilities/DataMigrator.cs index 765cff8f52..a1ecbbf47c 100644 --- a/src/Libraries/SmartStore.Data/Utilities/DataMigrator.cs +++ b/src/Libraries/SmartStore.Data/Utilities/DataMigrator.cs @@ -1,14 +1,17 @@ using System; using System.Collections.Generic; using System.Data.Entity; +using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.Remoting.Contexts; using System.Security.Policy; using System.Text; using System.Text.RegularExpressions; using System.Xml.Linq; using System.Xml.Serialization; +using Microsoft.SqlServer.Management.Sdk.Sfc; using Newtonsoft.Json; using SmartStore.Collections; using SmartStore.Core; @@ -32,6 +35,7 @@ using SmartStore.Rules; using SmartStore.Rules.Domain; using SmartStore.Utilities; +using SmartStore.Utilities.ObjectPools; using EfState = System.Data.Entity.EntityState; namespace SmartStore.Data.Utilities @@ -349,88 +353,150 @@ public static int ImportAddressFormats(IDbContext context) #region MoveCustomerFields (V3.2) + class CustomerStub + { + public int Id { get; set; } + public IEnumerable Attributes { get; set; } + } + + class AttributeStub + { + public int Id { get; set; } + public string Key { get; set; } + public string Value { get; set; } + } + /// /// Moves several customer fields saved as generic attributes to customer entity (Title, FirstName, LastName, BirthDate, Company, CustomerNumber) /// /// Database context (must be ) /// The total count of fixed and updated customer entities - public static int MoveCustomerFields(IDbContext context, Action updater, params string[] candidates) + public static int MoveCustomerFields( + IDbContext context, + Action, string, string> updater, + params string[] candidates) { Guard.NotNull(updater, nameof(updater)); - + if (!(context is SmartObjectContext ctx)) throw new ArgumentException("Passed context must be an instance of type '{0}'.".FormatInvariant(typeof(SmartObjectContext)), nameof(context)); if (candidates.Length == 0) return 0; - // We delete attrs only if the WHOLE migration succeeded - var attrIdsToDelete = new List(1000); - var gaTable = context.Set(); + const int pageSize = 1000; + var gaTable = context.Set().AsNoTracking(); //var candidates = new[] { "Title", "FirstName", "LastName", "Company", "CustomerNumber", "DateOfBirth" }; - var query = gaTable - .AsNoTracking() - .Where(x => x.KeyGroup == "Customer" && candidates.Contains(x.Key)) + var query = ( + from a in gaTable + where a.KeyGroup == "Customer" && candidates.Contains(a.Key) + group a by a.EntityId into grps + where grps.Any() + select new CustomerStub + { + Id = grps.Key, + Attributes = grps.Select(a2 => new AttributeStub { Id = a2.Id, Key = a2.Key, Value = a2.Value }) + }) .OrderBy(x => x.Id); + int numAffectedRows = 0; int numUpdated = 0; using (var scope = new DbContextScope(ctx: context, validateOnSave: false, hooksEnabled: false, autoCommit: false)) { - for (var pageIndex = 0; pageIndex < 9999999; ++pageIndex) + for (var pageIndex = 0; pageIndex < 9999999; pageIndex++) { - var attrs = new PagedList(query, pageIndex, 250); - - var customerIds = attrs.Select(a => a.EntityId).Distinct().ToArray(); - var customers = context.Set() - .Where(x => customerIds.Contains(x.Id)) - .ToDictionary(x => x.Id); + var data = query + .Skip(pageIndex * pageSize) + .Take(pageSize) + .ToList(); - // Move attrs one by one to customer - foreach (var attr in attrs) + foreach (var chunk in data.Slice(100)) { - var customer = customers.Get(attr.EntityId); - if (customer == null) - continue; - - updater(customer, attr); - - attrIdsToDelete.Add(attr.Id); + numAffectedRows += GenerateAndExecuteSql(chunk); } - // Save batch - numUpdated += scope.Commit(); + numUpdated += data.Count; - // Breathe - context.DetachAll(); - - if (!attrs.HasNextPage) + if (data.Count == 0) break; } + } + + return numUpdated; + + int GenerateAndExecuteSql(IEnumerable customers) + { + var sb = PooledStringBuilder.Rent(); - // Everything worked out, now delete all orpahned attributes - if (attrIdsToDelete.Count > 0) + foreach (var c in customers) { - try + var attrs = c.Attributes.ToArray(); + + if (attrs.Length == 0) + continue; + + var columns = new Dictionary(); + + /// Generate UPDATE Customer statement + foreach (var attr in attrs) { - // Don't rollback migration when this fails - var stubs = attrIdsToDelete.Select(x => new GenericAttribute { Id = x }).ToList(); - foreach (var chunk in stubs.Slice(500)) + updater(columns, attr.Key, attr.Value); + } + + if (columns.Count == 0) + continue; + + sb.Append("UPDATE [Customer] SET"); + + int i = 0; + foreach (var kvp in columns) + { + sb.Append(" "); + if (i > 0) sb.Append(", "); + + sb.Append($"[{kvp.Key}] = "); + + if (kvp.Value is int n) + { + sb.Append($"{n.ToString(CultureInfo.InvariantCulture)}"); + } + else if (kvp.Value is DateTime d) { - chunk.Each(x => gaTable.Attach(x)); - gaTable.RemoveRange(chunk); - scope.Commit(); + sb.Append($"'{d.ToIso8601String()}'"); } + else if (kvp.Value == null) + { + sb.Append("NULL"); + } + else + { + sb.Append($"N'{kvp.Value}'"); + } + + i++; } - catch (Exception ex) + + sb.Append(" WHERE Id = {0}".FormatInvariant(c.Id)); + sb.Append("\n"); + + // Generate all GenericAttribute DELETE statements + for (i = 0; i < attrs.Length; i++) { - var msg = ex.Message; + var a = attrs[i]; + sb.AppendLine($"DELETE FROM [GenericAttribute] WHERE [Id] = {a.Id}"); } } - } - return numUpdated; + var sql = sb.ToStringAndReturn(); + if (sql.HasValue()) + { + return ctx.Execute(sql); + } + + return 0; + } } public static int DeleteGuestCustomerGenericAttributes(IDbContext context, TimeSpan olderThan) From bd35d49cbee44787d98a862e642a64711235dd5e Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Wed, 12 Aug 2020 03:42:51 +0200 Subject: [PATCH 031/695] Updated Autofac packages to latest version --- .../DependencyManagement/ContainerManager.cs | 1 + .../DefaultLifetimeScopeAccessor.cs | 4 +- .../Infrastructure/SmartStoreEngine.cs | 42 +++++++------------ .../SmartStore.Core/Logging/LoggingModule.cs | 3 +- .../SmartStore.Core/Logging/TraceLogger.cs | 32 +++++++------- .../SmartStore.Core/SmartStore.Core.csproj | 18 +++++--- src/Libraries/SmartStore.Core/app.config | 2 +- src/Libraries/SmartStore.Core/packages.config | 7 +++- .../SmartStore.Data/SmartStore.Data.csproj | 14 ++++++- src/Libraries/SmartStore.Data/app.config | 2 +- src/Libraries/SmartStore.Data/packages.config | 5 ++- .../SmartStore.Services.csproj | 18 +++++--- src/Libraries/SmartStore.Services/app.config | 2 +- .../SmartStore.Services/packages.config | 7 +++- .../SmartStore.AmazonPay.csproj | 21 ++++++++-- .../SmartStore.AmazonPay/packages.config | 7 +++- src/Plugins/SmartStore.AmazonPay/web.config | 2 +- src/Plugins/SmartStore.Clickatell/web.config | 2 +- .../SmartStore.DevTools.csproj | 21 ++++++++-- src/Plugins/SmartStore.DevTools/Web.config | 2 +- .../SmartStore.DevTools/packages.config | 7 +++- .../SmartStore.FacebookAuth.csproj | 21 ++++++++-- .../SmartStore.FacebookAuth/packages.config | 7 +++- .../SmartStore.FacebookAuth/web.config | 2 +- .../SmartStore.GoogleAnalytics/web.config | 2 +- .../SmartStore.GoogleMerchantCenter.csproj | 21 ++++++++-- .../packages.config | 7 +++- .../web.config | 2 +- .../SmartStore.OfflinePayment.csproj | 17 +++++++- .../SmartStore.OfflinePayment/packages.config | 5 ++- .../SmartStore.OfflinePayment/web.config | 2 +- .../SmartStore.PayPal.csproj | 21 ++++++++-- src/Plugins/SmartStore.PayPal/packages.config | 7 +++- src/Plugins/SmartStore.PayPal/web.config | 2 +- .../SmartStore.Shipping.csproj | 21 ++++++++-- .../SmartStore.Shipping/packages.config | 7 +++- src/Plugins/SmartStore.Shipping/web.config | 2 +- .../SmartStore.ShippingByWeight.csproj | 21 ++++++++-- .../packages.config | 7 +++- .../SmartStore.ShippingByWeight/web.config | 2 +- .../SmartStore.Tax/SmartStore.Tax.csproj | 17 +++++++- src/Plugins/SmartStore.Tax/packages.config | 5 ++- src/Plugins/SmartStore.Tax/web.config | 2 +- .../SmartStore.WebApi.csproj | 25 ++++++++--- src/Plugins/SmartStore.WebApi/packages.config | 9 ++-- src/Plugins/SmartStore.WebApi/web.config | 2 +- .../DependencyRegistrar.cs | 14 ++++--- .../SmartStore.Web.Framework.csproj | 22 ++++++---- .../SmartStore.Web.Framework/app.config | 2 +- .../SmartStore.Web.Framework/packages.config | 9 ++-- .../Administration/SmartStore.Admin.csproj | 18 +++++--- .../SmartStore.Web/Administration/Web.config | 2 +- .../Administration/packages.config | 7 +++- .../SmartStore.Web/SmartStore.Web.csproj | 18 +++++--- src/Presentation/SmartStore.Web/Web.config | 2 +- .../SmartStore.Web/packages.config | 7 +++- src/Tests/SmartStore.Core.Tests/App.config | 2 +- .../SmartStore.Core.Tests.csproj | 13 +++++- .../SmartStore.Core.Tests/packages.config | 5 ++- src/Tests/SmartStore.Data.Tests/App.config | 2 +- .../SmartStore.Services.Tests/App.config | 2 +- src/Tests/SmartStore.Tests/App.config | 2 +- .../SmartStore.Tests/SmartStore.Tests.csproj | 14 ++++++- src/Tests/SmartStore.Tests/packages.config | 5 ++- src/Tests/SmartStore.Web.MVC.Tests/App.config | 2 +- src/Tools/SmartStore.Packager/App.config | 2 +- 66 files changed, 425 insertions(+), 180 deletions(-) diff --git a/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/ContainerManager.cs b/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/ContainerManager.cs index a839f412c1..fb00780d8e 100644 --- a/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/ContainerManager.cs +++ b/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/ContainerManager.cs @@ -157,6 +157,7 @@ public bool TryResolve(Type serviceType, ILifetimeScope scope, out object instan [DebuggerStepThrough] public bool TryResolve(ILifetimeScope scope, out T instance) + where T : class { instance = default(T); diff --git a/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/DefaultLifetimeScopeAccessor.cs b/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/DefaultLifetimeScopeAccessor.cs index 1c7fed864c..8f8156e815 100644 --- a/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/DefaultLifetimeScopeAccessor.cs +++ b/src/Libraries/SmartStore.Core/Infrastructure/DependencyManagement/DefaultLifetimeScopeAccessor.cs @@ -21,8 +21,8 @@ public DefaultLifetimeScopeAccessor(ILifetimeScope rootContainer) //rootContainer.ChildLifetimeScopeBeginning += OnScopeBeginning; - this._rootContainer = rootContainer; - this._state = new ContextState("CustomLifetimeScopeProvider.WorkScope"); + _rootContainer = rootContainer; + _state = new ContextState("CustomLifetimeScopeProvider.WorkScope"); } public ILifetimeScope ApplicationContainer diff --git a/src/Libraries/SmartStore.Core/Infrastructure/SmartStoreEngine.cs b/src/Libraries/SmartStore.Core/Infrastructure/SmartStoreEngine.cs index 48979a36b0..7028b2ab70 100644 --- a/src/Libraries/SmartStore.Core/Infrastructure/SmartStoreEngine.cs +++ b/src/Libraries/SmartStore.Core/Infrastructure/SmartStoreEngine.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using System.Web.Mvc; using Autofac; +using Autofac.Core; using Autofac.Integration.Mvc; using SmartStore.Core.Data; using SmartStore.Core.Infrastructure.DependencyManagement; @@ -72,41 +73,22 @@ protected virtual object CreateDependencyResolver(IContainer container) protected virtual ContainerManager RegisterDependencies() { - var builder = new ContainerBuilder(); - var container = builder.Build(); var typeFinder = CreateTypeFinder(); - _containerManager = new ContainerManager(container); - // core dependencies - builder = new ContainerBuilder(); + var builder = new ContainerBuilder(); builder.RegisterInstance(this).As(); builder.RegisterInstance(typeFinder).As(); // Autofac - var lifetimeScopeAccessor = new DefaultLifetimeScopeAccessor(container); - var lifetimeScopeProvider = new DefaultLifetimeScopeProvider(lifetimeScopeAccessor); - builder.RegisterInstance(lifetimeScopeAccessor).As(); - builder.RegisterInstance(lifetimeScopeProvider).As(); - - var dependencyResolver = new AutofacDependencyResolver(container, lifetimeScopeProvider); - builder.RegisterInstance(dependencyResolver); - DependencyResolver.SetResolver(dependencyResolver); + builder.Register(x => new DefaultLifetimeScopeAccessor(x.Resolve())).As().SingleInstance(); + builder.Register(x => new DefaultLifetimeScopeProvider(x.Resolve())).As().SingleInstance(); + builder.Register(x => new AutofacDependencyResolver(x.Resolve(), x.Resolve())).As().SingleInstance(); // Logging dependencies should be available very early builder.RegisterModule(new LoggingModule()); -#pragma warning disable 612, 618 - builder.Update(container); -#pragma warning restore 612, 618 - - // Propagate logger - var logger = container.Resolve().GetLogger("SmartStore.Bootstrapper"); - this.Logger = logger; - ((AppDomainTypeFinder)typeFinder).Logger = logger; - // Register dependencies provided by other assemblies - builder = new ContainerBuilder(); var registrarTypes = typeFinder.FindClassesOfType(); var registrarInstances = new List(); foreach (var type in registrarTypes) @@ -119,13 +101,19 @@ protected virtual ContainerManager RegisterDependencies() foreach (var registrar in registrarInstances) { var type = registrar.GetType(); - logger.DebugFormat("Executing dependency registrar '{0}'", type.FullName); + Debug.WriteLine("Executing dependency registrar '{0}'.".FormatInvariant(type.FullName)); registrar.Register(builder, typeFinder, PluginManager.IsActivePluginAssembly(type.Assembly)); } -#pragma warning disable 612, 618 - builder.Update(container); -#pragma warning restore 612, 618 + var container = builder.Build(); + _containerManager = new ContainerManager(container); + + // MVC dependency resolver + DependencyResolver.SetResolver(container.Resolve()); + + // Logger + this.Logger = container.Resolve().GetLogger("SmartStore.Bootstrapper"); + ((AppDomainTypeFinder)typeFinder).Logger = this.Logger; return _containerManager; } diff --git a/src/Libraries/SmartStore.Core/Logging/LoggingModule.cs b/src/Libraries/SmartStore.Core/Logging/LoggingModule.cs index 31f73d2807..8f69742577 100644 --- a/src/Libraries/SmartStore.Core/Logging/LoggingModule.cs +++ b/src/Libraries/SmartStore.Core/Logging/LoggingModule.cs @@ -6,6 +6,7 @@ using Autofac; using Autofac.Core; using Autofac.Core.Activators.Reflection; +using Autofac.Core.Registration; using SmartStore.ComponentModel; using SmartStore.Core.Data; @@ -31,7 +32,7 @@ protected override void Load(ContainerBuilder builder) } } - protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) + protected override void AttachToComponentRegistration(IComponentRegistryBuilder componentRegistry, IComponentRegistration registration) { bool hasCtorLogger = false; bool hasPropertyLogger = false; diff --git a/src/Libraries/SmartStore.Core/Logging/TraceLogger.cs b/src/Libraries/SmartStore.Core/Logging/TraceLogger.cs index 71c5916162..ede0263089 100644 --- a/src/Libraries/SmartStore.Core/Logging/TraceLogger.cs +++ b/src/Libraries/SmartStore.Core/Logging/TraceLogger.cs @@ -121,22 +121,22 @@ private TraceEventType LogLevelToEventType(LogLevel level) } } - private LogLevel EventTypeToLogLevel(TraceEventType eventType) - { - switch (eventType) - { - case TraceEventType.Verbose: - return LogLevel.Debug; - case TraceEventType.Error: - return LogLevel.Error; - case TraceEventType.Critical: - return LogLevel.Fatal; - case TraceEventType.Warning: - return LogLevel.Warning; - default: - return LogLevel.Information; - } - } + //private LogLevel EventTypeToLogLevel(TraceEventType eventType) + //{ + // switch (eventType) + // { + // case TraceEventType.Verbose: + // return LogLevel.Debug; + // case TraceEventType.Error: + // return LogLevel.Error; + // case TraceEventType.Critical: + // return LogLevel.Fatal; + // case TraceEventType.Warning: + // return LogLevel.Warning; + // default: + // return LogLevel.Information; + // } + //} public void Flush() { diff --git a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj index 57b7c776d2..72b716c29e 100644 --- a/src/Libraries/SmartStore.Core/SmartStore.Core.csproj +++ b/src/Libraries/SmartStore.Core/SmartStore.Core.csproj @@ -65,12 +65,11 @@ ..\..\packages\AngleSharp.0.9.11\lib\net45\AngleSharp.dll - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll - True + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll @@ -87,6 +86,9 @@ ..\..\packages\log4net.2.0.8\lib\net45-full\log4net.dll True + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + True ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll @@ -116,8 +118,14 @@ + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll diff --git a/src/Libraries/SmartStore.Core/app.config b/src/Libraries/SmartStore.Core/app.config index 1e2654dc0e..aa1f38f1f9 100644 --- a/src/Libraries/SmartStore.Core/app.config +++ b/src/Libraries/SmartStore.Core/app.config @@ -8,7 +8,7 @@ - + diff --git a/src/Libraries/SmartStore.Core/packages.config b/src/Libraries/SmartStore.Core/packages.config index 27fcfe462d..0c8d7ea5ba 100644 --- a/src/Libraries/SmartStore.Core/packages.config +++ b/src/Libraries/SmartStore.Core/packages.config @@ -1,18 +1,21 @@  - - + + + + + \ No newline at end of file diff --git a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj index 6d014f01c7..3d8952ee05 100644 --- a/src/Libraries/SmartStore.Data/SmartStore.Data.csproj +++ b/src/Libraries/SmartStore.Data/SmartStore.Data.csproj @@ -67,8 +67,8 @@ latest - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll @@ -82,6 +82,9 @@ ..\..\packages\EntityFramework.SqlServerCompact.6.4.4\lib\net45\EntityFramework.SqlServerCompact.dll True + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + True ..\..\packages\Microsoft.SqlServer.Scripting.11.0.2100.61\lib\Microsoft.SqlServer.ConnectionInfo.dll @@ -98,12 +101,19 @@ ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + True ..\..\packages\Microsoft.SqlServer.Compact.4.0.8876.1\lib\net40\System.Data.SqlServerCe.dll + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + diff --git a/src/Libraries/SmartStore.Data/app.config b/src/Libraries/SmartStore.Data/app.config index a89e0781b5..76beb2a152 100644 --- a/src/Libraries/SmartStore.Data/app.config +++ b/src/Libraries/SmartStore.Data/app.config @@ -4,7 +4,7 @@ - + diff --git a/src/Libraries/SmartStore.Data/packages.config b/src/Libraries/SmartStore.Data/packages.config index a913d74148..d2fafe90f4 100644 --- a/src/Libraries/SmartStore.Data/packages.config +++ b/src/Libraries/SmartStore.Data/packages.config @@ -1,9 +1,12 @@  - + + + + \ No newline at end of file diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 3e31ccff40..c87d31e0c2 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -69,12 +69,11 @@ ..\..\packages\AngleSharp.0.9.11\lib\net45\AngleSharp.dll - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll - True + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll ..\..\packages\CronExpressionDescriptor.2.15.0\lib\netstandard2.0\CronExpressionDescriptor.dll @@ -102,6 +101,9 @@ ..\..\packages\MaxMind.GeoIP2.3.2.0\lib\net45\MaxMind.GeoIP2.dll + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + True @@ -139,8 +141,14 @@ ..\..\packages\System.Linq.Dynamic.Core.1.2.1\lib\net46\System.Linq.Dynamic.Core.dll + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + ..\..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll diff --git a/src/Libraries/SmartStore.Services/app.config b/src/Libraries/SmartStore.Services/app.config index 10ff5d2982..f0beaa056a 100644 --- a/src/Libraries/SmartStore.Services/app.config +++ b/src/Libraries/SmartStore.Services/app.config @@ -26,7 +26,7 @@ - + diff --git a/src/Libraries/SmartStore.Services/packages.config b/src/Libraries/SmartStore.Services/packages.config index 207c0356f2..6d7f4e50d8 100644 --- a/src/Libraries/SmartStore.Services/packages.config +++ b/src/Libraries/SmartStore.Services/packages.config @@ -1,8 +1,8 @@  - - + + @@ -13,6 +13,7 @@ + @@ -22,5 +23,7 @@ + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj b/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj index 7365b57355..2054dd0bf7 100644 --- a/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj +++ b/src/Plugins/SmartStore.AmazonPay/SmartStore.AmazonPay.csproj @@ -81,18 +81,22 @@ ..\..\packages\AmazonPay.3.5.0\lib\net20\AmazonPay.dll True - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False ..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll True + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -106,9 +110,18 @@ False + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.AmazonPay/packages.config b/src/Plugins/SmartStore.AmazonPay/packages.config index d6e63a10cf..dfea9931d7 100644 --- a/src/Plugins/SmartStore.AmazonPay/packages.config +++ b/src/Plugins/SmartStore.AmazonPay/packages.config @@ -1,14 +1,17 @@  - - + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.AmazonPay/web.config b/src/Plugins/SmartStore.AmazonPay/web.config index 803ea9b9aa..f340aff88f 100644 --- a/src/Plugins/SmartStore.AmazonPay/web.config +++ b/src/Plugins/SmartStore.AmazonPay/web.config @@ -78,7 +78,7 @@ - + diff --git a/src/Plugins/SmartStore.Clickatell/web.config b/src/Plugins/SmartStore.Clickatell/web.config index 552e56025b..e15d8a0902 100644 --- a/src/Plugins/SmartStore.Clickatell/web.config +++ b/src/Plugins/SmartStore.Clickatell/web.config @@ -75,7 +75,7 @@ - + diff --git a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj index 6b784b14a8..153a7575e3 100644 --- a/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj +++ b/src/Plugins/SmartStore.DevTools/SmartStore.DevTools.csproj @@ -76,12 +76,12 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False @@ -100,6 +100,10 @@ ..\..\packages\FluentValidation.Mvc5.7.4.0\lib\net45\FluentValidation.Mvc.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -129,6 +133,7 @@ False + @@ -136,6 +141,14 @@ False + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.DevTools/Web.config b/src/Plugins/SmartStore.DevTools/Web.config index bdf8a1df13..9bfec8954e 100644 --- a/src/Plugins/SmartStore.DevTools/Web.config +++ b/src/Plugins/SmartStore.DevTools/Web.config @@ -79,7 +79,7 @@ - + diff --git a/src/Plugins/SmartStore.DevTools/packages.config b/src/Plugins/SmartStore.DevTools/packages.config index 1583e8026b..218e690d73 100644 --- a/src/Plugins/SmartStore.DevTools/packages.config +++ b/src/Plugins/SmartStore.DevTools/packages.config @@ -1,13 +1,14 @@  - - + + + @@ -16,4 +17,6 @@ + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj b/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj index 8045732912..bc92ae73f0 100644 --- a/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj +++ b/src/Plugins/SmartStore.FacebookAuth/SmartStore.FacebookAuth.csproj @@ -85,12 +85,12 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False @@ -123,6 +123,10 @@ ..\..\packages\DotNetOpenAuth.OpenId.RelyingParty.4.3.4.13329\lib\net45-full\DotNetOpenAuth.OpenId.RelyingParty.dll True + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -136,6 +140,7 @@ False + @@ -148,6 +153,14 @@ False + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.FacebookAuth/packages.config b/src/Plugins/SmartStore.FacebookAuth/packages.config index c30173272e..1ec5c2fa2b 100644 --- a/src/Plugins/SmartStore.FacebookAuth/packages.config +++ b/src/Plugins/SmartStore.FacebookAuth/packages.config @@ -1,7 +1,7 @@  - - + + @@ -12,9 +12,12 @@ + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.FacebookAuth/web.config b/src/Plugins/SmartStore.FacebookAuth/web.config index d3ef8d4db1..69adedf4ac 100644 --- a/src/Plugins/SmartStore.FacebookAuth/web.config +++ b/src/Plugins/SmartStore.FacebookAuth/web.config @@ -79,7 +79,7 @@ - + diff --git a/src/Plugins/SmartStore.GoogleAnalytics/web.config b/src/Plugins/SmartStore.GoogleAnalytics/web.config index 21fe12fec3..a1041ef9b0 100644 --- a/src/Plugins/SmartStore.GoogleAnalytics/web.config +++ b/src/Plugins/SmartStore.GoogleAnalytics/web.config @@ -74,7 +74,7 @@ - + diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj index 06368ab51d..4bc8d5c1f7 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/SmartStore.GoogleMerchantCenter.csproj @@ -85,12 +85,12 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False @@ -105,6 +105,10 @@ ..\..\packages\FluentValidation.7.4.0\lib\net45\FluentValidation.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -118,8 +122,17 @@ False + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config b/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config index 6f0d685c52..ba0f4f340a 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/packages.config @@ -1,13 +1,16 @@  - - + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/web.config b/src/Plugins/SmartStore.GoogleMerchantCenter/web.config index 552e56025b..e15d8a0902 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/web.config +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/web.config @@ -75,7 +75,7 @@ - + diff --git a/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj b/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj index 5b6689d041..cd1359771c 100644 --- a/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj +++ b/src/Plugins/SmartStore.OfflinePayment/SmartStore.OfflinePayment.csproj @@ -85,14 +85,18 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False ..\..\packages\FluentValidation.7.4.0\lib\net45\FluentValidation.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -106,8 +110,17 @@ False + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.OfflinePayment/packages.config b/src/Plugins/SmartStore.OfflinePayment/packages.config index 940a1c2036..9fb815616a 100644 --- a/src/Plugins/SmartStore.OfflinePayment/packages.config +++ b/src/Plugins/SmartStore.OfflinePayment/packages.config @@ -1,11 +1,14 @@  - + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.OfflinePayment/web.config b/src/Plugins/SmartStore.OfflinePayment/web.config index 552e56025b..e15d8a0902 100644 --- a/src/Plugins/SmartStore.OfflinePayment/web.config +++ b/src/Plugins/SmartStore.OfflinePayment/web.config @@ -75,7 +75,7 @@ - + diff --git a/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj b/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj index 5e49a320b9..8ed2210936 100644 --- a/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj +++ b/src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj @@ -59,18 +59,22 @@ false - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False ..\..\packages\FluentValidation.7.4.0\lib\net45\FluentValidation.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -84,9 +88,18 @@ False + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.PayPal/packages.config b/src/Plugins/SmartStore.PayPal/packages.config index 5294b5ff78..40af810d02 100644 --- a/src/Plugins/SmartStore.PayPal/packages.config +++ b/src/Plugins/SmartStore.PayPal/packages.config @@ -1,13 +1,16 @@  - - + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.PayPal/web.config b/src/Plugins/SmartStore.PayPal/web.config index d5de44336a..5e67769af4 100644 --- a/src/Plugins/SmartStore.PayPal/web.config +++ b/src/Plugins/SmartStore.PayPal/web.config @@ -91,7 +91,7 @@ - + diff --git a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj index a4f65fe396..1ac5ed4f85 100644 --- a/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj +++ b/src/Plugins/SmartStore.Shipping/SmartStore.Shipping.csproj @@ -85,12 +85,12 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False @@ -101,6 +101,10 @@ ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -110,8 +114,17 @@ False + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.Shipping/packages.config b/src/Plugins/SmartStore.Shipping/packages.config index 775e294d7d..3f60621a73 100644 --- a/src/Plugins/SmartStore.Shipping/packages.config +++ b/src/Plugins/SmartStore.Shipping/packages.config @@ -1,11 +1,14 @@  - - + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.Shipping/web.config b/src/Plugins/SmartStore.Shipping/web.config index 21fe12fec3..a1041ef9b0 100644 --- a/src/Plugins/SmartStore.Shipping/web.config +++ b/src/Plugins/SmartStore.Shipping/web.config @@ -74,7 +74,7 @@ - + diff --git a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj index ca1310024f..7e250cd045 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj +++ b/src/Plugins/SmartStore.ShippingByWeight/SmartStore.ShippingByWeight.csproj @@ -85,12 +85,12 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False @@ -101,6 +101,10 @@ ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -110,8 +114,17 @@ False + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.ShippingByWeight/packages.config b/src/Plugins/SmartStore.ShippingByWeight/packages.config index 775e294d7d..3f60621a73 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/packages.config +++ b/src/Plugins/SmartStore.ShippingByWeight/packages.config @@ -1,11 +1,14 @@  - - + + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.ShippingByWeight/web.config b/src/Plugins/SmartStore.ShippingByWeight/web.config index 21fe12fec3..a1041ef9b0 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/web.config +++ b/src/Plugins/SmartStore.ShippingByWeight/web.config @@ -74,7 +74,7 @@ - + diff --git a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj index 36f3d57b73..8e700adbe5 100644 --- a/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj +++ b/src/Plugins/SmartStore.Tax/SmartStore.Tax.csproj @@ -85,8 +85,8 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False @@ -97,6 +97,10 @@ ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -110,8 +114,17 @@ False + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.Tax/packages.config b/src/Plugins/SmartStore.Tax/packages.config index 36d0a9ec66..67dcff123b 100644 --- a/src/Plugins/SmartStore.Tax/packages.config +++ b/src/Plugins/SmartStore.Tax/packages.config @@ -1,11 +1,14 @@  - + + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.Tax/web.config b/src/Plugins/SmartStore.Tax/web.config index 552e56025b..e15d8a0902 100644 --- a/src/Plugins/SmartStore.Tax/web.config +++ b/src/Plugins/SmartStore.Tax/web.config @@ -75,7 +75,7 @@ - + diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 56670be120..a724433ca6 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -83,16 +83,16 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll False - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll False - - ..\..\packages\Autofac.WebApi2.4.2.0\lib\net45\Autofac.Integration.WebApi.dll + + ..\..\packages\Autofac.WebApi2.5.0.0\lib\net461\Autofac.Integration.WebApi.dll False @@ -103,6 +103,10 @@ ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll False + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll False @@ -128,6 +132,7 @@ True + @@ -138,6 +143,10 @@ False + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + False + @@ -145,6 +154,10 @@ ..\..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll False + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + False + diff --git a/src/Plugins/SmartStore.WebApi/packages.config b/src/Plugins/SmartStore.WebApi/packages.config index 70f1cfe266..554f1b2b1b 100644 --- a/src/Plugins/SmartStore.WebApi/packages.config +++ b/src/Plugins/SmartStore.WebApi/packages.config @@ -1,8 +1,8 @@  - - - + + + @@ -13,11 +13,14 @@ + + + \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/web.config b/src/Plugins/SmartStore.WebApi/web.config index 9eb24d4874..40c8794565 100644 --- a/src/Plugins/SmartStore.WebApi/web.config +++ b/src/Plugins/SmartStore.WebApi/web.config @@ -39,7 +39,7 @@ - + diff --git a/src/Presentation/SmartStore.Web.Framework/DependencyRegistrar.cs b/src/Presentation/SmartStore.Web.Framework/DependencyRegistrar.cs index f228466df9..2d65ce1470 100644 --- a/src/Presentation/SmartStore.Web.Framework/DependencyRegistrar.cs +++ b/src/Presentation/SmartStore.Web.Framework/DependencyRegistrar.cs @@ -7,6 +7,7 @@ using Autofac; using Autofac.Builder; using Autofac.Core; +using Autofac.Core.Registration; using Autofac.Integration.Mvc; using Autofac.Integration.WebApi; using SmartStore.ComponentModel; @@ -278,7 +279,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType().As().InstancePerRequest(); } - protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) + protected override void AttachToComponentRegistration(IComponentRegistryBuilder componentRegistry, IComponentRegistration registration) { // Look for first settable property of type "ICommonServices" and inject var servicesProperty = FindCommonServicesProperty(registration.Activator.LimitType); @@ -448,7 +449,7 @@ Type findHookedType(Type t) .InstancePerRequest(); } - protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) + protected override void AttachToComponentRegistration(IComponentRegistryBuilder componentRegistry, IComponentRegistration registration) { var querySettingsProperty = FindQuerySettingsProperty(registration.Activator.LimitType); @@ -503,7 +504,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType().InstancePerRequest(); } - protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) + protected override void AttachToComponentRegistration(IComponentRegistryBuilder componentRegistry, IComponentRegistration registration) { var userProperty = FindUserProperty(registration.Activator.LimitType); @@ -752,7 +753,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterType().As(); } - protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) + protected override void AttachToComponentRegistration(IComponentRegistryBuilder componentRegistry, IComponentRegistration registration) { if (!DataSettings.DatabaseIsInstalled()) return; @@ -1330,7 +1331,8 @@ static IComponentRegistration CreateMetaRegistration(Service providedService, if (!workValues.Values.TryGetValue(w, out T value)) { - value = (T)workValues.ComponentContext.ResolveComponent(valueRegistration, p); + var request = new ResolveRequest(providedService, valueRegistration, p); + value = (T)workValues.ComponentContext.ResolveComponent(request); workValues.Values[w] = value; } @@ -1341,7 +1343,7 @@ static IComponentRegistration CreateMetaRegistration(Service providedService, }); }) .As(providedService) - .Targeting(valueRegistration) + .Targeting(valueRegistration, false) .SingleInstance(); return rb.CreateRegistration(); diff --git a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj index 4358766610..99aaa7dadf 100644 --- a/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj +++ b/src/Presentation/SmartStore.Web.Framework/SmartStore.Web.Framework.csproj @@ -71,15 +71,14 @@ False ..\..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll - True + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll - - ..\..\packages\Autofac.WebApi2.4.2.0\lib\net45\Autofac.Integration.WebApi.dll + + ..\..\packages\Autofac.WebApi2.5.0.0\lib\net461\Autofac.Integration.WebApi.dll ..\..\packages\AutoprefixerHost.1.1.10\lib\net45\AutoprefixerHost.dll @@ -116,6 +115,9 @@ ..\..\packages\LibSassHost.1.2.6\lib\net471\LibSassHost.dll + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + ..\..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll @@ -146,6 +148,9 @@ ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll @@ -154,6 +159,9 @@ ..\..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + diff --git a/src/Presentation/SmartStore.Web.Framework/app.config b/src/Presentation/SmartStore.Web.Framework/app.config index 3cf6309ecc..6268c5997d 100644 --- a/src/Presentation/SmartStore.Web.Framework/app.config +++ b/src/Presentation/SmartStore.Web.Framework/app.config @@ -8,7 +8,7 @@ - + diff --git a/src/Presentation/SmartStore.Web.Framework/packages.config b/src/Presentation/SmartStore.Web.Framework/packages.config index 8ad306cfc9..60230ca41b 100644 --- a/src/Presentation/SmartStore.Web.Framework/packages.config +++ b/src/Presentation/SmartStore.Web.Framework/packages.config @@ -2,9 +2,9 @@ - - - + + + @@ -25,6 +25,7 @@ + @@ -35,7 +36,9 @@ + + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj index 69ebd0a824..2eefc4a9dc 100644 --- a/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj +++ b/src/Presentation/SmartStore.Web/Administration/SmartStore.Admin.csproj @@ -66,12 +66,11 @@ ..\..\..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll False - - ..\..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll - - ..\..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll - False + + ..\..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll ..\..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll @@ -84,6 +83,9 @@ ..\..\..\packages\FluentValidation.7.4.0\lib\net45\FluentValidation.dll + + ..\..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False ..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -115,11 +117,17 @@ ..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + ..\..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + diff --git a/src/Presentation/SmartStore.Web/Administration/Web.config b/src/Presentation/SmartStore.Web/Administration/Web.config index 19498da48d..7bfcddf208 100644 --- a/src/Presentation/SmartStore.Web/Administration/Web.config +++ b/src/Presentation/SmartStore.Web/Administration/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/Administration/packages.config b/src/Presentation/SmartStore.Web/Administration/packages.config index 7c34e63d21..185c22d86f 100644 --- a/src/Presentation/SmartStore.Web/Administration/packages.config +++ b/src/Presentation/SmartStore.Web/Administration/packages.config @@ -1,8 +1,8 @@  - - + + @@ -12,10 +12,13 @@ + + + \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj index 766aabe98b..cffabce250 100644 --- a/src/Presentation/SmartStore.Web/SmartStore.Web.csproj +++ b/src/Presentation/SmartStore.Web/SmartStore.Web.csproj @@ -79,12 +79,11 @@ False ..\..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll - - ..\..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll - True + + ..\..\packages\Autofac.Mvc5.5.0.0\lib\net461\Autofac.Integration.Mvc.dll ..\..\packages\AutoprefixerHost.1.1.10\lib\net45\AutoprefixerHost.dll @@ -140,6 +139,9 @@ ..\..\packages\LibSassHost.1.2.6\lib\net471\LibSassHost.dll + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -172,6 +174,9 @@ ..\..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll @@ -180,6 +185,9 @@ + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + diff --git a/src/Presentation/SmartStore.Web/Web.config b/src/Presentation/SmartStore.Web/Web.config index 9f5c1343d2..cb83d5a972 100644 --- a/src/Presentation/SmartStore.Web/Web.config +++ b/src/Presentation/SmartStore.Web/Web.config @@ -266,7 +266,7 @@ - + diff --git a/src/Presentation/SmartStore.Web/packages.config b/src/Presentation/SmartStore.Web/packages.config index 212f98819d..4bc6a49167 100644 --- a/src/Presentation/SmartStore.Web/packages.config +++ b/src/Presentation/SmartStore.Web/packages.config @@ -2,8 +2,8 @@ - - + + @@ -27,6 +27,7 @@ + @@ -37,6 +38,8 @@ + + \ No newline at end of file diff --git a/src/Tests/SmartStore.Core.Tests/App.config b/src/Tests/SmartStore.Core.Tests/App.config index d8c6b8d753..a1bf925b24 100644 --- a/src/Tests/SmartStore.Core.Tests/App.config +++ b/src/Tests/SmartStore.Core.Tests/App.config @@ -16,7 +16,7 @@ - + diff --git a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj index 65432f54b0..614e73c738 100644 --- a/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj +++ b/src/Tests/SmartStore.Core.Tests/SmartStore.Core.Tests.csproj @@ -62,8 +62,8 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll @@ -71,6 +71,9 @@ ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll @@ -87,6 +90,12 @@ + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + diff --git a/src/Tests/SmartStore.Core.Tests/packages.config b/src/Tests/SmartStore.Core.Tests/packages.config index 464049c76b..c5c54e3b6d 100644 --- a/src/Tests/SmartStore.Core.Tests/packages.config +++ b/src/Tests/SmartStore.Core.Tests/packages.config @@ -1,8 +1,11 @@  - + + + + \ No newline at end of file diff --git a/src/Tests/SmartStore.Data.Tests/App.config b/src/Tests/SmartStore.Data.Tests/App.config index 1378872e0d..e0aaca7600 100644 --- a/src/Tests/SmartStore.Data.Tests/App.config +++ b/src/Tests/SmartStore.Data.Tests/App.config @@ -24,7 +24,7 @@ - + diff --git a/src/Tests/SmartStore.Services.Tests/App.config b/src/Tests/SmartStore.Services.Tests/App.config index 42628e2c61..c39dc1a0f3 100644 --- a/src/Tests/SmartStore.Services.Tests/App.config +++ b/src/Tests/SmartStore.Services.Tests/App.config @@ -34,7 +34,7 @@ - + diff --git a/src/Tests/SmartStore.Tests/App.config b/src/Tests/SmartStore.Tests/App.config index a9530d0756..e1c69410e5 100644 --- a/src/Tests/SmartStore.Tests/App.config +++ b/src/Tests/SmartStore.Tests/App.config @@ -11,7 +11,7 @@ - + diff --git a/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj b/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj index 656767cf8c..bc6caffde1 100644 --- a/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj +++ b/src/Tests/SmartStore.Tests/SmartStore.Tests.csproj @@ -62,8 +62,8 @@ MinimumRecommendedRules.ruleset - - ..\..\packages\Autofac.4.9.0\lib\net45\Autofac.dll + + ..\..\packages\Autofac.5.2.0\lib\net461\Autofac.dll ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll @@ -71,6 +71,9 @@ ..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + + ..\..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + False ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll @@ -79,8 +82,15 @@ ..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + diff --git a/src/Tests/SmartStore.Tests/packages.config b/src/Tests/SmartStore.Tests/packages.config index e08776c4ed..7aacc4eda3 100644 --- a/src/Tests/SmartStore.Tests/packages.config +++ b/src/Tests/SmartStore.Tests/packages.config @@ -1,7 +1,10 @@  - + + + + \ No newline at end of file diff --git a/src/Tests/SmartStore.Web.MVC.Tests/App.config b/src/Tests/SmartStore.Web.MVC.Tests/App.config index 6ebf5eff27..21fa8e95a1 100644 --- a/src/Tests/SmartStore.Web.MVC.Tests/App.config +++ b/src/Tests/SmartStore.Web.MVC.Tests/App.config @@ -23,7 +23,7 @@ - + diff --git a/src/Tools/SmartStore.Packager/App.config b/src/Tools/SmartStore.Packager/App.config index 5ce5d12972..7a1de6a456 100644 --- a/src/Tools/SmartStore.Packager/App.config +++ b/src/Tools/SmartStore.Packager/App.config @@ -22,7 +22,7 @@ - + From 230a10b03cfee4788c2d514def4ed990dee9437b Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Wed, 12 Aug 2020 10:33:13 +0200 Subject: [PATCH 032/695] Installation: fixes "Invalid object name dbo.Customer_CustomerRole_Mapping" (cherry picked from commit a18bf4d7613729f38b782be6db684567e5a1ce41) --- .../Migrations/202003052100521_CustomerRoleMappings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Libraries/SmartStore.Data/Migrations/202003052100521_CustomerRoleMappings.cs b/src/Libraries/SmartStore.Data/Migrations/202003052100521_CustomerRoleMappings.cs index b0c4bf9640..b9fd772490 100644 --- a/src/Libraries/SmartStore.Data/Migrations/202003052100521_CustomerRoleMappings.cs +++ b/src/Libraries/SmartStore.Data/Migrations/202003052100521_CustomerRoleMappings.cs @@ -42,10 +42,10 @@ public override void Up() .Index(t => t.CustomerRole_Id) .Index(t => t.RuleSetEntity_Id); - if (HostingEnvironment.IsHosted) + if (HostingEnvironment.IsHosted && DataSettings.Current.IsSqlServer) { // Copy customer role mappings. - Sql("Insert Into [dbo].[CustomerRoleMapping] (CustomerId, CustomerRoleId, IsSystemMapping) Select Customer_Id As Customer_Id, CustomerRole_Id As CustomerRole_Id, 0 As IsSystemMapping From [dbo].[Customer_CustomerRole_Mapping]"); + Sql("IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Customer_CustomerRole_Mapping')) BEGIN Insert Into [dbo].[CustomerRoleMapping] (CustomerId, CustomerRoleId, IsSystemMapping) Select Customer_Id As Customer_Id, CustomerRole_Id As CustomerRole_Id, 0 As IsSystemMapping From [dbo].[Customer_CustomerRole_Mapping] END"); } } From 32d15520c7454698bc5e4ebc62596749c9243599 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Wed, 12 Aug 2020 14:24:10 +0200 Subject: [PATCH 033/695] API: if paging is required and there is no $top sent by client then force the page size specified by merchant (in that case do not produce an error any more) --- .../Controllers/Api/PaymentsController.cs | 2 +- .../Controllers/Api/UploadsController.cs | 4 +- .../Controllers/OData/CustomersController.cs | 2 +- .../Controllers/OData/MediaController.cs | 2 +- .../Controllers/OData/ProductsController.cs | 12 ++--- .../WebApi/OData/WebApiQueryableAttribute.cs | 49 ++++++------------- 6 files changed, 26 insertions(+), 45 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs index 08cd9c73d6..d108efa64e 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/Api/PaymentsController.cs @@ -19,7 +19,7 @@ public PaymentsController(Lazy providerManager) _providerManager = providerManager; } - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] public IQueryable GetMethods() { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs index a6a6e3fd42..d5bbb1a10c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/Api/UploadsController.cs @@ -89,7 +89,7 @@ private StringContent CloneHeaderContent(string path, MultipartFileData origin) #endregion [HttpPost, WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] public async Task> ProductImages() { if (!Request.Content.IsMimeMultipartContent()) @@ -218,7 +218,7 @@ public async Task> ProductImages() } [HttpPost, WebApiAuthenticate(Permission = Permissions.Configuration.Import.Execute)] - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] public async Task> ImportFiles() { if (!Request.Content.IsMimeMultipartContent()) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 93cddb03c3..fb2d49941a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -111,7 +111,7 @@ public async Task Delete(int key) #region Navigation properties - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] public HttpResponseMessage GetAddresses(int key, int relatedKey = 0 /*addressId*/) { diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index ad8d87063f..70085b407b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -171,7 +171,7 @@ public MediaFileInfo GetFileByPath(ODataActionParameters parameters) /// POST /Media/GetFilesByIds {"Ids":[1,2,3]} [HttpPost, WebApiAuthenticate] - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] public IQueryable GetFilesByIds(ODataActionParameters parameters) { IList files = null; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index de5f207710..086417d141 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -169,7 +169,7 @@ public SingleResult GetSampleDownload(int key) } - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] public HttpResponseMessage GetProductCategories(int key, int relatedKey = 0 /*categoryId*/) { @@ -227,7 +227,7 @@ public HttpResponseMessage DeleteProductCategories(int key, int relatedKey = 0 / } - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] public HttpResponseMessage GetProductManufacturers(int key, int relatedKey = 0 /*manufacturerId*/) { @@ -285,7 +285,7 @@ public HttpResponseMessage DeleteProductManufacturers(int key, int relatedKey = } - [WebApiQueryable(PagingOptional = true)] + [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] public HttpResponseMessage GetProductPictures(int key, int relatedKey = 0 /*mediaFileId*/) { @@ -423,7 +423,7 @@ public static void Init(WebApiConfigurationBroadcaster configData) manageAttributes.CollectionParameter("Attributes"); } - [HttpPost, WebApiQueryable(PagingOptional = true)] + [HttpPost, WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] public IQueryable Search([ModelBinder(typeof(WebApiCatalogSearchQueryModelBinder))] CatalogSearchQuery query) { @@ -492,7 +492,7 @@ public IQueryable Search([ModelBinder(typeof(WebApiCatalogSearchQueryMo return CalculatePrice(key, true); } - [HttpPost, WebApiQueryable(PagingOptional = true)] + [HttpPost, WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] public IQueryable CreateAttributeCombinations(int key) { @@ -506,7 +506,7 @@ public IQueryable CreateAttributeCombination return entity.ProductVariantAttributeCombinations.AsQueryable(); } - [HttpPost, WebApiQueryable(PagingOptional = true)] + [HttpPost, WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditVariant)] public IQueryable ManageAttributes(int key, ODataActionParameters parameters) { diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs index 424f52df82..16322f986c 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/OData/WebApiQueryableAttribute.cs @@ -1,5 +1,4 @@ using System; -using System.Net; using System.Net.Http; using System.Web.Http; using System.Web.Http.Filters; @@ -8,25 +7,16 @@ namespace SmartStore.Web.Framework.WebApi.OData { - /// - /// The [EnableQuery] attribute enables clients to modify the query, by using query options such as $filter, $sort, and $page. - /// - /// - public class WebApiQueryableAttribute : EnableQueryAttribute + /// + /// The [EnableQuery] attribute enables clients to modify the query, by using query options such as $filter, $sort, and $page. + /// + /// + public class WebApiQueryableAttribute : EnableQueryAttribute { - public bool PagingOptional { get; set; } - - protected virtual bool MissingClientPaging(HttpActionExecutedContext actionExecutedContext) + protected virtual void SetDefaultQueryOptions(HttpActionExecutedContext actionExecutedContext) { - if (PagingOptional) - { - return false; - } - try { - var content = actionExecutedContext.Response.Content as ObjectContent; - if (MaxTop == 0) { var controllingData = WebApiCachingControllingData.Data(); @@ -35,38 +25,29 @@ protected virtual bool MissingClientPaging(HttpActionExecutedContext actionExecu MaxExpansionDepth = controllingData.MaxExpansionDepth; } - if (content != null) + var content = actionExecutedContext?.Response?.Content as ObjectContent; + if (content?.Value is HttpError || content?.Value is SingleResult) { - if (content.Value is HttpError) - return false; - - if (content.Value is SingleResult) - return false; // 'true' would result in a 500 'internal server error' + // Paging not required. + return; } - var query = actionExecutedContext.Request.RequestUri.Query; - var missingClientPaging = query.IsEmpty() || !query.Contains("$top="); - - if (missingClientPaging) + var hasClientPaging = actionExecutedContext?.Request?.RequestUri?.Query?.Contains("$top=") ?? false; + if (!hasClientPaging) { - actionExecutedContext.Response = actionExecutedContext.Request.CreateErrorResponse(HttpStatusCode.BadRequest, - $"Missing client paging. Please specify odata $top query option. Maximum value is {MaxTop}."); - - return true; + // If paging is required and there is no $top sent by client then force the page size specified by merchant. + PageSize = MaxTop; } } catch (Exception ex) { ex.Dump(); } - - return false; } public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { - if (MissingClientPaging(actionExecutedContext)) - return; + SetDefaultQueryOptions(actionExecutedContext); base.OnActionExecuted(actionExecutedContext); } From 3e0948e03611633c36b6f66ef7532ba15f7b43f5 Mon Sep 17 00:00:00 2001 From: Marcel Schmidt Date: Wed, 12 Aug 2020 21:46:44 +0200 Subject: [PATCH 034/695] fu > minor adjustments --- .../Views/Shared/Components/FileUploader.cshtml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml index 6159bdb862..6b752a57d4 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/Components/FileUploader.cshtml @@ -65,7 +65,7 @@ { // TODO: find a better way!!! var mediaService = EngineContext.Current.Resolve(); - var files = Model.UploadedFiles; + var files = Model.UploadedFiles ?? new List();
@@ -73,14 +73,12 @@ { var previewUrl = mediaService.GetUrl(file.MediaFileId, 250); var isMainPic = file.MediaFileId == Model.MainFileId; - var entityMediaId = 0; - - if (Model.EntityType.Equals("Product")) - { - var entityMediaFile = file as ProductMediaFile; - entityMediaId = entityMediaFile.Id; - } + var entityMediaId = file.MediaFileId; + //if (Model.EntityType.Equals("Product")) + //{ + //entityMediaId = file.MediaFileId; +
Date: Wed, 12 Aug 2020 21:47:26 +0200 Subject: [PATCH 035/695] pb > gallery block: moved GalleryMediaFuile to pb gallery block --- .../SmartStore.Core/Domain/Catalog/ProductMediaFile.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs b/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs index bbf8b12cf1..e43e481e90 100644 --- a/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs +++ b/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs @@ -20,14 +20,6 @@ public interface IMediaFile MediaFile MediaFile { get; set; } } - public class GalleryMediaFile : IMediaFile - { - public int MediaFileId { get; set; } - public string Title { get; set; } - public int DisplayOrder { get; set; } - public MediaFile MediaFile { get; set; } - } - /// /// Represents a product media file mapping /// From 63ebb871706bf7344f50bcd565681ff605a9c6ff Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Wed, 12 Aug 2020 21:57:39 +0200 Subject: [PATCH 036/695] Resolves #2053: Handle output cache invalidation for media files --- .../Caching/OutputCache/DisplayControl.cs | 5 +++++ .../SmartStore.Core/Domain/Media/MediaFile.cs | 19 +++++++++++++++++++ .../Controllers/BlogController.cs | 2 ++ .../Controllers/CatalogHelper.MapProduct.cs | 2 ++ .../Controllers/CatalogHelper.cs | 10 ++++++++-- .../Controllers/NewsController.cs | 2 ++ .../Views/Shared/MediaTemplates/Audio.cshtml | 8 +++++--- .../Views/Shared/MediaTemplates/Bin.cshtml | 13 ++++++------- .../Shared/MediaTemplates/Document.cshtml | 13 ++++++------- .../Views/Shared/MediaTemplates/Text.cshtml | 13 ++++++------- .../Views/Shared/MediaTemplates/Video.cshtml | 8 +++++--- .../Shared/MediaTemplates/_Thumbnail.cshtml | 12 ++++++++---- 12 files changed, 74 insertions(+), 33 deletions(-) diff --git a/src/Libraries/SmartStore.Core/Caching/OutputCache/DisplayControl.cs b/src/Libraries/SmartStore.Core/Caching/OutputCache/DisplayControl.cs index 28a05372d5..35875da687 100644 --- a/src/Libraries/SmartStore.Core/Caching/OutputCache/DisplayControl.cs +++ b/src/Libraries/SmartStore.Core/Caching/OutputCache/DisplayControl.cs @@ -8,6 +8,7 @@ using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Discounts; using SmartStore.Core.Domain.Localization; +using SmartStore.Core.Domain.Media; using SmartStore.Core.Domain.News; using SmartStore.Core.Domain.Topics; using SmartStore.Utilities; @@ -36,6 +37,7 @@ public partial class DisplayControl : IDisplayControl [typeof(NewsItem)] = (x, c) => new[] { "n" + x.Id }, [typeof(NewsComment)] = (x, c) => new[] { "n" + ((NewsComment)x).NewsItemId }, [typeof(Topic)] = (x, c) => new[] { "t" + x.Id }, + [typeof(MediaFile)] = (x, c) => new[] { "mf" + x.Id }, [typeof(SpecificationAttributeOption)] = (x, c) => ((SpecificationAttributeOption)x).ProductSpecificationAttributes.Select(y => "p" + y.ProductId), [typeof(ProductTag)] = (x, c) => ((ProductTag)x).Products.Select(y => "p" + y.Id), [typeof(Product)] = HandleProduct, @@ -153,6 +155,9 @@ private static IEnumerable HandleLocalizedProperty(BaseEntity entity, IC case nameof(Topic): prefix = "t"; break; + case nameof(MediaFile): + prefix = "mf"; + break; case nameof(SpecificationAttribute): targetEntity = dbContext.Set().Find(lp.EntityId); break; diff --git a/src/Libraries/SmartStore.Core/Domain/Media/MediaFile.cs b/src/Libraries/SmartStore.Core/Domain/Media/MediaFile.cs index 592ad6d5d5..051fc8efff 100644 --- a/src/Libraries/SmartStore.Core/Domain/Media/MediaFile.cs +++ b/src/Libraries/SmartStore.Core/Domain/Media/MediaFile.cs @@ -10,6 +10,25 @@ namespace SmartStore.Core.Domain.Media [DataContract] public partial class MediaFile : BaseEntity, ITransient, IHasMedia, IAuditable, ISoftDeletable, ILocalizedEntity { + #region static + + private static readonly HashSet _outputAffectingProductProps = new HashSet + { + nameof(MediaFile.FolderId), + nameof(MediaFile.Name), + nameof(MediaFile.Alt), + nameof(MediaFile.Title), + nameof(MediaFile.Hidden), + nameof(MediaFile.Deleted) + }; + + public static IReadOnlyCollection GetOutputAffectingPropertyNames() + { + return _outputAffectingProductProps; + } + + #endregion + private ICollection _productMediaFiles; private ICollection _tags; private ICollection _tracks; diff --git a/src/Presentation/SmartStore.Web/Controllers/BlogController.cs b/src/Presentation/SmartStore.Web/Controllers/BlogController.cs index 01bbf3bc49..4bb3982f98 100644 --- a/src/Presentation/SmartStore.Web/Controllers/BlogController.cs +++ b/src/Presentation/SmartStore.Web/Controllers/BlogController.cs @@ -117,6 +117,8 @@ protected PictureModel PrepareBlogPostPictureModel(BlogPost blogPost, int? fileI AlternateText = file?.File?.GetLocalized(x => x.Alt)?.Value.NullEmpty() ?? blogPost.Title, File = file }; + + _services.DisplayControl.Announce(file?.File); return pictureModel; } diff --git a/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.MapProduct.cs b/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.MapProduct.cs index 47ebd0a52e..fb6ed03e63 100644 --- a/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.MapProduct.cs +++ b/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.MapProduct.cs @@ -465,6 +465,8 @@ private void MapProductSummaryItem(Product product, MapProductSummaryItemContext AlternateText = file?.File?.GetLocalized(x => x.Alt)?.Value.NullEmpty() ?? string.Format(ctx.Resources["Media.Product.ImageAlternateTextFormat"], item.Name), File = file }; + + _services.DisplayControl.Announce(file?.File); } // Manufacturers diff --git a/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.cs b/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.cs index e4ff90d732..91d171adc5 100644 --- a/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.cs +++ b/src/Presentation/SmartStore.Web/Controllers/CatalogHelper.cs @@ -217,7 +217,9 @@ public IList MapCategorySummaryModel(IEnumerable File = file }; - return model; + _services.DisplayControl.Announce(file?.File); + + return model; }) .ToList(); } @@ -590,6 +592,8 @@ private PictureModel CreatePictureModel(ProductDetailsPictureModel model, MediaF File = _mediaService.ConvertMediaFile(file) }; + _services.DisplayControl.Announce(file); + return result; } @@ -1508,7 +1512,9 @@ public PictureModel PrepareManufacturerPictureModel( File = file }; - return model; + _services.DisplayControl.Announce(file?.File); + + return model; } public ManufacturerNavigationModel PrepareManufacturerNavigationModel(int manufacturerItemsToDisplay) diff --git a/src/Presentation/SmartStore.Web/Controllers/NewsController.cs b/src/Presentation/SmartStore.Web/Controllers/NewsController.cs index e4cf21638c..907097b4b6 100644 --- a/src/Presentation/SmartStore.Web/Controllers/NewsController.cs +++ b/src/Presentation/SmartStore.Web/Controllers/NewsController.cs @@ -387,6 +387,8 @@ protected PictureModel PrepareNewsItemPictureModel(NewsItem newsItem, int? fileI File = file }; + _services.DisplayControl.Announce(file?.File); + return pictureModel; } diff --git a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Audio.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Audio.cshtml index 8c53272ba5..335dd0eeb9 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Audio.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Audio.cshtml @@ -1,5 +1,7 @@ -@using SmartStore.Web.Framework.Modelling; -@model MediaTemplateModel +@model MediaTemplateModel + +@using SmartStore.Web.Framework.Modelling; + @if (Model.RenderViewer) {
@@ -8,5 +10,5 @@ } else { - @Html.Partial("MediaTemplates/_Thumbnail") + @Html.Partial("MediaTemplates/_Thumbnail", Model) } \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Bin.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Bin.cshtml index 43b9316bde..e2ce0c6ebb 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Bin.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Bin.cshtml @@ -1,9 +1,8 @@ -@using SmartStore.Web.Framework.Modelling; -@model MediaTemplateModel -@if (Model.RenderViewer) +@model MediaTemplateModel + +@using SmartStore.Web.Framework.Modelling; + +@if (!Model.RenderViewer) { -} -else -{ - @Html.Partial("MediaTemplates/_Thumbnail") + @Html.Partial("MediaTemplates/_Thumbnail", Model) } \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Document.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Document.cshtml index 43b9316bde..e2ce0c6ebb 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Document.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Document.cshtml @@ -1,9 +1,8 @@ -@using SmartStore.Web.Framework.Modelling; -@model MediaTemplateModel -@if (Model.RenderViewer) +@model MediaTemplateModel + +@using SmartStore.Web.Framework.Modelling; + +@if (!Model.RenderViewer) { -} -else -{ - @Html.Partial("MediaTemplates/_Thumbnail") + @Html.Partial("MediaTemplates/_Thumbnail", Model) } \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Text.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Text.cshtml index 43b9316bde..e2ce0c6ebb 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Text.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Text.cshtml @@ -1,9 +1,8 @@ -@using SmartStore.Web.Framework.Modelling; -@model MediaTemplateModel -@if (Model.RenderViewer) +@model MediaTemplateModel + +@using SmartStore.Web.Framework.Modelling; + +@if (!Model.RenderViewer) { -} -else -{ - @Html.Partial("MediaTemplates/_Thumbnail") + @Html.Partial("MediaTemplates/_Thumbnail", Model) } \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Video.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Video.cshtml index 50af54c289..2bfa55d44a 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Video.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/Video.cshtml @@ -1,5 +1,7 @@ -@using SmartStore.Web.Framework.Modelling; -@model MediaTemplateModel +@model MediaTemplateModel + +@using SmartStore.Web.Framework.Modelling; + @if (Model.RenderViewer) {
@@ -8,5 +10,5 @@ } else { - @Html.Partial("MediaTemplates/_Thumbnail") + @Html.Partial("MediaTemplates/_Thumbnail", Model) } \ No newline at end of file diff --git a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/_Thumbnail.cshtml b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/_Thumbnail.cshtml index b299415941..50494c6947 100644 --- a/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/_Thumbnail.cshtml +++ b/src/Presentation/SmartStore.Web/Views/Shared/MediaTemplates/_Thumbnail.cshtml @@ -1,17 +1,21 @@ -@using SmartStore.Web.Framework.Modelling; -@model MediaTemplateModel +@model MediaTemplateModel + +@using SmartStore.Web.Framework.Modelling; + @{ dynamic iconHint = GetIconHint(Model.File.MediaType); } +
@* Title must be on the Picture attribute, otherwise it's covered by the CSS play-video symbol. *@ - @Model.Alt
+ @functions { private object GetIconHint(string mediaType) { From 359fd22678f8ba4a59373d4564489d577bd92f2d Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Wed, 12 Aug 2020 22:04:37 +0200 Subject: [PATCH 037/695] API: IMediaService endpoints (in progress) --- .../Media/MediaFileInfo.cs | 7 +- .../Controllers/OData/MediaController.cs | 192 ++++++++++++------ .../Models/OData/Media/MediaItemInfo.cs | 30 +++ .../SmartStore.WebApi.csproj | 1 + .../WebApiConfigurationProvider.cs | 4 +- 5 files changed, 160 insertions(+), 74 deletions(-) create mode 100644 src/Plugins/SmartStore.WebApi/Models/OData/Media/MediaItemInfo.cs diff --git a/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs b/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs index 5ce0f0657e..bff031e5bb 100644 --- a/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs +++ b/src/Libraries/SmartStore.Services/Media/MediaFileInfo.cs @@ -35,12 +35,7 @@ public MediaFileInfo(MediaFile file, IMediaStorageProvider storageProvider, IMed public MediaFile File { get; } [JsonProperty("id")] - public int Id - { - get { return File.Id; } - set { } - } - //public int Id => File.Id; + public int Id => File.Id; [JsonProperty("folderId")] public int? FolderId => File.FolderId; diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 70085b407b..902e396705 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -1,81 +1,139 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; +using System.Web.OData.Query; +using SmartStore.ComponentModel; +using SmartStore.Core.Domain.Media; using SmartStore.Services.Media; using SmartStore.Web.Framework.WebApi; +using SmartStore.Web.Framework.WebApi.Caching; using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.Web.Framework.WebApi.OData; using SmartStore.Web.Framework.WebApi.Security; +using SmartStore.WebApi.Models.OData; namespace SmartStore.WebApi.Controllers.OData { - // TODO: readonly properties of MediaFileInfo cannot be serialized! - public class MediaController : ODataController + /// + /// Is intended to make methods of the IMediaService accessible. Direct access to the MediaFile entity is not intended. + /// + public class MediaController : WebApiEntityController { - private readonly IMediaService _mediaService; + // GET /Media(123) + [WebApiQueryable] + [WebApiAuthenticate] + public SingleResult Get(int key) + { + var file = Service.GetFileById(key); + if (file == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } - public MediaController(IMediaService mediaService) + return SingleResult.Create(new[] { Convert(file) }.AsQueryable()); + } + + // GET /Media + [WebApiQueryable] + [WebApiAuthenticate] + public IQueryable Get(/*ODataQueryOptions queryOptions*/) { - _mediaService = mediaService; + throw new HttpResponseException(HttpStatusCode.NotImplemented); + + // TODO or not TODO :) + //var maxTop = WebApiCachingControllingData.Data().MaxTop; + //var top = Math.Min(this.GetQueryStringValue("$top", maxTop), maxTop); + + //var query = queryOptions.ApplyTo(GetEntitySet(), new ODataQuerySettings { PageSize = top }) as IQueryable; + //var files = query.ToList(); + //var result = files.Select(x => Convert(Service.ConvertMediaFile(x))); + + //return result.AsQueryable(); } - // GET /Media(123) + // GET /Media(123)/ThumbUrl [WebApiAuthenticate] - public MediaFileInfo Get(int key) + public HttpResponseMessage GetProperty(int key, string propertyName) { - MediaFileInfo file = null; + var file = Service.GetFileById(key); + if (file == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } - this.ProcessEntity(() => + var item = Convert(file); + + var prop = FastProperty.GetProperty(item.GetType(), propertyName); + if (prop == null) { - file = _mediaService.GetFileById(key); - if (file == null) - { - throw Request.NotFoundException($"Cannot find file by ID {key}."); - } - }); + throw Request.BadRequestException(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName.EmptyNull())); + } - return file; + var propertyValue = prop.GetValue(item); + + return Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); } - #region Actions + public IHttpActionResult Post(MediaFile entity) + { + throw new HttpResponseException(HttpStatusCode.Forbidden); + } + + public IHttpActionResult Put(int key, MediaFile entity) + { + throw new HttpResponseException(HttpStatusCode.Forbidden); + } + + public IHttpActionResult Patch(int key, Delta model) + { + throw new HttpResponseException(HttpStatusCode.Forbidden); + } + + public IHttpActionResult Delete(int key) + { + throw new HttpResponseException(HttpStatusCode.Forbidden); + } + + #region Actions and functions public static void Init(WebApiConfigurationBroadcaster configData) { - var entityConfig = configData.ModelBuilder.EntityType(); + var entityConfig = configData.ModelBuilder.EntityType(); entityConfig.Collection - .Action("FileExists") - .ReturnsFromEntitySet("Media") + .Function("FileExists") + .Returns() .Parameter("Path"); entityConfig.Collection .Action("CheckUniqueFileName") - .ReturnsFromEntitySet("Media") + .ReturnsFromEntitySet("Media") .Parameter("Path"); entityConfig.Collection .Action("GetFileByPath") - .ReturnsFromEntitySet("Media") + .ReturnsFromEntitySet("Media") .Parameter("Path"); //var getFileByName = entityConfig.Collection // .Action("GetFileByName") - // .ReturnsFromEntitySet("Media"); + // .ReturnsFromEntitySet("Media"); //getFileByName.Parameter("FileName"); //getFileByName.Parameter("FolderId"); entityConfig.Collection .Action("GetFilesByIds") - .ReturnsFromEntitySet("Media") + .ReturnsFromEntitySet("Media") .CollectionParameter("Ids"); var countFiles = entityConfig.Collection .Action("CountFiles") - .ReturnsFromEntitySet("Media"); + .ReturnsFromEntitySet("Media"); countFiles.Parameter("FolderId"); countFiles.Parameter("DeepSearch"); countFiles.Parameter("Hidden"); @@ -87,19 +145,11 @@ public static void Init(WebApiConfigurationBroadcaster configData) countFiles.CollectionParameter("Extensions"); } - /// POST /Media/FileExists {"Path":"content/my-file.jpg"} - [HttpPost, WebApiAuthenticate] - public bool FileExists(ODataActionParameters parameters) + /// GET /Media/FileExists(Path='content/my-file.jpg') + [HttpGet, WebApiAuthenticate] + public bool FileExists([FromODataUri] string path) { - var fileExists = false; - - this.ProcessEntity(() => - { - var path = parameters.GetValueSafe("Path"); - - fileExists = _mediaService.FileExists(path); - }); - + var fileExists = Service.FileExists(path); return fileExists; } @@ -113,7 +163,7 @@ public HttpResponseMessage CheckUniqueFileName(ODataActionParameters parameters) { var path = parameters.GetValueSafe("Path"); - if (!_mediaService.CheckUniqueFileName(path, out newPath)) + if (!Service.CheckUniqueFileName(path, out newPath)) { // Just to make sure the result is unmistakable ;-) newPath = null; @@ -138,7 +188,7 @@ public MediaFileInfo GetFileByPath(ODataActionParameters parameters) { var path = parameters.GetValueSafe("Path"); - file = _mediaService.GetFileByPath(path); + file = Service.GetFileByPath(path); if (file == null) { throw Request.NotFoundException($"The file with the path '{path ?? string.Empty}' does not exist."); @@ -181,7 +231,7 @@ public IQueryable GetFilesByIds(ODataActionParameters parameters) var ids = parameters.GetValueSafe>("Ids"); if (ids?.Any() ?? false) { - files = _mediaService.GetFilesByIds(ids.ToArray()); + files = Service.GetFilesByIds(ids.ToArray()); } }); @@ -209,38 +259,48 @@ await this.ProcessEntityAsync(async () => Extensions = parameters.GetValueSafe>("Extensions")?.ToArray() }; - count = await _mediaService.CountFilesAsync(query); + count = await Service.CountFilesAsync(query); }); return count; } #endregion + + #region Utilities + + private MediaItemInfo Convert(MediaFileInfo file) + { + var item = MiniMapper.Map(file); + return item; + } + + #endregion } - // public class PicturesController : WebApiEntityController - //{ - // protected override IQueryable GetEntitySet() - // { - // var query = - // from x in Repository.Table - // where !x.Deleted && !x.Hidden - // select x; - - // return query; - // } - - // [WebApiQueryable] - // public SingleResult GetPicture(int key) - // { - // return GetSingleResult(key); - // } - - // [WebApiQueryable] - // public IQueryable GetProductPictures(int key) - // { - // return GetRelatedCollection(key, x => x.ProductMediaFiles); - // } - //} + // public class PicturesController : WebApiEntityController + //{ + // protected override IQueryable GetEntitySet() + // { + // var query = + // from x in Repository.Table + // where !x.Deleted && !x.Hidden + // select x; + + // return query; + // } + + // [WebApiQueryable] + // public SingleResult GetPicture(int key) + // { + // return GetSingleResult(key); + // } + + // [WebApiQueryable] + // public IQueryable GetProductPictures(int key) + // { + // return GetRelatedCollection(key, x => x.ProductMediaFiles); + // } + //} } diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/MediaItemInfo.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/MediaItemInfo.cs new file mode 100644 index 0000000000..f8bf9c2436 --- /dev/null +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/MediaItemInfo.cs @@ -0,0 +1,30 @@ +using System.Runtime.Serialization; +using SmartStore.Core.Domain.Media; + +namespace SmartStore.WebApi.Models.OData +{ + /// + /// Information about a media file returned by the API. + /// + [DataContract] + public partial class MediaItemInfo + { + [DataMember] + public int Id { get; set; } + + [DataMember] + public string Directory { get; set; } + + [DataMember] + public string Path { get; set; } + + [DataMember] + public string Url { get; set; } + + [DataMember] + public string ThumbUrl { get; set; } + + [DataMember] + public MediaFile File { get; set; } + } +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 3944793f73..dd50975ed1 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -273,6 +273,7 @@ + diff --git a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs index 4a1bed9ab8..1513a824d6 100644 --- a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs +++ b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs @@ -18,9 +18,9 @@ using SmartStore.Core.Domain.Stores; using SmartStore.Core.Domain.Tax; using SmartStore.Core.Plugins; -using SmartStore.Services.Media; using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.Configuration; +using SmartStore.WebApi.Models.OData; using SmartStore.WebApi.Services; using SmartStore.WebApi.Services.Swagger; using Swashbuckle.Application; @@ -53,7 +53,7 @@ public void Configure(WebApiConfigurationBroadcaster configData) m.EntitySet("Manufacturers"); m.EntitySet("MeasureDimensions"); m.EntitySet("MeasureWeights"); - m.EntitySet("Media"); + m.EntitySet("Media"); m.EntitySet("MediaTags"); m.EntitySet("MediaTracks"); m.EntitySet("NewsLetterSubscriptions"); From ff0eacb58d7479001747743e5fb6326e90c734dd Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Thu, 13 Aug 2020 01:57:21 +0200 Subject: [PATCH 038/695] Theming: nicer modal anim --- .../SmartStore.Web/Content/shared/_modal.scss | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Presentation/SmartStore.Web/Content/shared/_modal.scss b/src/Presentation/SmartStore.Web/Content/shared/_modal.scss index b144fe7617..dadd8fc2b4 100644 --- a/src/Presentation/SmartStore.Web/Content/shared/_modal.scss +++ b/src/Presentation/SmartStore.Web/Content/shared/_modal.scss @@ -2,10 +2,15 @@ /// /// +/* $modal-transition-duration: 0.4s; //$modal-transition-timing: cubic-bezier(0.25, 0.46, 0.45, 0.94); // easeOutQuad $modal-transition-timing: cubic-bezier(0.165, 0.84, 0.44, 1); // easeOutQuart //$modal-transition-timing: cubic-bezier(0.19, 1, 0.22, 1); // easeOutExpo +*/ + +$modal-transition-duration: 0.25s; +$modal-transition-timing: ease-out; // FLEX MODAL @@ -29,12 +34,12 @@ $modal-transition-timing: cubic-bezier(0.165, 0.84, 0.44, 1); // easeOutQuart transition-property: opacity, transform; transition-duration: $modal-transition-duration; transition-timing-function: $modal-transition-timing; - transform: scale(1.1, 1.1); + transform: translate(0, 30px) scale(0.95, 0.95); will-change: transform, opacity; } &.show .modal-dialog { - transform: scale(1, 1); + transform: translate(0, 0) scale(1, 1); opacity: 1; } } From f947bf39670fd7abe4eb3dcbbe96c061027f118d Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Thu, 13 Aug 2020 11:41:11 +0200 Subject: [PATCH 039/695] Currencies with duplicate ISO code should be displayed in the currency list --- .../Administration/Controllers/CurrencyController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Presentation/SmartStore.Web/Administration/Controllers/CurrencyController.cs b/src/Presentation/SmartStore.Web/Administration/Controllers/CurrencyController.cs index 8cdedb42c2..d1cadb01a6 100644 --- a/src/Presentation/SmartStore.Web/Administration/Controllers/CurrencyController.cs +++ b/src/Presentation/SmartStore.Web/Administration/Controllers/CurrencyController.cs @@ -175,10 +175,10 @@ public ActionResult Index() public ActionResult List(bool liveRates = false) { var language = _services.WorkContext.WorkingLanguage; - var allCurrencies = _currencyService.GetAllCurrencies(true) - .ToDictionarySafe(x => x.CurrencyCode.EmptyNull().ToUpper(), x => x); + var allCurrencies = _currencyService.GetAllCurrencies(true); + var allCurrenciesByIsoCode = allCurrencies.ToDictionarySafe(x => x.CurrencyCode.EmptyNull().ToUpper(), x => x); - var models = allCurrencies.Select(x => CreateCurrencyListModel(x.Value)).ToList(); + var models = allCurrencies.Select(x => CreateCurrencyListModel(x)).ToList(); if (liveRates) { @@ -193,7 +193,7 @@ public ActionResult List(bool liveRates = false) var rates = _currencyService.GetCurrencyLiveRates(primaryExchangeCurrency.CurrencyCode); // get localized name of currencies - var currencyNames = allCurrencies.ToDictionarySafe( + var currencyNames = allCurrenciesByIsoCode.ToDictionarySafe( x => x.Key, x => x.Value.GetLocalized(y => y.Name, language, true, false).Value ); @@ -214,7 +214,7 @@ public ActionResult List(bool liveRates = false) // provide rate with currency name and whether it is available in store rates.Each(x => { - x.IsStoreCurrency = allCurrencies.ContainsKey(x.CurrencyCode); + x.IsStoreCurrency = allCurrenciesByIsoCode.ContainsKey(x.CurrencyCode); if (x.Name.IsEmpty() && currencyNames.ContainsKey(x.CurrencyCode)) x.Name = currencyNames[x.CurrencyCode]; From 77a21793c0fd45fa4546d81eb87ae349e3a32251 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Thu, 13 Aug 2020 16:37:00 +0200 Subject: [PATCH 040/695] API: IMediaService endpoints (in progress) --- .../Media/Search/MediaSearchQuery.cs | 26 ++- .../SmartStore.Services.csproj | 1 + .../Controllers/OData/MediaController.cs | 173 +++++++----------- .../Extensions/MiscExtensions.cs | 6 +- .../Models/OData/Media/CheckUniqueFileName.cs | 14 ++ .../SmartStore.WebApi.csproj | 1 + .../Extensions/ApiControllerExtensions.cs | 3 + 7 files changed, 108 insertions(+), 116 deletions(-) create mode 100644 src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileName.cs diff --git a/src/Libraries/SmartStore.Services/Media/Search/MediaSearchQuery.cs b/src/Libraries/SmartStore.Services/Media/Search/MediaSearchQuery.cs index 124ccd8523..3fceaf4ddd 100644 --- a/src/Libraries/SmartStore.Services/Media/Search/MediaSearchQuery.cs +++ b/src/Libraries/SmartStore.Services/Media/Search/MediaSearchQuery.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Runtime.Serialization; using Newtonsoft.Json; using SmartStore.Core.Domain.Media; @@ -16,58 +12,76 @@ public enum ImageDimension Large = 3, VeryLarge = 4 } - + + [DataContract] public partial class MediaFilesFilter { + [DataMember] [JsonProperty("mediaTypes")] public string[] MediaTypes { get; set; } + [DataMember] [JsonProperty("mimeTypes")] public string[] MimeTypes { get; set; } + [DataMember] [JsonProperty("extensions")] public string[] Extensions { get; set; } + [DataMember] [JsonProperty("dimensions")] public ImageDimension[] Dimensions { get; set; } + [DataMember] [JsonProperty("tags")] public int[] Tags { get; set; } + [DataMember] [JsonProperty("hidden")] public bool? Hidden { get; set; } + [DataMember] [JsonProperty("deleted")] public bool? Deleted { get; set; } + [DataMember] [JsonProperty("term")] public string Term { get; set; } + [DataMember] [JsonProperty("exact")] public bool ExactMatch { get; set; } + [DataMember] [JsonProperty("includeAlt")] public bool IncludeAltForTerm { get; set; } } + [DataContract] public partial class MediaSearchQuery : MediaFilesFilter { + [DataMember] [JsonProperty("folderId")] public int? FolderId { get; set; } + [DataMember] [JsonProperty("deep")] public bool DeepSearch { get; set; } + [DataMember] [JsonProperty("page")] public int PageIndex { get; set; } + [DataMember] [JsonProperty("pageSize")] public int PageSize { get; set; } = int.MaxValue; + [DataMember] [JsonProperty("sortBy")] public string SortBy { get; set; } = nameof(MediaFile.Id); + [DataMember] [JsonProperty("sortDesc")] public bool SortDesc { get; set; } } diff --git a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj index 82e77a9138..74f9a23db0 100644 --- a/src/Libraries/SmartStore.Services/SmartStore.Services.csproj +++ b/src/Libraries/SmartStore.Services/SmartStore.Services.csproj @@ -142,6 +142,7 @@ True + diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 902e396705..65990afd7c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -1,17 +1,14 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; -using System.Web.OData.Query; using SmartStore.ComponentModel; using SmartStore.Core.Domain.Media; using SmartStore.Services.Media; using SmartStore.Web.Framework.WebApi; -using SmartStore.Web.Framework.WebApi.Caching; using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.Web.Framework.WebApi.OData; using SmartStore.Web.Framework.WebApi.Security; @@ -22,6 +19,10 @@ namespace SmartStore.WebApi.Controllers.OData /// /// Is intended to make methods of the IMediaService accessible. Direct access to the MediaFile entity is not intended. /// + /// + /// Functions like GET /Media/FileExists(Path='content/my-file.jpg') would never work (404). + /// That's why some endpoints are implemented as Actions (POST). + /// public class MediaController : WebApiEntityController { // GET /Media(123) @@ -105,16 +106,6 @@ public static void Init(WebApiConfigurationBroadcaster configData) { var entityConfig = configData.ModelBuilder.EntityType(); - entityConfig.Collection - .Function("FileExists") - .Returns() - .Parameter("Path"); - - entityConfig.Collection - .Action("CheckUniqueFileName") - .ReturnsFromEntitySet("Media") - .Parameter("Path"); - entityConfig.Collection .Action("GetFileByPath") .ReturnsFromEntitySet("Media") @@ -127,75 +118,40 @@ public static void Init(WebApiConfigurationBroadcaster configData) //getFileByName.Parameter("FolderId"); entityConfig.Collection - .Action("GetFilesByIds") + .Function("GetFilesByIds") .ReturnsFromEntitySet("Media") .CollectionParameter("Ids"); - var countFiles = entityConfig.Collection - .Action("CountFiles") - .ReturnsFromEntitySet("Media"); - countFiles.Parameter("FolderId"); - countFiles.Parameter("DeepSearch"); - countFiles.Parameter("Hidden"); - countFiles.Parameter("Deleted"); - countFiles.Parameter("Term"); - countFiles.Parameter("ExactMatch"); - countFiles.CollectionParameter("MediaTypes"); - countFiles.CollectionParameter("MimeTypes"); - countFiles.CollectionParameter("Extensions"); - } - - /// GET /Media/FileExists(Path='content/my-file.jpg') - [HttpGet, WebApiAuthenticate] - public bool FileExists([FromODataUri] string path) - { - var fileExists = Service.FileExists(path); - return fileExists; - } - - /// POST /Media/CheckUniqueFileName {"Path":"content/my-file.jpg"} - [HttpPost, WebApiAuthenticate] - public HttpResponseMessage CheckUniqueFileName(ODataActionParameters parameters) - { - string newPath = null; - - this.ProcessEntity(() => - { - var path = parameters.GetValueSafe("Path"); - - if (!Service.CheckUniqueFileName(path, out newPath)) - { - // Just to make sure the result is unmistakable ;-) - newPath = null; - } - }); + entityConfig.Collection + .Action("FileExists") + .Returns() + .Parameter("Path"); - if (newPath == null) - { - return Request.CreateResponse(HttpStatusCode.NoContent); - } + entityConfig.Collection + .Action("CheckUniqueFileName") + .Returns() + .Parameter("Path"); - return Request.CreateResponse(HttpStatusCode.OK, newPath); + entityConfig.Collection + .Action("CountFiles") + .Returns() + .Parameter("Query"); } /// POST /Media/GetFileByPath {"Path":"content/my-file.jpg"} - [HttpPost, WebApiAuthenticate] - public MediaFileInfo GetFileByPath(ODataActionParameters parameters) + [HttpPost] + [WebApiAuthenticate] + public MediaItemInfo GetFileByPath(ODataActionParameters parameters) { - MediaFileInfo file = null; + var path = parameters.GetValueSafe("Path"); + var file = Service.GetFileByPath(path); - this.ProcessEntity(() => + if (file == null) { - var path = parameters.GetValueSafe("Path"); - - file = Service.GetFileByPath(path); - if (file == null) - { - throw Request.NotFoundException($"The file with the path '{path ?? string.Empty}' does not exist."); - } - }); + throw Request.NotFoundException($"The file with the path '{path ?? string.Empty}' does not exist."); + } - return file; + return Convert(file); } // POST /Media/GetFileByName {"FolderId":2, "FileName":"my-file.jpg"} @@ -219,49 +175,52 @@ public MediaFileInfo GetFileByPath(ODataActionParameters parameters) // return file; //} - /// POST /Media/GetFilesByIds {"Ids":[1,2,3]} - [HttpPost, WebApiAuthenticate] - [WebApiQueryable] - public IQueryable GetFilesByIds(ODataActionParameters parameters) + /// GET /Media/GetFilesByIds(Ids=[1,2,3]) + [HttpGet, WebApiQueryable] + [WebApiAuthenticate] + public IQueryable GetFilesByIds([FromODataUri] int[] ids) { - IList files = null; - - this.ProcessEntity(() => + if (ids?.Any() ?? false) { - var ids = parameters.GetValueSafe>("Ids"); - if (ids?.Any() ?? false) - { - files = Service.GetFilesByIds(ids.ToArray()); - } - }); - - return (files ?? new List()).AsQueryable(); + var files = Service.GetFilesByIds(ids.ToArray()); + + return files.Select(x => Convert(x)).AsQueryable(); + } + + return new List().AsQueryable(); } - /// POST /Media/CountFiles {"FolderId":7, "Term":"xyz", "Extensions":["jpg"], ...} - [HttpPost, WebApiAuthenticate] - public async Task CountFiles(ODataActionParameters parameters) + /// POST /Media/FileExists {"Path":"content/my-file.jpg"} + [HttpPost] + [WebApiAuthenticate] + public bool FileExists(ODataActionParameters parameters) { - var count = 0; + var path = parameters.GetValueSafe("Path"); + var fileExists = Service.FileExists(path); + return fileExists; + } - await this.ProcessEntityAsync(async () => - { - var query = new MediaSearchQuery - { - FolderId = parameters.GetValueSafe("FolderId"), - DeepSearch = parameters.GetValueSafe("DeepSearch") ?? false, - Hidden = parameters.GetValueSafe("Hidden") ?? false, - Deleted = parameters.GetValueSafe("Deleted") ?? false, - Term = parameters.GetValueSafe("Term"), - ExactMatch = parameters.GetValueSafe("ExactMatch") ?? false, - MediaTypes = parameters.GetValueSafe>("MediaTypes")?.ToArray(), - MimeTypes = parameters.GetValueSafe>("MimeTypes")?.ToArray(), - Extensions = parameters.GetValueSafe>("Extensions")?.ToArray() - }; - - count = await Service.CountFilesAsync(query); - }); + /// POST /Media/CheckUniqueFileName {"Path":"content/my-file.jpg"} + [HttpPost] + [WebApiAuthenticate] + public CheckUniqueFileName CheckUniqueFileName(ODataActionParameters parameters) + { + var result = new CheckUniqueFileName(); + var path = parameters.GetValueSafe("Path"); + + result.Result = Service.CheckUniqueFileName(path, out string newPath); + result.NewPath = newPath; + + return result; + } + /// POST /Media/CountFiles {"Query":{"FolderId":7,"Extensions":["jpg"], ...}} + [HttpPost] + [WebApiAuthenticate] + public async Task CountFiles(ODataActionParameters parameters) + { + var query = parameters.GetValueSafe("Query"); + var count = await Service.CountFilesAsync(query ?? new MediaSearchQuery()); return count; } diff --git a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs index d4ef779249..926e9bed83 100644 --- a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs +++ b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs @@ -54,14 +54,14 @@ public static string ToUnquoted(this string value) return value; } - public static T GetValueSafe(this ODataActionParameters parameters, string key) + public static T GetValueSafe(this ODataActionParameters parameters, string key, T defaultValue = default) { if (parameters != null && key.HasValue() && parameters.TryGetValue(key, out var value)) { - return value.Convert(); + return value.Convert(defaultValue); } - return default; + return defaultValue; } public static void DeleteLocalFiles(this MultipartFormDataStreamProvider provider) diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileName.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileName.cs new file mode 100644 index 0000000000..9225d61697 --- /dev/null +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileName.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace SmartStore.WebApi.Models.OData +{ + [DataContract] + public partial class CheckUniqueFileName + { + [DataMember] + public bool Result { get; set; } + + [DataMember] + public string NewPath { get; set; } + } +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index dd50975ed1..5159b3193f 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -273,6 +273,7 @@ + diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs index a48d6ed651..a5a55ad3f6 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs @@ -64,6 +64,9 @@ public static async Task ProcessEntityAsync(this ApiController apiController, Fu /// /// Gets a query string value from API request URL. /// + /// + /// Query string values are not part of the EDM and therefore do not appear in any auto generated documentation etc. + /// /// Value type. /// API controller. /// Name of the query string value. From 8ca1cab5470b4fc97aa957dbf3d1011ac93451e1 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Thu, 13 Aug 2020 21:37:55 +0200 Subject: [PATCH 041/695] API: IMediaService endpoints (in progress) --- .../Controllers/OData/MediaController.cs | 53 +++++++++++++++++-- ...leName.cs => CheckUniqueFileNameResult.cs} | 2 +- .../OData/Media/CountFilesGroupedResult.cs | 41 ++++++++++++++ .../SmartStore.WebApi.csproj | 3 +- 4 files changed, 93 insertions(+), 6 deletions(-) rename src/Plugins/SmartStore.WebApi/Models/OData/Media/{CheckUniqueFileName.cs => CheckUniqueFileNameResult.cs} (82%) create mode 100644 src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 65990afd7c..bb617e30bb 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Net; using System.Net.Http; @@ -129,13 +130,28 @@ public static void Init(WebApiConfigurationBroadcaster configData) entityConfig.Collection .Action("CheckUniqueFileName") - .Returns() + .Returns() .Parameter("Path"); entityConfig.Collection .Action("CountFiles") .Returns() .Parameter("Query"); + + entityConfig.Collection + .Action("CountFilesGrouped") + .Returns() + .Parameter("Filter"); + + // Crap: + //var cfgr = configData.ModelBuilder.ComplexType(); + //cfgr.Property(x => x.Total); + //cfgr.Property(x => x.Trash); + //cfgr.Property(x => x.Unassigned); + //cfgr.Property(x => x.Transient); + //cfgr.Property(x => x.Orphan); + //cfgr.ComplexProperty(x => x.Filter); + //cfgr.HasDynamicProperties(x => x.Folders); } /// POST /Media/GetFileByPath {"Path":"content/my-file.jpg"} @@ -203,9 +219,9 @@ public bool FileExists(ODataActionParameters parameters) /// POST /Media/CheckUniqueFileName {"Path":"content/my-file.jpg"} [HttpPost] [WebApiAuthenticate] - public CheckUniqueFileName CheckUniqueFileName(ODataActionParameters parameters) + public CheckUniqueFileNameResult CheckUniqueFileName(ODataActionParameters parameters) { - var result = new CheckUniqueFileName(); + var result = new CheckUniqueFileNameResult(); var path = parameters.GetValueSafe("Path"); result.Result = Service.CheckUniqueFileName(path, out string newPath); @@ -224,13 +240,42 @@ public async Task CountFiles(ODataActionParameters parameters) return count; } + /// POST /Media/CountFilesGrouped {"Filter":{"Term":"my image","Extensions":["jpg"], ...}} + [HttpPost] + [WebApiAuthenticate] + public CountFilesGroupedResult CountFilesGrouped(ODataActionParameters parameters) + { + var query = parameters.GetValueSafe("Filter"); + var res = Service.CountFilesGrouped(query ?? new MediaFilesFilter()); + + var result = new CountFilesGroupedResult + { + Total = res.Total, + Trash = res.Trash, + Unassigned = res.Unassigned, + Transient = res.Unassigned, + Orphan = res.Orphan, + Filter = res.Filter + }; + + result.Folders = res.Folders + .Select(x => new CountFilesGroupedResult.FolderCount + { + FolderId = x.Key, + Count = x.Value + }) + .ToList(); + + return result; + } + #endregion #region Utilities private MediaItemInfo Convert(MediaFileInfo file) { - var item = MiniMapper.Map(file); + var item = MiniMapper.Map(file, CultureInfo.InvariantCulture); return item; } diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileName.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileNameResult.cs similarity index 82% rename from src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileName.cs rename to src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileNameResult.cs index 9225d61697..70aeecc34d 100644 --- a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileName.cs +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileNameResult.cs @@ -3,7 +3,7 @@ namespace SmartStore.WebApi.Models.OData { [DataContract] - public partial class CheckUniqueFileName + public partial class CheckUniqueFileNameResult { [DataMember] public bool Result { get; set; } diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs new file mode 100644 index 0000000000..6c1513940c --- /dev/null +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using System.Runtime.Serialization; +using SmartStore.Services.Media; + +namespace SmartStore.WebApi.Models.OData +{ + [DataContract] + public partial class CountFilesGroupedResult + { + [DataMember] + public MediaFilesFilter Filter { get; set; } + + [DataMember] + public int Total { get; set; } + + [DataMember] + public int Trash { get; set; } + + [DataMember] + public int Unassigned { get; set; } + + [DataMember] + public int Transient { get; set; } + + [DataMember] + public int Orphan { get; set; } + + [DataMember] + public ICollection Folders { get; set; } + + [DataContract] + public class FolderCount + { + [DataMember] + public int FolderId { get; set; } + + [DataMember] + public int Count { get; set; } + } + } +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 5159b3193f..6082742ad5 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -273,7 +273,8 @@ - + + From 55ec4576a37f2c8959ceb3ad926316c38b85ecc2 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Fri, 14 Aug 2020 16:42:49 +0200 Subject: [PATCH 042/695] API: IMediaService endpoints (in progress) --- .../Controllers/OData/MediaController.cs | 316 ++++++++++++++---- .../OData/Media/CheckUniqueFileNameResult.cs | 2 +- .../OData/Media/CountFilesGroupedResult.cs | 2 +- .../{MediaItemInfo.cs => FileItemInfo.cs} | 6 +- .../Models/OData/Media/FolderItemInfo.cs | 23 ++ .../SmartStore.WebApi.csproj | 3 +- .../WebApiConfigurationProvider.cs | 4 +- .../Extensions/ApiControllerExtensions.cs | 3 +- 8 files changed, 289 insertions(+), 70 deletions(-) rename src/Plugins/SmartStore.WebApi/Models/OData/Media/{MediaItemInfo.cs => FileItemInfo.cs} (79%) create mode 100644 src/Plugins/SmartStore.WebApi/Models/OData/Media/FolderItemInfo.cs diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index bb617e30bb..7deccb978b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Net; @@ -8,12 +9,13 @@ using System.Web.OData; using SmartStore.ComponentModel; using SmartStore.Core.Domain.Media; +using SmartStore.Core.Security; using SmartStore.Services.Media; using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.Web.Framework.WebApi.OData; using SmartStore.Web.Framework.WebApi.Security; -using SmartStore.WebApi.Models.OData; +using SmartStore.WebApi.Models.OData.Media; namespace SmartStore.WebApi.Controllers.OData { @@ -26,12 +28,14 @@ namespace SmartStore.WebApi.Controllers.OData /// public class MediaController : WebApiEntityController { + public static MediaLoadFlags _defaultLoadFlags = MediaLoadFlags.AsNoTracking | MediaLoadFlags.WithTags | MediaLoadFlags.WithTracks | MediaLoadFlags.WithFolder; + // GET /Media(123) [WebApiQueryable] [WebApiAuthenticate] - public SingleResult Get(int key) + public SingleResult Get(int key) { - var file = Service.GetFileById(key); + var file = Service.GetFileById(key, _defaultLoadFlags); if (file == null) { throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); @@ -43,7 +47,7 @@ public SingleResult Get(int key) // GET /Media [WebApiQueryable] [WebApiAuthenticate] - public IQueryable Get(/*ODataQueryOptions queryOptions*/) + public IQueryable Get(/*ODataQueryOptions queryOptions*/) { throw new HttpResponseException(HttpStatusCode.NotImplemented); @@ -62,23 +66,35 @@ public IQueryable Get(/*ODataQueryOptions queryOptions [WebApiAuthenticate] public HttpResponseMessage GetProperty(int key, string propertyName) { - var file = Service.GetFileById(key); - if (file == null) + Type propertyType = null; + object propertyValue = null; + + this.ProcessEntity(() => { - throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - } + var file = Service.GetFileById(key); + if (file == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } - var item = Convert(file); + var item = Convert(file); - var prop = FastProperty.GetProperty(item.GetType(), propertyName); - if (prop == null) + var prop = FastProperty.GetProperty(item.GetType(), propertyName); + if (prop == null) + { + throw Request.BadRequestException(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName.EmptyNull())); + } + + propertyType = prop.Property.PropertyType; + propertyValue = prop.GetValue(item); + }); + + if (propertyType == null) { - throw Request.BadRequestException(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName.EmptyNull())); + return Request.CreateResponse(HttpStatusCode.NoContent); } - var propertyValue = prop.GetValue(item); - - return Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); + return Request.CreateResponse(HttpStatusCode.OK, propertyType, propertyValue); } public IHttpActionResult Post(MediaFile entity) @@ -96,31 +112,50 @@ public IHttpActionResult Patch(int key, Delta model) throw new HttpResponseException(HttpStatusCode.Forbidden); } + [WebApiAuthenticate(Permission = Permissions.Media.Delete)] public IHttpActionResult Delete(int key) { - throw new HttpResponseException(HttpStatusCode.Forbidden); + this.ProcessEntity(() => + { + var file = Service.GetFileById(key); + if (file == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } + + // Get options from query string. + // FromODataUri (404) and FromBody ("Can't bind multiple parameters") are not possible here. + var permanent = this.GetQueryStringValue("permanent", false); + var force = this.GetQueryStringValue("force", false); + + Service.DeleteFile(file.File, permanent, force); + }); + + return StatusCode(HttpStatusCode.NoContent); } #region Actions and functions public static void Init(WebApiConfigurationBroadcaster configData) { - var entityConfig = configData.ModelBuilder.EntityType(); + var entityConfig = configData.ModelBuilder.EntityType(); + + #region Files entityConfig.Collection .Action("GetFileByPath") - .ReturnsFromEntitySet("Media") + .ReturnsFromEntitySet("Media") .Parameter("Path"); //var getFileByName = entityConfig.Collection // .Action("GetFileByName") - // .ReturnsFromEntitySet("Media"); + // .ReturnsFromEntitySet("Media"); //getFileByName.Parameter("FileName"); //getFileByName.Parameter("FolderId"); entityConfig.Collection .Function("GetFilesByIds") - .ReturnsFromEntitySet("Media") + .ReturnsFromEntitySet("Media") .CollectionParameter("Ids"); entityConfig.Collection @@ -143,7 +178,7 @@ public static void Init(WebApiConfigurationBroadcaster configData) .Returns() .Parameter("Filter"); - // Crap: + // Doesn't work: //var cfgr = configData.ModelBuilder.ComplexType(); //cfgr.Property(x => x.Total); //cfgr.Property(x => x.Trash); @@ -152,22 +187,61 @@ public static void Init(WebApiConfigurationBroadcaster configData) //cfgr.Property(x => x.Orphan); //cfgr.ComplexProperty(x => x.Filter); //cfgr.HasDynamicProperties(x => x.Folders); + + var moveFile = entityConfig + .Action("MoveFile") + .ReturnsFromEntitySet("Media"); + + moveFile.Parameter("DestinationFileName"); + var dph1 = moveFile.Parameter("DuplicateFileHandling"); + dph1.OptionalParameter = true; + + var copyFile = entityConfig + .Action("CopyFile") + .ReturnsFromEntitySet("Media"); + + copyFile.Parameter("DestinationFileName"); + var dph2 = copyFile.Parameter("DuplicateFileHandling"); + dph2.OptionalParameter = true; + + #endregion + + #region Folders + + entityConfig.Collection + .Action("FolderExists") + .Returns() + .Parameter("Path"); + + entityConfig.Collection + .Action("CreateFolder") + .Returns() + .Parameter("Path"); + + #endregion } /// POST /Media/GetFileByPath {"Path":"content/my-file.jpg"} [HttpPost] [WebApiAuthenticate] - public MediaItemInfo GetFileByPath(ODataActionParameters parameters) + public FileItemInfo GetFileByPath(ODataActionParameters parameters) { - var path = parameters.GetValueSafe("Path"); - var file = Service.GetFileByPath(path); + FileItemInfo file = null; - if (file == null) + this.ProcessEntity(() => { - throw Request.NotFoundException($"The file with the path '{path ?? string.Empty}' does not exist."); - } + var path = parameters.GetValueSafe("Path"); + var mediaFile = Service.GetFileByPath(path, _defaultLoadFlags); + + if (mediaFile == null) + { + throw Request.NotFoundException($"The file with the path '{path ?? string.Empty}' does not exist."); + } - return Convert(file); + file = Convert(mediaFile); + }); + + return file; } // POST /Media/GetFileByName {"FolderId":2, "FileName":"my-file.jpg"} @@ -194,16 +268,21 @@ public MediaItemInfo GetFileByPath(ODataActionParameters parameters) /// GET /Media/GetFilesByIds(Ids=[1,2,3]) [HttpGet, WebApiQueryable] [WebApiAuthenticate] - public IQueryable GetFilesByIds([FromODataUri] int[] ids) + public IQueryable GetFilesByIds([FromODataUri] int[] ids) { - if (ids?.Any() ?? false) - { - var files = Service.GetFilesByIds(ids.ToArray()); + IQueryable files = null; - return files.Select(x => Convert(x)).AsQueryable(); - } + this.ProcessEntity(() => + { + if (ids?.Any() ?? false) + { + var mediaFiles = Service.GetFilesByIds(ids.ToArray(), _defaultLoadFlags); + + files = mediaFiles.Select(x => Convert(x)).AsQueryable(); + } + }); - return new List().AsQueryable(); + return files ?? new List().AsQueryable(); } /// POST /Media/FileExists {"Path":"content/my-file.jpg"} @@ -211,8 +290,14 @@ public IQueryable GetFilesByIds([FromODataUri] int[] ids) [WebApiAuthenticate] public bool FileExists(ODataActionParameters parameters) { - var path = parameters.GetValueSafe("Path"); - var fileExists = Service.FileExists(path); + var fileExists = false; + + this.ProcessEntity(() => + { + var path = parameters.GetValueSafe("Path"); + fileExists = Service.FileExists(path); + }); + return fileExists; } @@ -222,10 +307,14 @@ public bool FileExists(ODataActionParameters parameters) public CheckUniqueFileNameResult CheckUniqueFileName(ODataActionParameters parameters) { var result = new CheckUniqueFileNameResult(); - var path = parameters.GetValueSafe("Path"); - result.Result = Service.CheckUniqueFileName(path, out string newPath); - result.NewPath = newPath; + this.ProcessEntity(() => + { + var path = parameters.GetValueSafe("Path"); + + result.Result = Service.CheckUniqueFileName(path, out string newPath); + result.NewPath = newPath; + }); return result; } @@ -235,8 +324,14 @@ public CheckUniqueFileNameResult CheckUniqueFileName(ODataActionParameters param [WebApiAuthenticate] public async Task CountFiles(ODataActionParameters parameters) { - var query = parameters.GetValueSafe("Query"); - var count = await Service.CountFilesAsync(query ?? new MediaSearchQuery()); + var count = 0; + + await this.ProcessEntityAsync(async () => + { + var query = parameters.GetValueSafe("Query"); + count = await Service.CountFilesAsync(query ?? new MediaSearchQuery()); + }); + return count; } @@ -245,37 +340,134 @@ public async Task CountFiles(ODataActionParameters parameters) [WebApiAuthenticate] public CountFilesGroupedResult CountFilesGrouped(ODataActionParameters parameters) { - var query = parameters.GetValueSafe("Filter"); - var res = Service.CountFilesGrouped(query ?? new MediaFilesFilter()); + CountFilesGroupedResult result = null; - var result = new CountFilesGroupedResult + this.ProcessEntity(() => { - Total = res.Total, - Trash = res.Trash, - Unassigned = res.Unassigned, - Transient = res.Unassigned, - Orphan = res.Orphan, - Filter = res.Filter - }; - - result.Folders = res.Folders - .Select(x => new CountFilesGroupedResult.FolderCount + var query = parameters.GetValueSafe("Filter"); + var res = Service.CountFilesGrouped(query ?? new MediaFilesFilter()); + + result = new CountFilesGroupedResult { - FolderId = x.Key, - Count = x.Value - }) - .ToList(); + Total = res.Total, + Trash = res.Trash, + Unassigned = res.Unassigned, + Transient = res.Unassigned, + Orphan = res.Orphan, + Filter = res.Filter + }; + + result.Folders = res.Folders + .Select(x => new CountFilesGroupedResult.FolderCount + { + FolderId = x.Key, + Count = x.Value + }) + .ToList(); + }); return result; } + /// POST /Media(123)/MoveFile {"DestinationFileName":"content/updated-file-name.jpg"} + [HttpPost] + [WebApiAuthenticate(Permission = Permissions.Media.Update)] + public FileItemInfo MoveFile(int key, ODataActionParameters parameters) + { + FileItemInfo movedFile = null; + + this.ProcessEntity(() => + { + var file = Service.GetFileById(key); + if (file == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } + + var destinationFileName = parameters.GetValueSafe("DestinationFileName"); + var duplicateFileHandling = parameters.GetValueSafe("DuplicateFileHandling", DuplicateFileHandling.ThrowError); + + var result = Service.MoveFile(file.File, destinationFileName, duplicateFileHandling); + movedFile = Convert(result); + }); + + return movedFile; + } + + /// POST /Media(123)/CopyFile {"DestinationFileName":"content/new-file.jpg"} + [HttpPost] + [WebApiAuthenticate(Permission = Permissions.Media.Update)] + public FileItemInfo CopyFile(int key, ODataActionParameters parameters) + { + FileItemInfo fileCopy = null; + + this.ProcessEntity(() => + { + var file = Service.GetFileById(key); + if (file == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } + + var destinationFileName = parameters.GetValueSafe("DestinationFileName"); + var duplicateFileHandling = parameters.GetValueSafe("DuplicateFileHandling", DuplicateFileHandling.ThrowError); + + var result = Service.CopyFile(file, destinationFileName, duplicateFileHandling); + fileCopy = Convert(result.DestinationFile); + }); + + return fileCopy; + } + + + /// POST /Media/FolderExists {"Path":"my-folder"} + [HttpPost] + [WebApiAuthenticate] + public bool FolderExists(ODataActionParameters parameters) + { + var folderExists = false; + + this.ProcessEntity(() => + { + var path = parameters.GetValueSafe("Path"); + folderExists = Service.FolderExists(path); + }); + + return folderExists; + } + + /// POST /Media/CreateFolder {"Path":"content/my-folder"} + [HttpPost] + [WebApiAuthenticate] + public HttpResponseMessage CreateFolder(ODataActionParameters parameters) + { + FolderItemInfo newFolder = null; + + this.ProcessEntity(() => + { + var path = parameters.GetValueSafe("Path"); + + var result = Service.CreateFolder(path); + newFolder = Convert(result); + }); + + return Request.CreateResponse(HttpStatusCode.Created, newFolder); + } + + #endregion #region Utilities - private MediaItemInfo Convert(MediaFileInfo file) + private FileItemInfo Convert(MediaFileInfo file) + { + var item = MiniMapper.Map(file, CultureInfo.InvariantCulture); + return item; + } + + private FolderItemInfo Convert(MediaFolderInfo folder) { - var item = MiniMapper.Map(file, CultureInfo.InvariantCulture); + var item = MiniMapper.Map(folder, CultureInfo.InvariantCulture); return item; } diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileNameResult.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileNameResult.cs index 70aeecc34d..18e07f1c5d 100644 --- a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileNameResult.cs +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CheckUniqueFileNameResult.cs @@ -1,6 +1,6 @@ using System.Runtime.Serialization; -namespace SmartStore.WebApi.Models.OData +namespace SmartStore.WebApi.Models.OData.Media { [DataContract] public partial class CheckUniqueFileNameResult diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs index 6c1513940c..32ff884a91 100644 --- a/src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/CountFilesGroupedResult.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; using SmartStore.Services.Media; -namespace SmartStore.WebApi.Models.OData +namespace SmartStore.WebApi.Models.OData.Media { [DataContract] public partial class CountFilesGroupedResult diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/MediaItemInfo.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/FileItemInfo.cs similarity index 79% rename from src/Plugins/SmartStore.WebApi/Models/OData/Media/MediaItemInfo.cs rename to src/Plugins/SmartStore.WebApi/Models/OData/Media/FileItemInfo.cs index f8bf9c2436..36b44220b2 100644 --- a/src/Plugins/SmartStore.WebApi/Models/OData/Media/MediaItemInfo.cs +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/FileItemInfo.cs @@ -1,13 +1,13 @@ using System.Runtime.Serialization; using SmartStore.Core.Domain.Media; -namespace SmartStore.WebApi.Models.OData +namespace SmartStore.WebApi.Models.OData.Media { /// - /// Information about a media file returned by the API. + /// File information returned by the API. /// [DataContract] - public partial class MediaItemInfo + public partial class FileItemInfo { [DataMember] public int Id { get; set; } diff --git a/src/Plugins/SmartStore.WebApi/Models/OData/Media/FolderItemInfo.cs b/src/Plugins/SmartStore.WebApi/Models/OData/Media/FolderItemInfo.cs new file mode 100644 index 0000000000..f4cc186806 --- /dev/null +++ b/src/Plugins/SmartStore.WebApi/Models/OData/Media/FolderItemInfo.cs @@ -0,0 +1,23 @@ +using System.Runtime.Serialization; + +namespace SmartStore.WebApi.Models.OData.Media +{ + /// + /// Folder information returned by the API. + /// + [DataContract] + public partial class FolderItemInfo + { + [DataMember] + public int Id { get; set; } + + [DataMember] + public int FilesCount { get; set; } + + [DataMember] + public string Path { get; set; } + + [DataMember] + public string Name { get; set; } + } +} \ No newline at end of file diff --git a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj index 6082742ad5..aed3840b04 100644 --- a/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj +++ b/src/Plugins/SmartStore.WebApi/SmartStore.WebApi.csproj @@ -275,7 +275,8 @@ - + + diff --git a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs index 1513a824d6..2ac5d019cc 100644 --- a/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs +++ b/src/Plugins/SmartStore.WebApi/WebApiConfigurationProvider.cs @@ -21,6 +21,7 @@ using SmartStore.Web.Framework.WebApi; using SmartStore.Web.Framework.WebApi.Configuration; using SmartStore.WebApi.Models.OData; +using SmartStore.WebApi.Models.OData.Media; using SmartStore.WebApi.Services; using SmartStore.WebApi.Services.Swagger; using Swashbuckle.Application; @@ -53,7 +54,8 @@ public void Configure(WebApiConfigurationBroadcaster configData) m.EntitySet("Manufacturers"); m.EntitySet("MeasureDimensions"); m.EntitySet("MeasureWeights"); - m.EntitySet("Media"); + m.EntitySet("Media"); + m.EntitySet("MediaFolders"); m.EntitySet("MediaTags"); m.EntitySet("MediaTracks"); m.EntitySet("NewsLetterSubscriptions"); diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs index a5a55ad3f6..c83fd118cd 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs @@ -16,7 +16,8 @@ public static HttpResponseException InvalidModelStateException(this ApiControlle } /// - /// Further entity processing typically used by OData actions. + /// Further entity processing typically used by OData actions. + /// It is mainly used where a 422 status code is more suitable than a 500. /// /// Action for entity processing. public static void ProcessEntity(this ApiController apiController, Action process) From 295bfcc9e952cc4396c6643f7afd0c571a5722dc Mon Sep 17 00:00:00 2001 From: Marcel Schmidt Date: Fri, 14 Aug 2020 22:42:59 +0200 Subject: [PATCH 043/695] Removed System.ValueTuple from config dependencies --- src/Libraries/SmartStore.Core/app.config | 4 ---- src/Libraries/SmartStore.Data/app.config | 4 ---- src/Libraries/SmartStore.Services/app.config | 4 ---- src/Plugins/SmartStore.AmazonPay/web.config | 4 ---- src/Plugins/SmartStore.Clickatell/web.config | 4 ---- src/Plugins/SmartStore.DevTools/Web.config | 4 ---- src/Plugins/SmartStore.FacebookAuth/web.config | 4 ---- src/Plugins/SmartStore.GoogleAnalytics/web.config | 4 ---- src/Plugins/SmartStore.GoogleMerchantCenter/web.config | 4 ---- src/Plugins/SmartStore.OfflinePayment/web.config | 4 ---- src/Plugins/SmartStore.PayPal/web.config | 4 ---- src/Plugins/SmartStore.Shipping/web.config | 4 ---- src/Plugins/SmartStore.ShippingByWeight/web.config | 4 ---- src/Plugins/SmartStore.Tax/web.config | 4 ---- src/Plugins/SmartStore.WebApi/web.config | 4 ---- src/Presentation/SmartStore.Web.Framework/app.config | 4 ---- src/Presentation/SmartStore.Web/Administration/Web.config | 4 ---- src/Presentation/SmartStore.Web/Web.config | 4 ---- src/Tests/SmartStore.Core.Tests/App.config | 4 ---- src/Tests/SmartStore.Data.Tests/App.config | 4 ---- src/Tests/SmartStore.Services.Tests/App.config | 4 ---- src/Tests/SmartStore.Tests/App.config | 4 ---- src/Tests/SmartStore.Web.MVC.Tests/App.config | 4 ---- src/Tools/SmartStore.Packager/App.config | 4 ---- 24 files changed, 96 deletions(-) diff --git a/src/Libraries/SmartStore.Core/app.config b/src/Libraries/SmartStore.Core/app.config index aa1f38f1f9..9657a5deb1 100644 --- a/src/Libraries/SmartStore.Core/app.config +++ b/src/Libraries/SmartStore.Core/app.config @@ -10,10 +10,6 @@ - - - - diff --git a/src/Libraries/SmartStore.Data/app.config b/src/Libraries/SmartStore.Data/app.config index 76beb2a152..68a1994474 100644 --- a/src/Libraries/SmartStore.Data/app.config +++ b/src/Libraries/SmartStore.Data/app.config @@ -10,10 +10,6 @@ - - - - diff --git a/src/Libraries/SmartStore.Services/app.config b/src/Libraries/SmartStore.Services/app.config index f0beaa056a..252642d5ed 100644 --- a/src/Libraries/SmartStore.Services/app.config +++ b/src/Libraries/SmartStore.Services/app.config @@ -28,10 +28,6 @@ - - - - diff --git a/src/Plugins/SmartStore.AmazonPay/web.config b/src/Plugins/SmartStore.AmazonPay/web.config index f340aff88f..a6a989fbf9 100644 --- a/src/Plugins/SmartStore.AmazonPay/web.config +++ b/src/Plugins/SmartStore.AmazonPay/web.config @@ -128,10 +128,6 @@ - - - - diff --git a/src/Plugins/SmartStore.Clickatell/web.config b/src/Plugins/SmartStore.Clickatell/web.config index e15d8a0902..680acd42a7 100644 --- a/src/Plugins/SmartStore.Clickatell/web.config +++ b/src/Plugins/SmartStore.Clickatell/web.config @@ -113,10 +113,6 @@ - - - - diff --git a/src/Plugins/SmartStore.DevTools/Web.config b/src/Plugins/SmartStore.DevTools/Web.config index 9bfec8954e..8e4b28cf47 100644 --- a/src/Plugins/SmartStore.DevTools/Web.config +++ b/src/Plugins/SmartStore.DevTools/Web.config @@ -121,10 +121,6 @@ - - - - diff --git a/src/Plugins/SmartStore.FacebookAuth/web.config b/src/Plugins/SmartStore.FacebookAuth/web.config index 69adedf4ac..8707925158 100644 --- a/src/Plugins/SmartStore.FacebookAuth/web.config +++ b/src/Plugins/SmartStore.FacebookAuth/web.config @@ -121,10 +121,6 @@ - - - - diff --git a/src/Plugins/SmartStore.GoogleAnalytics/web.config b/src/Plugins/SmartStore.GoogleAnalytics/web.config index a1041ef9b0..4553edefdf 100644 --- a/src/Plugins/SmartStore.GoogleAnalytics/web.config +++ b/src/Plugins/SmartStore.GoogleAnalytics/web.config @@ -112,10 +112,6 @@ - - - - diff --git a/src/Plugins/SmartStore.GoogleMerchantCenter/web.config b/src/Plugins/SmartStore.GoogleMerchantCenter/web.config index e15d8a0902..680acd42a7 100644 --- a/src/Plugins/SmartStore.GoogleMerchantCenter/web.config +++ b/src/Plugins/SmartStore.GoogleMerchantCenter/web.config @@ -113,10 +113,6 @@ - - - - diff --git a/src/Plugins/SmartStore.OfflinePayment/web.config b/src/Plugins/SmartStore.OfflinePayment/web.config index e15d8a0902..680acd42a7 100644 --- a/src/Plugins/SmartStore.OfflinePayment/web.config +++ b/src/Plugins/SmartStore.OfflinePayment/web.config @@ -113,10 +113,6 @@ - - - - diff --git a/src/Plugins/SmartStore.PayPal/web.config b/src/Plugins/SmartStore.PayPal/web.config index 5e67769af4..4d2ad21466 100644 --- a/src/Plugins/SmartStore.PayPal/web.config +++ b/src/Plugins/SmartStore.PayPal/web.config @@ -141,10 +141,6 @@ - - - - diff --git a/src/Plugins/SmartStore.Shipping/web.config b/src/Plugins/SmartStore.Shipping/web.config index a1041ef9b0..4553edefdf 100644 --- a/src/Plugins/SmartStore.Shipping/web.config +++ b/src/Plugins/SmartStore.Shipping/web.config @@ -112,10 +112,6 @@ - - - - diff --git a/src/Plugins/SmartStore.ShippingByWeight/web.config b/src/Plugins/SmartStore.ShippingByWeight/web.config index a1041ef9b0..4553edefdf 100644 --- a/src/Plugins/SmartStore.ShippingByWeight/web.config +++ b/src/Plugins/SmartStore.ShippingByWeight/web.config @@ -112,10 +112,6 @@ - - - - diff --git a/src/Plugins/SmartStore.Tax/web.config b/src/Plugins/SmartStore.Tax/web.config index e15d8a0902..680acd42a7 100644 --- a/src/Plugins/SmartStore.Tax/web.config +++ b/src/Plugins/SmartStore.Tax/web.config @@ -113,10 +113,6 @@ - - - - diff --git a/src/Plugins/SmartStore.WebApi/web.config b/src/Plugins/SmartStore.WebApi/web.config index 40c8794565..4da7697a52 100644 --- a/src/Plugins/SmartStore.WebApi/web.config +++ b/src/Plugins/SmartStore.WebApi/web.config @@ -77,10 +77,6 @@ - - - - diff --git a/src/Presentation/SmartStore.Web.Framework/app.config b/src/Presentation/SmartStore.Web.Framework/app.config index 6268c5997d..c6e7e5837b 100644 --- a/src/Presentation/SmartStore.Web.Framework/app.config +++ b/src/Presentation/SmartStore.Web.Framework/app.config @@ -58,10 +58,6 @@ - - - - diff --git a/src/Presentation/SmartStore.Web/Administration/Web.config b/src/Presentation/SmartStore.Web/Administration/Web.config index 7bfcddf208..dc2d6af869 100644 --- a/src/Presentation/SmartStore.Web/Administration/Web.config +++ b/src/Presentation/SmartStore.Web/Administration/Web.config @@ -109,10 +109,6 @@ - - - - diff --git a/src/Presentation/SmartStore.Web/Web.config b/src/Presentation/SmartStore.Web/Web.config index cb83d5a972..11ba51c4bd 100644 --- a/src/Presentation/SmartStore.Web/Web.config +++ b/src/Presentation/SmartStore.Web/Web.config @@ -348,10 +348,6 @@ - - - - diff --git a/src/Tests/SmartStore.Core.Tests/App.config b/src/Tests/SmartStore.Core.Tests/App.config index a1bf925b24..0b185292d0 100644 --- a/src/Tests/SmartStore.Core.Tests/App.config +++ b/src/Tests/SmartStore.Core.Tests/App.config @@ -22,10 +22,6 @@ - - - - diff --git a/src/Tests/SmartStore.Data.Tests/App.config b/src/Tests/SmartStore.Data.Tests/App.config index e0aaca7600..8134880ec5 100644 --- a/src/Tests/SmartStore.Data.Tests/App.config +++ b/src/Tests/SmartStore.Data.Tests/App.config @@ -26,10 +26,6 @@ - - - - diff --git a/src/Tests/SmartStore.Services.Tests/App.config b/src/Tests/SmartStore.Services.Tests/App.config index c39dc1a0f3..660f40f4ef 100644 --- a/src/Tests/SmartStore.Services.Tests/App.config +++ b/src/Tests/SmartStore.Services.Tests/App.config @@ -36,10 +36,6 @@ - - - - diff --git a/src/Tests/SmartStore.Tests/App.config b/src/Tests/SmartStore.Tests/App.config index e1c69410e5..aee5982c7e 100644 --- a/src/Tests/SmartStore.Tests/App.config +++ b/src/Tests/SmartStore.Tests/App.config @@ -13,10 +13,6 @@ - - - - diff --git a/src/Tests/SmartStore.Web.MVC.Tests/App.config b/src/Tests/SmartStore.Web.MVC.Tests/App.config index 21fa8e95a1..461ef28a18 100644 --- a/src/Tests/SmartStore.Web.MVC.Tests/App.config +++ b/src/Tests/SmartStore.Web.MVC.Tests/App.config @@ -81,10 +81,6 @@ - - - - diff --git a/src/Tools/SmartStore.Packager/App.config b/src/Tools/SmartStore.Packager/App.config index 7a1de6a456..13fbad55c2 100644 --- a/src/Tools/SmartStore.Packager/App.config +++ b/src/Tools/SmartStore.Packager/App.config @@ -28,10 +28,6 @@ - - - - From bc74031ce7adb5176781d2a9abacb95458a420c8 Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 14 Aug 2020 22:08:39 +0200 Subject: [PATCH 044/695] Theming: nicer switch control --- .../Content/shared/_switch.scss | 58 +++++++------------ 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/src/Presentation/SmartStore.Web/Content/shared/_switch.scss b/src/Presentation/SmartStore.Web/Content/shared/_switch.scss index 6effadaeb9..2465b799de 100644 --- a/src/Presentation/SmartStore.Web/Content/shared/_switch.scss +++ b/src/Presentation/SmartStore.Web/Content/shared/_switch.scss @@ -8,8 +8,8 @@ .switch { $h: $font-size-base * $line-height-base; $h-sm: $font-size-sm * $line-height-sm; - $w: $h * 2.15; - $w-sm: $h-sm * 2.15; + $w: $h * 2; + $w-sm: $h-sm * 2; position: relative; display: inline-block; vertical-align: bottom; @@ -21,9 +21,14 @@ --switcher-w: #{$w}; --switcher-h: #{$h}; --switch-size: calc(var(--switcher-h) - 4px); + --switch-bg-rgb: #{red($orange)}, #{green($orange)}, #{blue($orange)}; width: var(--switcher-w); height: var(--switcher-h); + &.switch-blue { + --switch-bg-rgb: #{red($blue)}, #{green($blue)}, #{blue($blue)}; + } + .switcher-sm > & { --switcher-w: #{$w-sm}; --switcher-h: #{$h-sm}; @@ -39,72 +44,49 @@ background-color: $gray-200; border: 1px solid rgba(#000, 0.15); cursor: pointer; - transition: background-color 0.4s cubic-bezier(.54,1.85,.5,1); + transition: background-color 0.2s cubic-bezier(.54,1.85,.5,1), box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out; &:before { // The circle (off) position: absolute; - left: 1px; - top: 1px; + left: 2px; + top: 2px; content: ' '; - width: var(--switch-size); - height: var(--switch-size); + width: calc(var(--switch-size) - 2px); + height: calc(var(--switch-size) - 2px); border-radius: 50%; background-color: #fff; box-shadow: 0 0 3px rgba(#000, 0.2); - transition: left 0.4s cubic-bezier(.54,1.85,.5,1); - } - - &:after { - // The label (off) - position: absolute; - display: inline-block; - left: var(--switch-size); - top: 1px; - right: 1px; - bottom: 1px; - line-height: calc(var(--switcher-h) - 0.4em); - vertical-align: middle; - text-align: center; - text-transform: lowercase; - content: attr(data-off); - color: $gray-500; + transition: left 0.2s cubic-bezier(.54,1.85,.5,1); } } > input[type=checkbox] { position: absolute; - z-index: 0; + z-index: -1; opacity: 0; margin: 0; } > input[type=checkbox]:checked ~ .switch-toggle { - background-color: $orange; + background-color: rgba(var(--switch-bg-rgb), 1); + border-color: rgba(var(--switch-bg-rgb), 1); &:before { // The circle (on) - left: 26px; left: calc(var(--switcher-w) - var(--switch-size) - 2px); } - - &:after { - // The label (on) - content: attr(data-on); - color: rgba(#fff, 0.75); - left: 1px; - right: var(--switch-size); - } } - &.switch-blue > input[type=checkbox]:checked ~ .switch-toggle { - background-color: $blue; + > input[type=checkbox]:focus ~ .switch-toggle { + box-shadow: 0 0 0 0.2rem rgba(var(--switch-bg-rgb), .25); } > input[type=checkbox]:disabled ~ .switch-toggle, - input[type=checkbox][readonly] ~ .switch-toggle { + > input[type=checkbox][readonly] ~ .switch-toggle { opacity: $btn-disabled-opacity; cursor: default; border-color: transparent; + box-shadow: none !important; } } \ No newline at end of file From 44e6e922e71b2cf552c23445ca0d0d991f03348c Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Fri, 14 Aug 2020 22:51:00 +0200 Subject: [PATCH 045/695] (mm) Resolves #2017 > Media Manager: lazy load thumbnail with a slight delay after first intersection --- .../SmartStore.Web/Scripts/smartstore.system.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Presentation/SmartStore.Web/Scripts/smartstore.system.js b/src/Presentation/SmartStore.Web/Scripts/smartstore.system.js index 41569bb774..30530fdbf5 100644 --- a/src/Presentation/SmartStore.Web/Scripts/smartstore.system.js +++ b/src/Presentation/SmartStore.Web/Scripts/smartstore.system.js @@ -129,7 +129,21 @@ window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || - window.oCancelAnimationFrame + window.oCancelAnimationFrame, + + requestIdleCallback: window.requestIdleCallback || function (cb) { + var start = Date.now(); + return setTimeout(function () { + cb({ + didTimeout: false, + timeRemaining: function () { + return Math.max(0, 50 - (Date.now() - start)); + }, + }); + }, 1); + }, + + cancelIdleCallback: window.cancelIdleCallback || function (id) { clearTimeout(id); } }); // provide main app namespace From 9b70f3933ae09a91e07b40d576e84cd73a836e93 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 17 Aug 2020 12:23:44 +0200 Subject: [PATCH 046/695] API: IMediaService endpoints (in progress) --- .../Controllers/OData/MediaController.cs | 159 +++++++++++++----- .../OData/PaymentMethodsController.cs | 5 +- .../Controllers/OData/UrlRecordsController.cs | 17 +- .../Extensions/MiscExtensions.cs | 15 ++ .../Extensions/ApiControllerExtensions.cs | 4 +- 5 files changed, 148 insertions(+), 52 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 7deccb978b..336972bc9f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -97,41 +97,27 @@ public HttpResponseMessage GetProperty(int key, string propertyName) return Request.CreateResponse(HttpStatusCode.OK, propertyType, propertyValue); } - public IHttpActionResult Post(MediaFile entity) + public IHttpActionResult Post() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } - public IHttpActionResult Put(int key, MediaFile entity) + public IHttpActionResult Put() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } - public IHttpActionResult Patch(int key, Delta model) + public IHttpActionResult Patch() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } - [WebApiAuthenticate(Permission = Permissions.Media.Delete)] - public IHttpActionResult Delete(int key) + public IHttpActionResult Delete() { - this.ProcessEntity(() => - { - var file = Service.GetFileById(key); - if (file == null) - { - throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - } - - // Get options from query string. - // FromODataUri (404) and FromBody ("Can't bind multiple parameters") are not possible here. - var permanent = this.GetQueryStringValue("permanent", false); - var force = this.GetQueryStringValue("force", false); - - Service.DeleteFile(file.File, permanent, force); - }); + // We do not allow direct entity deletion. + // There is an action method "DeleteFile" instead to trigger the corresponding service method. - return StatusCode(HttpStatusCode.NoContent); + return StatusCode(HttpStatusCode.Forbidden); } #region Actions and functions @@ -147,11 +133,11 @@ public static void Init(WebApiConfigurationBroadcaster configData) .ReturnsFromEntitySet("Media") .Parameter("Path"); - //var getFileByName = entityConfig.Collection + //entityConfig.Collection // .Action("GetFileByName") - // .ReturnsFromEntitySet("Media"); - //getFileByName.Parameter("FileName"); - //getFileByName.Parameter("FolderId"); + // .ReturnsFromEntitySet("Media") + // .AddParameter("FileName") + // .AddParameter("FolderId"); entityConfig.Collection .Function("GetFilesByIds") @@ -188,21 +174,22 @@ public static void Init(WebApiConfigurationBroadcaster configData) //cfgr.ComplexProperty(x => x.Filter); //cfgr.HasDynamicProperties(x => x.Folders); - var moveFile = entityConfig + entityConfig .Action("MoveFile") - .ReturnsFromEntitySet("Media"); - - moveFile.Parameter("DestinationFileName"); - var dph1 = moveFile.Parameter("DuplicateFileHandling"); - dph1.OptionalParameter = true; + .ReturnsFromEntitySet("Media") + .AddParameter("DestinationFileName") + .AddParameter("DuplicateFileHandling", true); - var copyFile = entityConfig + entityConfig .Action("CopyFile") - .ReturnsFromEntitySet("Media"); + .ReturnsFromEntitySet("Media") + .AddParameter("DestinationFileName") + .AddParameter("DuplicateFileHandling", true); - copyFile.Parameter("DestinationFileName"); - var dph2 = copyFile.Parameter("DuplicateFileHandling"); - dph2.OptionalParameter = true; + entityConfig + .Action("DeleteFile") + .AddParameter("Permanent") + .AddParameter("Force", true); #endregion @@ -218,6 +205,24 @@ public static void Init(WebApiConfigurationBroadcaster configData) .Returns() .Parameter("Path"); + entityConfig.Collection + .Action("MoveFolder") + .Returns() + .AddParameter("Path") + .AddParameter("DestinationPath"); + + entityConfig.Collection + .Action("CopyFolder") + .Returns() + .AddParameter("Path") + .AddParameter("DestinationPath") + .AddParameter("DuplicateEntryHandling", true); + + entityConfig.Collection + .Action("DeleteFolder") + .AddParameter("Path") + .AddParameter("FileHandling", true); + #endregion } @@ -419,6 +424,28 @@ public FileItemInfo CopyFile(int key, ODataActionParameters parameters) return fileCopy; } + /// POST /Media(123)/DeleteFile {"Permanent":false} + [HttpPost] + [WebApiAuthenticate(Permission = Permissions.Media.Delete)] + public IHttpActionResult DeleteFile(int key, ODataActionParameters parameters) + { + this.ProcessEntity(() => + { + var file = Service.GetFileById(key); + if (file == null) + { + throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + } + + var permanent = parameters.GetValueSafe("Permanent"); + var force = parameters.GetValueSafe("Force", false); + + Service.DeleteFile(file.File, permanent, force); + }); + + return StatusCode(HttpStatusCode.NoContent); + } + /// POST /Media/FolderExists {"Path":"my-folder"} [HttpPost] @@ -454,6 +481,60 @@ public HttpResponseMessage CreateFolder(ODataActionParameters parameters) return Request.CreateResponse(HttpStatusCode.Created, newFolder); } + /// POST /Media/MoveFolder {"Path":"content/my-folder", "DestinationPath":"content/my-renamed-folder"} + [HttpPost] + [WebApiAuthenticate(Permission = Permissions.Media.Update)] + public FolderItemInfo MoveFolder(ODataActionParameters parameters) + { + FolderItemInfo movedFolder = null; + + this.ProcessEntity(() => + { + var path = parameters.GetValueSafe("Path"); + var destinationPath = parameters.GetValueSafe("DestinationPath"); + + var result = Service.MoveFolder(path, destinationPath); + movedFolder = Convert(result); + }); + + return movedFolder; + } + + /// POST /Media/CopyFolder {"Path":"content/my-folder", "DestinationPath":"content/my-new-folder"} + [HttpPost] + [WebApiAuthenticate(Permission = Permissions.Media.Update)] + public FolderItemInfo CopyFolder(ODataActionParameters parameters) + { + FolderItemInfo copiedFolder = null; + + this.ProcessEntity(() => + { + var path = parameters.GetValueSafe("Path"); + var destinationPath = parameters.GetValueSafe("DestinationPath"); + var duplicateEntryHandling = parameters.GetValueSafe("DuplicateEntryHandling", DuplicateEntryHandling.Skip); + + var result = Service.CopyFolder(path, destinationPath, duplicateEntryHandling); + copiedFolder = Convert(result.Folder); + }); + + return copiedFolder; + } + + /// POST /Media/DeleteFolder {"Path":"content/my-folder"} + [HttpPost] + [WebApiAuthenticate(Permission = Permissions.Media.Delete)] + public IHttpActionResult DeleteFolder(ODataActionParameters parameters) + { + this.ProcessEntity(() => + { + var path = parameters.GetValueSafe("Path"); + var fileHandling = parameters.GetValueSafe("FileHandling", FileHandling.SoftDelete); + + Service.DeleteFolder(path, fileHandling); + }); + + return StatusCode(HttpStatusCode.NoContent); + } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs index d4a4f73082..9aeabfef18 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs @@ -57,10 +57,9 @@ public async Task Patch(int key, Delta model) return result; } - [WebApiAuthenticate] - public IHttpActionResult Delete(int key) + public IHttpActionResult Delete() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs index 4889655ac5..88a2b90ccd 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs @@ -2,7 +2,6 @@ using System.Net; using System.Net.Http; using System.Web.Http; -using System.Web.OData; using SmartStore.Core.Domain.Seo; using SmartStore.Services.Seo; using SmartStore.Web.Framework.WebApi; @@ -31,24 +30,24 @@ public HttpResponseMessage GetProperty(int key, string propertyName) return GetPropertyValue(key, propertyName); } - public IHttpActionResult Post(UrlRecord entity) + public IHttpActionResult Post() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } - public IHttpActionResult Put(int key, UrlRecord entity) + public IHttpActionResult Put() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } - public IHttpActionResult Patch(int key, Delta model) + public IHttpActionResult Patch() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } - public IHttpActionResult Delete(int key) + public IHttpActionResult Delete() { - throw new HttpResponseException(HttpStatusCode.Forbidden); + return StatusCode(HttpStatusCode.Forbidden); } } } diff --git a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs index 926e9bed83..d681fee0b7 100644 --- a/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs +++ b/src/Plugins/SmartStore.WebApi/Extensions/MiscExtensions.cs @@ -2,6 +2,7 @@ using System.Text; using System.Web.Mvc; using System.Web.OData; +using System.Web.OData.Builder; using SmartStore.Core.Infrastructure; using SmartStore.Services.Localization; using SmartStore.Utilities; @@ -75,5 +76,19 @@ public static void DeleteLocalFiles(this MultipartFormDataStreamProvider provide } catch { } } + + /// + /// Helper to improve readability. + /// + public static ActionConfiguration AddParameter( + this ActionConfiguration config, + string name, + bool optional = false) + { + var parameter = config.Parameter(name); + parameter.OptionalParameter = optional; + + return config; + } } } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs index c83fd118cd..b77bdae3a2 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/ApiControllerExtensions.cs @@ -17,7 +17,7 @@ public static HttpResponseException InvalidModelStateException(this ApiControlle /// /// Further entity processing typically used by OData actions. - /// It is mainly used where a 422 status code is more suitable than a 500. + /// Is mainly used to capture errors of the service project and in that case generate a 422 status code instead of a 500. /// /// Action for entity processing. public static void ProcessEntity(this ApiController apiController, Action process) @@ -33,10 +33,12 @@ public static void ProcessEntity(this ApiController apiController, Action proces } catch (HttpResponseException hrEx) { + // Do not catch exceptions thrown within process action. throw hrEx; } catch (Exception ex) { + // Capture exception because a 422 is more suitable. throw apiController.Request.UnprocessableEntityException(ex.Message); } } From 7a13d4b9c46a38fe49e954d1a9028a618af9ecf8 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 17 Aug 2020 16:36:30 +0200 Subject: [PATCH 047/695] API: IHttpActionResult refactoring (in progress) --- .../Controllers/OData/AddressesController.cs | 3 +- .../OData/BlogCommentsController.cs | 3 +- .../Controllers/OData/BlogPostsController.cs | 3 +- .../Controllers/OData/CategoriesController.cs | 3 +- .../Controllers/OData/CountriesController.cs | 3 +- .../Controllers/OData/CurrenciesController.cs | 3 +- .../OData/CustomerRoleMappingsController.cs | 3 +- .../OData/CustomerRolesController.cs | 3 +- .../Controllers/OData/CustomersController.cs | 19 ++++--- .../OData/DeliveryTimesController.cs | 3 +- .../Controllers/OData/DiscountsController.cs | 3 +- .../Controllers/OData/DownloadsController.cs | 3 +- .../OData/GenericAttributesController.cs | 3 +- .../Controllers/OData/LanguagesController.cs | 3 +- .../OData/LocalizedPropertiesController.cs | 3 +- .../OData/ManufacturersController.cs | 3 +- .../OData/MeasureDimensionsController.cs | 3 +- .../OData/MeasureWeightsController.cs | 3 +- .../Controllers/OData/MediaController.cs | 29 ++++++----- .../NewsLetterSubscriptionsController.cs | 3 +- .../Controllers/OData/OrderItemsController.cs | 16 +++--- .../Controllers/OData/OrderNotesController.cs | 11 ++-- .../Controllers/OData/OrdersController.cs | 21 ++++---- .../OData/PaymentMethodsController.cs | 3 +- .../ProductAttributeOptionsController.cs | 3 +- .../ProductAttributeOptionsSetsController.cs | 3 +- .../OData/ProductAttributesController.cs | 3 +- .../OData/ProductBundleItemsController.cs | 3 +- .../OData/ProductCategoriesController.cs | 2 +- .../OData/ProductManufacturersController.cs | 3 +- .../OData/ProductPicturesController.cs | 2 +- ...roductSpecificationAttributesController.cs | 2 +- ...tVariantAttributeCombinationsController.cs | 2 +- ...ProductVariantAttributeValuesController.cs | 2 +- .../ProductVariantAttributesController.cs | 2 +- .../Controllers/OData/ProductsController.cs | 51 +++++++++---------- .../OData/QuantityUnitsController.cs | 2 +- .../OData/RelatedProductsController.cs | 2 +- .../OData/ReturnRequestsController.cs | 16 +++--- .../Controllers/OData/SettingsController.cs | 3 +- .../OData/ShipmentItemsController.cs | 3 +- .../Controllers/OData/ShipmentsController.cs | 3 +- .../OData/ShippingMethodsController.cs | 3 +- ...SpecificationAttributeOptionsController.cs | 3 +- .../SpecificationAttributesController.cs | 3 +- .../OData/StateProvincesController.cs | 3 +- .../OData/StoreMappingsController.cs | 3 +- .../Controllers/OData/StoresController.cs | 3 +- .../OData/SyncMappingsController.cs | 3 +- .../OData/TaxCategoriesController.cs | 3 +- .../Controllers/OData/TierPricesController.cs | 3 +- .../Controllers/OData/UrlRecordsController.cs | 3 +- .../Services/WebApiPdfHelper.cs | 23 ++++----- .../HttpRequestMessageExtensions.cs | 13 +---- .../WebApi/WebApiEntityController.cs | 26 ++++++++-- 55 files changed, 158 insertions(+), 194 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs index abc1ce01e0..16c71e16f3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -46,7 +45,7 @@ public SingleResult
Get(int key) } [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs index 691280cc65..c03ba9d217 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -53,7 +52,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs index 1dd55e6d51..e1173408cd 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -49,7 +48,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs index a7821927c0..fc8d36d5be 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -49,7 +48,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs index 49bd885456..7999b12970 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs index a78a6c9ec5..c5d58116c2 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs index 1d89824fa0..77412247ff 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs index bace05aee0..0db2ccea75 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs @@ -1,6 +1,5 @@ using System.Linq; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -30,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index fb2d49941a..62409319c8 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -1,7 +1,6 @@ using System; using System.Linq; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -51,7 +50,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } @@ -113,7 +112,7 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public HttpResponseMessage GetAddresses(int key, int relatedKey = 0 /*addressId*/) + public IHttpActionResult GetAddresses(int key, int relatedKey = 0 /*addressId*/) { var addresses = GetRelatedCollection(key, x => x.Addresses); @@ -121,14 +120,14 @@ public HttpResponseMessage GetAddresses(int key, int relatedKey = 0 /*addressId* { var address = addresses.FirstOrDefault(x => x.Id == relatedKey); - return Request.CreateResponseForEntity(address, relatedKey); + return Response(address); } - return Request.CreateResponseForEntity(addresses, key); + return Response(addresses); } [WebApiAuthenticate(Permission = Permissions.Customer.EditAddress)] - public HttpResponseMessage PostAddresses(int key, int relatedKey /*addressId*/) + public IHttpActionResult PostAddresses(int key, int relatedKey /*addressId*/) { var entity = GetExpandedEntity(key, x => x.Addresses); var address = entity.Addresses.FirstOrDefault(x => x.Id == relatedKey); @@ -145,14 +144,14 @@ public HttpResponseMessage PostAddresses(int key, int relatedKey /*addressId*/) entity.Addresses.Add(address); Service.UpdateCustomer(entity); - return Request.CreateResponse(HttpStatusCode.Created, address); + return Response(HttpStatusCode.Created, address); } - return Request.CreateResponse(HttpStatusCode.OK, address); + return Ok(address); } [WebApiAuthenticate(Permission = Permissions.Customer.EditAddress)] - public HttpResponseMessage DeleteAddresses(int key, int relatedKey = 0 /*addressId*/) + public IHttpActionResult DeleteAddresses(int key, int relatedKey = 0 /*addressId*/) { var entity = GetExpandedEntity(key, x => x.Addresses); @@ -175,7 +174,7 @@ public HttpResponseMessage DeleteAddresses(int key, int relatedKey = 0 /*address } } - return Request.CreateResponse(HttpStatusCode.NoContent); + return StatusCode(HttpStatusCode.NoContent); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs index a9bd1a19b9..f8112b64e1 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs index df4efe9c77..9c3f6cca40 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -30,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs index 856f5a462f..9606478fff 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs index 9a073846b7..fe6a8b360b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -26,7 +25,7 @@ public SingleResult Get(int key) return GetSingleResult(key); } - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs index ec58bc0c56..490929b96e 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs index dc8f046299..1ac2d14600 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -26,7 +25,7 @@ public SingleResult Get(int key) return GetSingleResult(key); } - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs index c89c03e7a9..429571eaed 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -49,7 +48,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs index 5e1ff6dc6f..c17ba0d475 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs index 9d5c27d0d3..fc3f1cb770 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 336972bc9f..32a6cef635 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -33,23 +33,23 @@ public class MediaController : WebApiEntityController // GET /Media(123) [WebApiQueryable] [WebApiAuthenticate] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { var file = Service.GetFileById(key, _defaultLoadFlags); if (file == null) { - throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + return NotFound(); } - return SingleResult.Create(new[] { Convert(file) }.AsQueryable()); + return Ok(Convert(file)); } // GET /Media [WebApiQueryable] [WebApiAuthenticate] - public IQueryable Get(/*ODataQueryOptions queryOptions*/) + public IHttpActionResult Get(/*ODataQueryOptions queryOptions*/) { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); // TODO or not TODO :) //var maxTop = WebApiCachingControllingData.Data().MaxTop; @@ -64,7 +64,7 @@ public IQueryable Get(/*ODataQueryOptions queryOptions* // GET /Media(123)/ThumbUrl [WebApiAuthenticate] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { Type propertyType = null; object propertyValue = null; @@ -91,10 +91,11 @@ public HttpResponseMessage GetProperty(int key, string propertyName) if (propertyType == null) { - return Request.CreateResponse(HttpStatusCode.NoContent); + return StatusCode(HttpStatusCode.NoContent); } - return Request.CreateResponse(HttpStatusCode.OK, propertyType, propertyValue); + var response = Request.CreateResponse(HttpStatusCode.OK, propertyType, propertyValue); + return ResponseMessage(response); } public IHttpActionResult Post() @@ -466,7 +467,7 @@ public bool FolderExists(ODataActionParameters parameters) /// POST /Media/CreateFolder {"Path":"content/my-folder"} [HttpPost] [WebApiAuthenticate] - public HttpResponseMessage CreateFolder(ODataActionParameters parameters) + public IHttpActionResult CreateFolder(ODataActionParameters parameters) { FolderItemInfo newFolder = null; @@ -478,13 +479,13 @@ public HttpResponseMessage CreateFolder(ODataActionParameters parameters) newFolder = Convert(result); }); - return Request.CreateResponse(HttpStatusCode.Created, newFolder); + return Response(HttpStatusCode.Created, newFolder); } /// POST /Media/MoveFolder {"Path":"content/my-folder", "DestinationPath":"content/my-renamed-folder"} [HttpPost] [WebApiAuthenticate(Permission = Permissions.Media.Update)] - public FolderItemInfo MoveFolder(ODataActionParameters parameters) + public IHttpActionResult MoveFolder(ODataActionParameters parameters) { FolderItemInfo movedFolder = null; @@ -497,13 +498,13 @@ public FolderItemInfo MoveFolder(ODataActionParameters parameters) movedFolder = Convert(result); }); - return movedFolder; + return Ok(movedFolder); } /// POST /Media/CopyFolder {"Path":"content/my-folder", "DestinationPath":"content/my-new-folder"} [HttpPost] [WebApiAuthenticate(Permission = Permissions.Media.Update)] - public FolderItemInfo CopyFolder(ODataActionParameters parameters) + public IHttpActionResult CopyFolder(ODataActionParameters parameters) { FolderItemInfo copiedFolder = null; @@ -517,7 +518,7 @@ public FolderItemInfo CopyFolder(ODataActionParameters parameters) copiedFolder = Convert(result.Folder); }); - return copiedFolder; + return Ok(copiedFolder); } /// POST /Media/DeleteFolder {"Path":"content/my-folder"} diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs index 7ca5fb06f5..928714003b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs index 80487b446e..886983b473 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs @@ -1,9 +1,7 @@ using System.Linq; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; -using System.Web.OData; using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; @@ -43,27 +41,27 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] - public IHttpActionResult Post(OrderItem entity) + public IHttpActionResult Post() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] - public IHttpActionResult Put(int key, OrderItem entity) + public IHttpActionResult Put() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] - public IHttpActionResult Patch(int key, Delta model) + public IHttpActionResult Patch() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.EditItem)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs index aa7bf8296a..d1d4622a4c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs @@ -1,6 +1,5 @@ using System.Linq; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -30,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } @@ -58,15 +57,15 @@ public IHttpActionResult Post(OrderNote entity) } [WebApiAuthenticate(Permission = Permissions.Order.Update)] - public IHttpActionResult Put(int key, OrderNote entity) + public IHttpActionResult Put() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.Update)] - public IHttpActionResult Patch(int key, Delta model) + public IHttpActionResult Patch() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.Update)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index 32c0f3dca7..783565ea76 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -58,7 +58,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } @@ -198,20 +198,21 @@ public OrderInfo Infos(int key) [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public HttpResponseMessage Pdf(int key) + public IHttpActionResult Pdf(int key) { - byte[] pdfData = new byte[0]; - var result = GetSingleResult(key); - var order = GetExpandedEntity(key, result, "OrderItems, OrderItems.Product"); + HttpResponseMessage response = null; this.ProcessEntity(() => { - pdfData = _apiPdfHelper.Value.OrderToPdf(order); - }); + var result = GetSingleResult(key); + var order = GetExpandedEntity(key, result, "OrderItems, OrderItems.Product"); + var pdfData = _apiPdfHelper.Value.OrderToPdf(order); - var fileName = Services.Localization.GetResource("Order.PdfInvoiceFileName").FormatInvariant(order.Id); - var response = _apiPdfHelper.Value.CreateResponse(Request, pdfData, fileName); - return response; + var fileName = Services.Localization.GetResource("Order.PdfInvoiceFileName").FormatInvariant(order.Id); + response = _apiPdfHelper.Value.CreateResponse(Request, pdfData, fileName); + }); + + return ResponseMessage(response); } [HttpPost] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs index 9aeabfef18..d63d4ca8cc 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs @@ -1,6 +1,5 @@ using System.Linq; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -30,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs index 7a91ca362c..d788f8101a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs index 55c54bb588..5d6608f62d 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs index 60295fcb38..f419ed79dd 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs index 58631b8fb0..da9e110077 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs index 8a691b80ef..7082d3605a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs @@ -29,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs index 60a4ef3c0f..b03fd1b404 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs index 07597a77c7..d303edb6cf 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs @@ -30,7 +30,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs index 39eb2c9548..31770ab910 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs @@ -29,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs index ce2709fb5b..316aae1e7d 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs @@ -30,7 +30,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs index c103c54d51..2148125f16 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs @@ -29,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs index b404129266..f244e031c3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs @@ -29,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index 086417d141..754db80f4e 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.Http.ModelBinding; @@ -78,7 +77,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } @@ -171,7 +170,7 @@ public SingleResult GetSampleDownload(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProductCategories(int key, int relatedKey = 0 /*categoryId*/) + public IHttpActionResult GetProductCategories(int key, int relatedKey = 0 /*categoryId*/) { var productCategories = _categoryService.Value.GetProductCategoriesByProductId(key, true); @@ -179,14 +178,14 @@ public HttpResponseMessage GetProductCategories(int key, int relatedKey = 0 /*ca { var productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey); - return Request.CreateResponseForEntity(productCategory, relatedKey); + return Response(productCategory); } - return Request.CreateResponseForEntity(productCategories, key); + return Response(productCategories); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] - public HttpResponseMessage PostProductCategories(int key, int relatedKey /*categoryId*/) + public IHttpActionResult PostProductCategories(int key, int relatedKey /*categoryId*/) { var productCategories = _categoryService.Value.GetProductCategoriesByProductId(key, true); var productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey); @@ -199,14 +198,14 @@ public HttpResponseMessage PostProductCategories(int key, int relatedKey /*categ _categoryService.Value.InsertProductCategory(productCategory); - return Request.CreateResponse(HttpStatusCode.Created, productCategory); + return Response(HttpStatusCode.Created, productCategory); } - return Request.CreateResponse(HttpStatusCode.OK, productCategory); + return Ok(productCategory); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] - public HttpResponseMessage DeleteProductCategories(int key, int relatedKey = 0 /*categoryId*/) + public IHttpActionResult DeleteProductCategories(int key, int relatedKey = 0 /*categoryId*/) { var productCategories = _categoryService.Value.GetProductCategoriesByProductId(key, true); @@ -223,13 +222,13 @@ public HttpResponseMessage DeleteProductCategories(int key, int relatedKey = 0 / } } - return Request.CreateResponse(HttpStatusCode.NoContent); + return StatusCode(HttpStatusCode.NoContent); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProductManufacturers(int key, int relatedKey = 0 /*manufacturerId*/) + public IHttpActionResult GetProductManufacturers(int key, int relatedKey = 0 /*manufacturerId*/) { var productManufacturers = _manufacturerService.Value.GetProductManufacturersByProductId(key, true); @@ -237,14 +236,14 @@ public HttpResponseMessage GetProductManufacturers(int key, int relatedKey = 0 / { var productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey); - return Request.CreateResponseForEntity(productManufacturer, relatedKey); + return Response(productManufacturer); } - return Request.CreateResponseForEntity(productManufacturers, key); + return Response(productManufacturers); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] - public HttpResponseMessage PostProductManufacturers(int key, int relatedKey /*manufacturerId*/) + public IHttpActionResult PostProductManufacturers(int key, int relatedKey /*manufacturerId*/) { var productManufacturers = _manufacturerService.Value.GetProductManufacturersByProductId(key, true); var productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey); @@ -257,14 +256,14 @@ public HttpResponseMessage PostProductManufacturers(int key, int relatedKey /*ma _manufacturerService.Value.InsertProductManufacturer(productManufacturer); - return Request.CreateResponse(HttpStatusCode.Created, productManufacturer); + return Response(HttpStatusCode.Created, productManufacturer); } - return Request.CreateResponse(HttpStatusCode.OK, productManufacturer); + return Ok(productManufacturer); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] - public HttpResponseMessage DeleteProductManufacturers(int key, int relatedKey = 0 /*manufacturerId*/) + public IHttpActionResult DeleteProductManufacturers(int key, int relatedKey = 0 /*manufacturerId*/) { var productManufacturers = _manufacturerService.Value.GetProductManufacturersByProductId(key, true); @@ -281,13 +280,13 @@ public HttpResponseMessage DeleteProductManufacturers(int key, int relatedKey = } } - return Request.CreateResponse(HttpStatusCode.NoContent); + return StatusCode(HttpStatusCode.NoContent); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProductPictures(int key, int relatedKey = 0 /*mediaFileId*/) + public IHttpActionResult GetProductPictures(int key, int relatedKey = 0 /*mediaFileId*/) { var productPictures = Service.GetProductPicturesByProductId(key); @@ -295,14 +294,14 @@ public HttpResponseMessage GetProductPictures(int key, int relatedKey = 0 /*medi { var productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey); - return Request.CreateResponseForEntity(productPicture, relatedKey); + return Response(productPicture); } - return Request.CreateResponseForEntity(productPictures, key); + return Response(productPictures); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] - public HttpResponseMessage PostProductPictures(int key, int relatedKey /*mediaFileId*/) + public IHttpActionResult PostProductPictures(int key, int relatedKey /*mediaFileId*/) { var productPictures = Service.GetProductPicturesByProductId(key); var productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey); @@ -315,14 +314,14 @@ public HttpResponseMessage PostProductPictures(int key, int relatedKey /*mediaFi Service.InsertProductPicture(productPicture); - return Request.CreateResponse(HttpStatusCode.Created, productPicture); + return Response(HttpStatusCode.Created, productPicture); } - return Request.CreateResponse(HttpStatusCode.OK, productPicture); + return Ok(productPicture); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] - public HttpResponseMessage DeleteProductPictures(int key, int relatedKey = 0 /*mediaFileId*/) + public IHttpActionResult DeleteProductPictures(int key, int relatedKey = 0 /*mediaFileId*/) { var productPictures = Service.GetProductPicturesByProductId(key); @@ -339,7 +338,7 @@ public HttpResponseMessage DeleteProductPictures(int key, int relatedKey = 0 /*m } } - return Request.CreateResponse(HttpStatusCode.NoContent); + return StatusCode(HttpStatusCode.NoContent); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs index 03a19c0a7c..59492e7be0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs @@ -29,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs index 7785aed816..d8ef5ea122 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs @@ -29,7 +29,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs index 56a34ae9c5..1d4952e033 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs @@ -1,9 +1,7 @@ using System.Linq; using System.Net; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; -using System.Web.OData; using SmartStore.Core.Domain.Customers; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; @@ -31,27 +29,27 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } [WebApiAuthenticate(Permission = Permissions.Customer.Create)] - public IHttpActionResult Post(ReturnRequest entity) + public IHttpActionResult Post() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Customer.Update)] - public IHttpActionResult Put(int key, ReturnRequest entity) + public IHttpActionResult Put() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Customer.Update)] - public IHttpActionResult Patch(int key, Delta model) + public IHttpActionResult Patch() { - throw new HttpResponseException(HttpStatusCode.NotImplemented); + return StatusCode(HttpStatusCode.NotImplemented); } [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Delete)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs index 1136d56b84..2ec972f8a6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs index a5da584fef..b03d489044 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs index 7faead5cdb..fb026bf595 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs index b172febdec..420ee08f72 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs index 01b82d5a21..46006338c8 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs index b8c4a4c6b6..05d93ee00d 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs index 7da8f87f11..ab549637bb 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs index c61016b7af..008d943315 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -26,7 +25,7 @@ public SingleResult Get(int key) return GetSingleResult(key); } - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs index 64570cabad..33d549474a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs index 969f45ba9f..ad6421e8d6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -26,7 +25,7 @@ public SingleResult Get(int key) return GetSingleResult(key); } - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs index 5add9b60c4..1628e69309 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs index 9bc0ab575f..c70310cf24 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -29,7 +28,7 @@ public SingleResult Get(int key) } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs index 88a2b90ccd..b161e526f7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs @@ -1,6 +1,5 @@ using System.Linq; using System.Net; -using System.Net.Http; using System.Web.Http; using SmartStore.Core.Domain.Seo; using SmartStore.Services.Seo; @@ -25,7 +24,7 @@ public SingleResult Get(int key) return GetSingleResult(key); } - public HttpResponseMessage GetProperty(int key, string propertyName) + public IHttpActionResult GetProperty(int key, string propertyName) { return GetPropertyValue(key, propertyName); } diff --git a/src/Plugins/SmartStore.WebApi/Services/WebApiPdfHelper.cs b/src/Plugins/SmartStore.WebApi/Services/WebApiPdfHelper.cs index a82c074505..b05089b6e0 100644 --- a/src/Plugins/SmartStore.WebApi/Services/WebApiPdfHelper.cs +++ b/src/Plugins/SmartStore.WebApi/Services/WebApiPdfHelper.cs @@ -3,7 +3,6 @@ using System.Net; using System.Net.Http; using System.Net.Http.Headers; -using System.Text.RegularExpressions; using System.Web; using System.Web.Mvc; using System.Web.Routing; @@ -52,17 +51,17 @@ private ControllerContext CreateControllerContext() return controllerContext; } - private string Render(ControllerContext controllerContext, RazorView view, object model) - { - //http://forums.asp.net/t/1888849.aspx?Render+PartialView+without+ControllerContext - //https://weblog.west-wind.com/posts/2012/May/30/Rendering-ASPNET-MVC-Views-to-String - - using (var writer = new StringWriter()) - { - view.Render(new ViewContext(controllerContext, view, new ViewDataDictionary(model), new TempDataDictionary(), writer), writer); - return writer.ToString(); - } - } + //private string Render(ControllerContext controllerContext, RazorView view, object model) + //{ + // //http://forums.asp.net/t/1888849.aspx?Render+PartialView+without+ControllerContext + // //https://weblog.west-wind.com/posts/2012/May/30/Rendering-ASPNET-MVC-Views-to-String + + // using (var writer = new StringWriter()) + // { + // view.Render(new ViewContext(controllerContext, view, new ViewDataDictionary(model), new TempDataDictionary(), writer), writer); + // return writer.ToString(); + // } + //} public byte[] OrderToPdf(Order order) { diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs index 9467caa675..a3bf233a2d 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/Extensions/HttpRequestMessageExtensions.cs @@ -18,22 +18,12 @@ private static MethodInfo InitCreateResponse() return (expr.Body as MethodCallExpression).Method.GetGenericMethodDefinition(); } - /// https://gist.github.com/raghuramn/5084608 + /// public static HttpResponseMessage CreateResponse(this HttpRequestMessage request, HttpStatusCode status, Type type, object value) { return _createResponse.MakeGenericMethod(type).Invoke(null, new[] { request, status, value }) as HttpResponseMessage; } - public static HttpResponseMessage CreateResponseForEntity(this HttpRequestMessage request, object entity, int key) - { - if (entity == null) - { - return request.CreateResponse(HttpStatusCode.NotFound, WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); - } - - return request.CreateResponse(HttpStatusCode.OK, entity.GetType(), entity); - } - public static HttpResponseException BadRequestException(this HttpRequestMessage request, string message) { return new HttpResponseException(request.CreateErrorResponse(HttpStatusCode.BadRequest, message)); @@ -53,6 +43,5 @@ public static HttpResponseException InternalServerErrorException(this HttpReques { return new HttpResponseException(request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex)); } - } } diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index f18661dbe8..bb298a4db8 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -8,6 +8,7 @@ using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; +using System.Web.Http.Results; using System.Web.OData; using System.Web.OData.Formatter; using Autofac; @@ -201,23 +202,40 @@ protected internal virtual SingleResult GetRelatedEntity( return SingleResult.Create(query); } - protected internal virtual HttpResponseMessage GetPropertyValue(int key, string propertyName) + protected internal virtual IHttpActionResult GetPropertyValue(int key, string propertyName) { var entity = GetEntitySet().FirstOrDefault(x => x.Id == key); if (entity == null) { - throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); + return NotFound(); } var prop = FastProperty.GetProperty(entity.GetType(), propertyName); if (prop == null) { - throw Request.BadRequestException(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName.EmptyNull())); + return BadRequest(WebApiGlobal.Error.PropertyNotFound.FormatInvariant(propertyName.EmptyNull())); } var propertyValue = prop.GetValue(entity); - return Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); + var response = Request.CreateResponse(HttpStatusCode.OK, prop.Property.PropertyType, propertyValue); + return ResponseMessage(response); + } + + protected internal virtual IHttpActionResult Response(HttpStatusCode status, T value) + { + var response = Request.CreateResponse(status, value); + return ResponseMessage(response); + } + + protected internal virtual IHttpActionResult Response(T entity) + { + if (entity == null) + { + return NotFound(); + } + + return Ok(entity); } protected internal virtual IHttpActionResult Insert(TEntity entity, Action insert) From 8340675678d9c801f83c47e5e01d8b540651ec33 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Mon, 17 Aug 2020 18:05:52 +0200 Subject: [PATCH 048/695] API: fixes missing entity id in location header when inserting order notes --- .../Controllers/OData/OrderNotesController.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs index d1d4622a4c..6d37eef5f6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs @@ -1,8 +1,8 @@ -using System.Linq; +using System; +using System.Linq; using System.Net; using System.Threading.Tasks; using System.Web.Http; -using System.Web.OData; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; using SmartStore.Services.Orders; @@ -44,8 +44,15 @@ public IHttpActionResult Post(OrderNote entity) { throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(entity.OrderId)); } + if (entity.Note.IsEmpty()) + { + throw Request.BadRequestException("Missing or empty order note text."); + } + + entity.CreatedOnUtc = DateTime.UtcNow; - Service.AddOrderNote(order, entity.Note, entity.DisplayToCustomer); + order.OrderNotes.Add(entity); + Service.UpdateOrder(order); if (entity.DisplayToCustomer && this.GetQueryStringValue("customernotification", true)) { From fa69aa36f761bf3b9e9a347021fd56b113d36a05 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Tue, 18 Aug 2020 01:01:18 +0200 Subject: [PATCH 049/695] API: fixes missing location header for some endpoints --- .../Controllers/OData/CustomersController.cs | 2 +- .../Controllers/OData/MediaController.cs | 2 +- .../Controllers/OData/ProductsController.cs | 10 +++++----- .../WebApi/WebApiEntityController.cs | 7 ------- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 62409319c8..b3ee72cfa8 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -144,7 +144,7 @@ public IHttpActionResult PostAddresses(int key, int relatedKey /*addressId*/) entity.Addresses.Add(address); Service.UpdateCustomer(entity); - return Response(HttpStatusCode.Created, address); + return Created(address); } return Ok(address); diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs index 32a6cef635..cd79fe40a7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MediaController.cs @@ -479,7 +479,7 @@ public IHttpActionResult CreateFolder(ODataActionParameters parameters) newFolder = Convert(result); }); - return Response(HttpStatusCode.Created, newFolder); + return Created(newFolder); } /// POST /Media/MoveFolder {"Path":"content/my-folder", "DestinationPath":"content/my-renamed-folder"} diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index 754db80f4e..e98c29fc03 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -71,7 +71,7 @@ public IQueryable Get() [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public SingleResult Get(int key) { return GetSingleResult(key); } @@ -170,7 +170,7 @@ public SingleResult GetSampleDownload(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IHttpActionResult GetProductCategories(int key, int relatedKey = 0 /*categoryId*/) + public IHttpActionResult GetProductCategories(int key, int relatedKey = 0 /*categoryId*/) { var productCategories = _categoryService.Value.GetProductCategoriesByProductId(key, true); @@ -198,7 +198,7 @@ public IHttpActionResult PostProductCategories(int key, int relatedKey /*categor _categoryService.Value.InsertProductCategory(productCategory); - return Response(HttpStatusCode.Created, productCategory); + return Created(productCategory); } return Ok(productCategory); @@ -256,7 +256,7 @@ public IHttpActionResult PostProductManufacturers(int key, int relatedKey /*manu _manufacturerService.Value.InsertProductManufacturer(productManufacturer); - return Response(HttpStatusCode.Created, productManufacturer); + return Created(productManufacturer); } return Ok(productManufacturer); @@ -314,7 +314,7 @@ public IHttpActionResult PostProductPictures(int key, int relatedKey /*mediaFile Service.InsertProductPicture(productPicture); - return Response(HttpStatusCode.Created, productPicture); + return Created(productPicture); } return Ok(productPicture); diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index bb298a4db8..1b9d8fcbd9 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -8,7 +8,6 @@ using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; -using System.Web.Http.Results; using System.Web.OData; using System.Web.OData.Formatter; using Autofac; @@ -222,12 +221,6 @@ protected internal virtual IHttpActionResult GetPropertyValue(int key, string pr return ResponseMessage(response); } - protected internal virtual IHttpActionResult Response(HttpStatusCode status, T value) - { - var response = Request.CreateResponse(status, value); - return ResponseMessage(response); - } - protected internal virtual IHttpActionResult Response(T entity) { if (entity == null) From 23f5dbd31d3e0c9fe7bc40430a0a5975fd7d22be Mon Sep 17 00:00:00 2001 From: Murat Cakir Date: Tue, 18 Aug 2020 03:05:07 +0200 Subject: [PATCH 050/695] Minor fix --- .../SmartStore.Core/Domain/Catalog/ProductMediaFile.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs b/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs index e43e481e90..d40236f0a5 100644 --- a/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs +++ b/src/Libraries/SmartStore.Core/Domain/Catalog/ProductMediaFile.cs @@ -1,4 +1,5 @@ using System.Runtime.Serialization; +using Newtonsoft.Json; using SmartStore.Core.Domain.Media; namespace SmartStore.Core.Domain.Catalog @@ -17,6 +18,7 @@ public interface IMediaFile /// /// Gets the media file /// + [JsonIgnore] MediaFile MediaFile { get; set; } } From 98d0b856bdac185483aac75a41859344adf7c8e8 Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Tue, 18 Aug 2020 12:44:31 +0200 Subject: [PATCH 051/695] API: IHttpActionResult refactoring (in progress) --- .../Controllers/OData/AddressesController.cs | 8 ++++---- .../OData/BlogCommentsController.cs | 8 ++++---- .../Controllers/OData/BlogPostsController.cs | 8 ++++---- .../Controllers/OData/CategoriesController.cs | 8 ++++---- .../Controllers/OData/CountriesController.cs | 8 ++++---- .../Controllers/OData/CurrenciesController.cs | 11 +++++----- .../OData/CustomerRoleMappingsController.cs | 11 +++++----- .../OData/CustomerRolesController.cs | 11 +++++----- .../Controllers/OData/CustomersController.cs | 12 +++++------ .../OData/DeliveryTimesController.cs | 11 +++++----- .../Controllers/OData/DiscountsController.cs | 10 +++++----- .../Controllers/OData/DownloadsController.cs | 11 +++++----- .../OData/GenericAttributesController.cs | 11 +++++----- .../Controllers/OData/LanguagesController.cs | 11 +++++----- .../OData/LocalizedPropertiesController.cs | 11 +++++----- .../OData/ManufacturersController.cs | 10 +++++----- .../OData/MeasureDimensionsController.cs | 11 +++++----- .../OData/MeasureWeightsController.cs | 11 +++++----- .../NewsLetterSubscriptionsController.cs | 11 +++++----- .../Controllers/OData/OrderItemsController.cs | 8 ++++---- .../Controllers/OData/OrderNotesController.cs | 9 ++++----- .../Controllers/OData/OrdersController.cs | 8 ++++---- .../OData/PaymentMethodsController.cs | 11 +++++----- .../ProductAttributeOptionsController.cs | 11 +++++----- .../ProductAttributeOptionsSetsController.cs | 8 ++++---- .../OData/ProductAttributesController.cs | 8 ++++---- .../OData/ProductBundleItemsController.cs | 11 +++++----- .../OData/ProductCategoriesController.cs | 12 +++++------ .../OData/ProductManufacturersController.cs | 11 +++++----- .../OData/ProductPicturesController.cs | 14 ++++++------- ...roductSpecificationAttributesController.cs | 12 +++++------ ...tVariantAttributeCombinationsController.cs | 12 +++++------ ...ProductVariantAttributeValuesController.cs | 12 +++++------ .../ProductVariantAttributesController.cs | 9 ++++----- .../Controllers/OData/ProductsController.cs | 20 +++++++++---------- .../OData/QuantityUnitsController.cs | 12 +++++------ .../OData/RelatedProductsController.cs | 12 +++++------ .../OData/ReturnRequestsController.cs | 11 +++++----- .../Controllers/OData/SettingsController.cs | 11 +++++----- .../OData/ShipmentItemsController.cs | 11 +++++----- .../Controllers/OData/ShipmentsController.cs | 11 +++++----- .../OData/ShippingMethodsController.cs | 11 +++++----- ...SpecificationAttributeOptionsController.cs | 8 ++++---- .../SpecificationAttributesController.cs | 8 ++++---- .../OData/StateProvincesController.cs | 11 +++++----- .../OData/StoreMappingsController.cs | 11 +++++----- .../Controllers/OData/StoresController.cs | 11 +++++----- .../OData/SyncMappingsController.cs | 11 +++++----- .../OData/TaxCategoriesController.cs | 11 +++++----- .../Controllers/OData/TierPricesController.cs | 11 +++++----- .../Controllers/OData/UrlRecordsController.cs | 11 +++++----- .../WebApi/WebApiEntityController.cs | 14 ++++++++++++- .../WebApi/WebApiStartupTask.cs | 20 ++++++++++++------- .../SmartStore.WebApi.Client/MainForm.cs | 2 +- .../WebApi/WebApiConsumer.cs | 4 ++-- 55 files changed, 278 insertions(+), 303 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs index 16c71e16f3..7a746bc975 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs @@ -32,16 +32,16 @@ public AddressesController( [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public IQueryable
Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult
Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Customer.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs index c03ba9d217..4d985362c9 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs @@ -39,16 +39,16 @@ protected override IQueryable GetEntitySet() [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs index e1173408cd..c915677c5a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs @@ -35,16 +35,16 @@ orderby x.CreatedOnUtc descending [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs index fc8d36d5be..479e1bf3a0 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs @@ -35,16 +35,16 @@ from x in this.Repository.Table [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs index 7999b12970..88b4096317 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs @@ -15,16 +15,16 @@ public class CountriesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs index c5d58116c2..58b735a8fe 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CurrenciesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Directory; @@ -15,16 +14,16 @@ public class CurrenciesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Currency.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs index 77412247ff..8322d465b7 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Customers; @@ -15,16 +14,16 @@ public class CustomerRoleMappingsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs index 0db2ccea75..be355defca 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRolesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Net; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -16,16 +15,16 @@ public class CustomerRolesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index b3ee72cfa8..6330a804d3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -37,16 +37,16 @@ from x in this.Repository.Table [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Customer.Read)] @@ -120,10 +120,10 @@ public IHttpActionResult GetAddresses(int key, int relatedKey = 0 /*addressId*/) { var address = addresses.FirstOrDefault(x => x.Id == relatedKey); - return Response(address); + return Ok(address); } - return Response(addresses); + return Ok(addresses); } [WebApiAuthenticate(Permission = Permissions.Customer.EditAddress)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs index f8112b64e1..66f4d5c205 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DeliveryTimesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Directory; @@ -15,16 +14,16 @@ public class DeliveryTimesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs index 9c3f6cca40..0dd9f41f99 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs @@ -16,16 +16,16 @@ public class DiscountsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); - } + return Ok(GetEntitySet()); + } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Promotion.Discount.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs index 9606478fff..a1627d3bff 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DownloadsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Media; @@ -15,16 +14,16 @@ public class DownloadsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs index fe6a8b360b..73ff02a280 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/GenericAttributesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Common; @@ -14,15 +13,15 @@ namespace SmartStore.WebApi.Controllers.OData public class GenericAttributesController : WebApiEntityController { [WebApiQueryable] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } public IHttpActionResult GetProperty(int key, string propertyName) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs index 490929b96e..c751ea2c95 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LanguagesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Localization; @@ -15,16 +14,16 @@ public class LanguagesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Language.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs index 1ac2d14600..74191fbe8a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Localization; @@ -14,15 +13,15 @@ namespace SmartStore.WebApi.Controllers.OData public class LocalizedPropertiesController : WebApiEntityController { [WebApiQueryable] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } public IHttpActionResult GetProperty(int key, string propertyName) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs index 429571eaed..cd37c345e1 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs @@ -26,7 +26,7 @@ public ManufacturersController(Lazy urlRecordService) protected override IQueryable GetEntitySet() { var query = - from x in this.Repository.Table + from x in Repository.Table where !x.Deleted select x; @@ -35,16 +35,16 @@ from x in this.Repository.Table [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs index c17ba0d475..4b81748d5c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureDimensionsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Directory; @@ -15,16 +14,16 @@ public class MeasureDimensionsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs index fc3f1cb770..141ebc54fb 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/MeasureWeightsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Directory; @@ -15,16 +14,16 @@ public class MeasureWeightsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs index 928714003b..c10b7553bf 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/NewsLetterSubscriptionsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Messages; @@ -15,16 +14,16 @@ public class NewsLetterSubscriptionsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Promotion.Newsletter.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs index 886983b473..be90a29d4d 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs @@ -28,16 +28,16 @@ from x in Repository.Table [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Order.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs index 6d37eef5f6..f48236c269 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Net; using System.Threading.Tasks; using System.Web.Http; @@ -16,16 +15,16 @@ public class OrderNotesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Order.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index 783565ea76..ed8c34ca8b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -45,16 +45,16 @@ from x in Repository.Table [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Order.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs index d63d4ca8cc..79e5b87713 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/PaymentMethodsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Net; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -16,16 +15,16 @@ public class PaymentMethodsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.PaymentMethod.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs index d788f8101a..2d8c839449 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -15,16 +14,16 @@ public class ProductAttributeOptionsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs index 5d6608f62d..16858d8ef4 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs @@ -15,16 +15,16 @@ public class ProductAttributeOptionsSetsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs index f419ed79dd..b443fa3138 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs @@ -15,16 +15,16 @@ public class ProductAttributesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs index da9e110077..a8464db545 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -15,16 +14,16 @@ public class ProductBundleItemsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs index 7082d3605a..9d9e9a3d80 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -16,16 +14,16 @@ public class ProductCategoriesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs index b03fd1b404..a9b29021b4 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -15,16 +14,16 @@ public class ProductManufacturersController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs index d303edb6cf..8cec6bb7f5 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -13,20 +11,20 @@ namespace SmartStore.WebApi.Controllers.OData { - public class ProductPicturesController : WebApiEntityController + public class ProductPicturesController : WebApiEntityController { [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs index 31770ab910..64824d65e6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -16,16 +14,16 @@ public class ProductSpecificationAttributesController : WebApiEntityController

Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs index 316aae1e7d..6b8182e1d2 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -17,16 +15,16 @@ public class ProductVariantAttributeCombinationsController : WebApiEntityControl { [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs index 2148125f16..e15019fce9 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -16,16 +14,16 @@ public class ProductVariantAttributeValuesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs index f244e031c3..8dc7348744 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; @@ -16,16 +15,16 @@ public class ProductVariantAttributesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index e98c29fc03..57c58346d8 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -64,16 +64,16 @@ from x in Repository.Table [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] @@ -178,10 +178,10 @@ public IHttpActionResult GetProductCategories(int key, int relatedKey = 0 /*cate { var productCategory = productCategories.FirstOrDefault(x => x.CategoryId == relatedKey); - return Response(productCategory); + return Ok(productCategory); } - return Response(productCategories); + return Ok(productCategories); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditCategory)] @@ -236,10 +236,10 @@ public IHttpActionResult GetProductManufacturers(int key, int relatedKey = 0 /*m { var productManufacturer = productManufacturers.FirstOrDefault(x => x.ManufacturerId == relatedKey); - return Response(productManufacturer); + return Ok(productManufacturer); } - return Response(productManufacturers); + return Ok(productManufacturers); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditManufacturer)] @@ -294,10 +294,10 @@ public IHttpActionResult GetProductPictures(int key, int relatedKey = 0 /*mediaF { var productPicture = productPictures.FirstOrDefault(x => x.MediaFileId == relatedKey); - return Response(productPicture); + return Ok(productPicture); } - return Response(productPictures); + return Ok(productPictures); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.EditPicture)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs index 59492e7be0..aab2d6d06a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/QuantityUnitsController.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Directory; @@ -16,16 +14,16 @@ public class QuantityUnitsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs index d8ef5ea122..3b5d61c637 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/RelatedProductsController.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -16,16 +14,16 @@ public class RelatedProductsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs index 1d4952e033..ee24ce2a60 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Net; +using System.Net; using System.Threading.Tasks; using System.Web.Http; using SmartStore.Core.Domain.Customers; @@ -16,16 +15,16 @@ public class ReturnRequestsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs index 2ec972f8a6..5831ce1118 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SettingsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Configuration; @@ -15,16 +14,16 @@ public class SettingsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Setting.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs index b03d489044..0f8bbaa5fb 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Shipping; @@ -15,16 +14,16 @@ public class ShipmentItemsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Order.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs index fb026bf595..af99894339 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Shipping; @@ -15,16 +14,16 @@ public class ShipmentsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Order.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs index 420ee08f72..b7536df6ae 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShippingMethodsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Shipping; @@ -15,16 +14,16 @@ public class ShippingMethodsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Shipping.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs index 46006338c8..c8afcb7899 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs @@ -15,16 +15,16 @@ public class SpecificationAttributeOptionsController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs index 05d93ee00d..32dd211d43 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs @@ -15,16 +15,16 @@ public class SpecificationAttributesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs index ab549637bb..c059e884ee 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Directory; @@ -15,16 +14,16 @@ public class StateProvincesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs index 008d943315..d674bda27b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoreMappingsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Stores; @@ -14,15 +13,15 @@ namespace SmartStore.WebApi.Controllers.OData public class StoreMappingsController : WebApiEntityController { [WebApiQueryable] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } public IHttpActionResult GetProperty(int key, string propertyName) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs index 33d549474a..7779a4fc25 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StoresController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Stores; @@ -15,16 +14,16 @@ public class StoresController : WebApiEntityController { [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Store.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs index ad6421e8d6..3c71dff7d4 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SyncMappingsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.DataExchange; @@ -14,15 +13,15 @@ namespace SmartStore.WebApi.Controllers.OData public class SyncMappingsController : WebApiEntityController { [WebApiQueryable] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } public IHttpActionResult GetProperty(int key, string propertyName) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs index 1628e69309..fa81274d82 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TaxCategoriesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Tax; @@ -15,16 +14,16 @@ public class TaxCategoriesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Configuration.Tax.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs index c70310cf24..e89d51c481 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/TierPricesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -15,16 +14,16 @@ public class TierPricesController : WebApiEntityController Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs index b161e526f7..bf363d27cd 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/UrlRecordsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Net; +using System.Net; using System.Web.Http; using SmartStore.Core.Domain.Seo; using SmartStore.Services.Seo; @@ -13,15 +12,15 @@ namespace SmartStore.WebApi.Controllers.OData public class UrlRecordsController : WebApiEntityController { [WebApiQueryable] - public IQueryable Get() + public IHttpActionResult Get() { - return GetEntitySet(); + return Ok(GetEntitySet()); } [WebApiQueryable] - public SingleResult Get(int key) + public IHttpActionResult Get(int key) { - return GetSingleResult(key); + return Ok(key); } public IHttpActionResult GetProperty(int key, string propertyName) diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index 1b9d8fcbd9..22f93c01ee 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -221,8 +221,20 @@ protected internal virtual IHttpActionResult GetPropertyValue(int key, string pr return ResponseMessage(response); } - protected internal virtual IHttpActionResult Response(T entity) + protected internal new IHttpActionResult Ok(T content) { + if (content == null) + { + return NotFound(); + } + + return base.Ok(content); + } + + protected internal virtual IHttpActionResult Ok(int key) + { + var entity = GetEntitySet().FirstOrDefault(x => x.Id == key); + if (entity == null) { return NotFound(); diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs index 184c532976..9fc53fcd6f 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiStartupTask.cs @@ -28,18 +28,24 @@ public void Start() }; config.DependencyResolver = new AutofacWebApiDependencyResolver(); + //config.MapHttpAttributeRoutes(); - // Causes error messages during XML serialization: + // Causes errors during XML serialization: //var oDataFormatters = ODataMediaTypeFormatters.Create(); //config.Formatters.InsertRange(0, oDataFormatters); - config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; - config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; - config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new WebApiContractResolver(config.Formatters.JsonFormatter); - config.Formatters.JsonFormatter.MediaTypeMappings.Add(new QueryStringMapping("format", "json", "application/json")); - config.Formatters.XmlFormatter.MediaTypeMappings.Add(new QueryStringMapping("format", "xml", "application/xml")); + var json = config.Formatters.JsonFormatter; + json.SerializerSettings.Formatting = Formatting.Indented; + json.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; + json.SerializerSettings.ContractResolver = new WebApiContractResolver(config.Formatters.JsonFormatter); + json.AddQueryStringMapping("$format", "json", "application/json"); - config.AddODataQueryFilter(new WebApiQueryableAttribute()); + var xml = config.Formatters.XmlFormatter; + xml.UseXmlSerializer = true; + xml.Indent = true; + xml.AddQueryStringMapping("$format", "xml", "application/xml"); + + config.AddODataQueryFilter(new WebApiQueryableAttribute()); var corsAttribute = new EnableCorsAttribute("*", "*", "*", WebApiGlobal.Header.CorsExposed); config.EnableCors(corsAttribute); diff --git a/src/Tools/SmartStore.WebApi.Client/MainForm.cs b/src/Tools/SmartStore.WebApi.Client/MainForm.cs index 72d341f8b1..87f3e824ca 100644 --- a/src/Tools/SmartStore.WebApi.Client/MainForm.cs +++ b/src/Tools/SmartStore.WebApi.Client/MainForm.cs @@ -74,7 +74,7 @@ private void CallTheApi() SecretKey = txtSecretKey.Text, Url = txtUrl.Text + (radioOdata.Checked ? "odata/" : "api/") + txtVersion.Text + cboPath.Text, HttpMethod = cboMethod.Text, - HttpAcceptType = (radioJson.Checked ? ApiConsumer.JsonAcceptType : ApiConsumer.XmlAcceptType) + HttpAcceptType = radioJson.Checked ? ApiConsumer.JsonAcceptType : ApiConsumer.XmlAcceptType }; if (cboQuery.Text.HasValue()) diff --git a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs index 3ce18ef41d..6b695ba44f 100644 --- a/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs +++ b/src/Tools/SmartStore.WebApi.Client/WebApi/WebApiConsumer.cs @@ -12,8 +12,8 @@ namespace SmartStore.WebApi.Client { public class ApiConsumer : HmacAuthentication { - public static string XmlAcceptType { get { return "application/atom+xml,application/atomsvc+xml,application/xml"; } } - public static string JsonAcceptType { get { return "application/json, text/javascript, */*"; } } + public static string XmlAcceptType => "application/atom+xml,application/xml"; + public static string JsonAcceptType => "application/json"; private void SetTimeout(HttpWebRequest webRequest) { From ed9f6c40bdb60efd7acf298f8ede8ebd1fd0ebfd Mon Sep 17 00:00:00 2001 From: Marcus Gesing Date: Tue, 18 Aug 2020 16:27:11 +0200 Subject: [PATCH 052/695] API: IHttpActionResult refactoring (in progress) --- .../Controllers/OData/AddressesController.cs | 13 ++-- .../OData/BlogCommentsController.cs | 4 +- .../Controllers/OData/BlogPostsController.cs | 11 ++- .../Controllers/OData/CategoriesController.cs | 7 +- .../Controllers/OData/CountriesController.cs | 7 +- .../OData/CustomerRoleMappingsController.cs | 8 +- .../Controllers/OData/CustomersController.cs | 32 +++----- .../Controllers/OData/DiscountsController.cs | 16 ++-- .../OData/LocalizedPropertiesController.cs | 4 +- .../OData/ManufacturersController.cs | 5 +- .../Controllers/OData/OrderItemsController.cs | 13 ++-- .../Controllers/OData/OrderNotesController.cs | 4 +- .../Controllers/OData/OrdersController.cs | 74 ++++++++----------- .../ProductAttributeOptionsController.cs | 4 +- .../ProductAttributeOptionsSetsController.cs | 11 ++- .../OData/ProductAttributesController.cs | 7 +- .../OData/ProductBundleItemsController.cs | 8 +- .../OData/ProductCategoriesController.cs | 8 +- .../OData/ProductManufacturersController.cs | 8 +- .../OData/ProductPicturesController.cs | 9 +-- ...roductSpecificationAttributesController.cs | 4 +- ...tVariantAttributeCombinationsController.cs | 12 ++- ...ProductVariantAttributeValuesController.cs | 4 +- .../ProductVariantAttributesController.cs | 11 ++- .../Controllers/OData/ProductsController.cs | 51 ++++++------- .../OData/ReturnRequestsController.cs | 5 +- .../OData/ShipmentItemsController.cs | 12 +++ .../Controllers/OData/ShipmentsController.cs | 11 +++ ...SpecificationAttributeOptionsController.cs | 11 ++- .../SpecificationAttributesController.cs | 7 +- .../OData/StateProvincesController.cs | 4 +- .../WebApi/WebApiEntityController.cs | 7 +- 32 files changed, 191 insertions(+), 201 deletions(-) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs index 7a746bc975..3dbec93642 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/AddressesController.cs @@ -5,7 +5,6 @@ using System.Web.OData; using SmartStore.Core.Data; using SmartStore.Core.Domain.Common; -using SmartStore.Core.Domain.Directory; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Events; using SmartStore.Core.Security; @@ -103,17 +102,17 @@ public async Task Delete(int key) #region Navigation properties [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult GetCountry(int key) + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IHttpActionResult GetCountry(int key) { - return GetRelatedEntity(key, x => x.Country); + return Ok(GetRelatedEntity(key, x => x.Country)); } [WebApiQueryable] - [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult GetStateProvince(int key) + [WebApiAuthenticate(Permission = Permissions.Customer.Read)] + public IHttpActionResult GetStateProvince(int key) { - return GetRelatedEntity(key, x => x.StateProvince); + return Ok(GetRelatedEntity(key, x => x.StateProvince)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs index 4d985362c9..f4c316b569 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogCommentsController.cs @@ -113,9 +113,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public SingleResult GetBlogPost(int key) + public IHttpActionResult GetBlogPost(int key) { - return GetRelatedEntity(key, x => x.BlogPost); + return Ok(GetRelatedEntity(key, x => x.BlogPost)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs index c915677c5a..db021d2b7b 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/BlogPostsController.cs @@ -4,7 +4,6 @@ using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Blogs; -using SmartStore.Core.Domain.Localization; using SmartStore.Core.Security; using SmartStore.Services.Blogs; using SmartStore.Services.Seo; @@ -26,7 +25,7 @@ public BlogPostsController(Lazy urlRecordService) protected override IQueryable GetEntitySet() { var query = - from x in this.Repository.Table + from x in Repository.Table orderby x.CreatedOnUtc descending select x; @@ -116,16 +115,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public SingleResult GetLanguage(int key) + public IHttpActionResult GetLanguage(int key) { - return GetRelatedEntity(key, x => x.Language); + return Ok(GetRelatedEntity(key, x => x.Language)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Cms.Blog.Read)] - public IQueryable GetBlogComments(int key) + public IHttpActionResult GetBlogComments(int key) { - return GetRelatedCollection(key, x => x.BlogComments); + return Ok(GetRelatedCollection(key, x => x.BlogComments)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs index 479e1bf3a0..c9e05e1abf 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CategoriesController.cs @@ -4,7 +4,6 @@ using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; -using SmartStore.Core.Domain.Discounts; using SmartStore.Core.Security; using SmartStore.Services.Catalog; using SmartStore.Services.Seo; @@ -26,7 +25,7 @@ public CategoriesController(Lazy urlRecordService) protected override IQueryable GetEntitySet() { var query = - from x in this.Repository.Table + from x in Repository.Table where !x.Deleted select x; @@ -116,9 +115,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] - public IQueryable GetAppliedDiscounts(int key) + public IHttpActionResult GetAppliedDiscounts(int key) { - return GetRelatedCollection(key, x => x.AppliedDiscounts); + return Ok(GetRelatedCollection(key, x => x.AppliedDiscounts)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs index 88b4096317..7d74723304 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CountriesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Directory; @@ -65,9 +64,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public IQueryable GetStateProvinces(int key) + public IHttpActionResult GetStateProvinces(int key) { - return GetRelatedCollection(key, x => x.StateProvinces); + return Ok(GetRelatedCollection(key, x => x.StateProvinces)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs index 8322d465b7..d67711e4ef 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomerRoleMappingsController.cs @@ -64,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult GetCustomer(int key) + public IHttpActionResult GetCustomer(int key) { - return GetRelatedEntity(key, x => x.Customer); + return Ok(GetRelatedEntity(key, x => x.Customer)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public SingleResult GetCustomerRole(int key) + public IHttpActionResult GetCustomerRole(int key) { - return GetRelatedEntity(key, x => x.CustomerRole); + return Ok(GetRelatedEntity(key, x => x.CustomerRole)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs index 6330a804d3..d06df10a98 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/CustomersController.cs @@ -4,9 +4,7 @@ using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; -using SmartStore.Core.Domain.Common; using SmartStore.Core.Domain.Customers; -using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; using SmartStore.Services.Common; using SmartStore.Services.Customers; @@ -180,47 +178,37 @@ public IHttpActionResult DeleteAddresses(int key, int relatedKey = 0 /*addressId [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult

GetBillingAddress(int key) + public IHttpActionResult GetBillingAddress(int key) { - return GetRelatedEntity(key, x => x.BillingAddress); + return Ok(GetRelatedEntity(key, x => x.BillingAddress)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult
GetShippingAddress(int key) + public IHttpActionResult GetShippingAddress(int key) { - return GetRelatedEntity(key, x => x.ShippingAddress); + return Ok(GetRelatedEntity(key, x => x.ShippingAddress)); } - //public Language GetLanguage(int key) - //{ - // return GetExpandedProperty(key, x => x.Language); - //} - - //public Currency GetCurrency(int key) - //{ - // return GetExpandedProperty(key, x => x.Currency); - //} - [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public IQueryable GetOrders(int key) + public IHttpActionResult GetOrders(int key) { - return GetRelatedCollection(key, x => x.Orders); + return Ok(GetRelatedCollection(key, x => x.Orders)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.ReturnRequest.Read)] - public IQueryable GetReturnRequests(int key) + public IHttpActionResult GetReturnRequests(int key) { - return GetRelatedCollection(key, x => x.ReturnRequests); + return Ok(GetRelatedCollection(key, x => x.ReturnRequests)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Role.Read)] - public IQueryable GetCustomerRoleMappings(int key) + public IHttpActionResult GetCustomerRoleMappings(int key) { - return GetRelatedCollection(key, x => x.CustomerRoleMappings); + return Ok(GetRelatedCollection(key, x => x.CustomerRoleMappings)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs index 0dd9f41f99..2c3a15dc96 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/DiscountsController.cs @@ -1,8 +1,6 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; -using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Discounts; using SmartStore.Core.Security; using SmartStore.Services.Discounts; @@ -66,23 +64,23 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] - public IQueryable GetAppliedToCategories(int key) + public IHttpActionResult GetAppliedToCategories(int key) { - return GetRelatedCollection(key, x => x.AppliedToCategories); + return Ok(GetRelatedCollection(key, x => x.AppliedToCategories)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] - public IQueryable GetAppliedToManufacturers(int key) + public IHttpActionResult GetAppliedToManufacturers(int key) { - return GetRelatedCollection(key, x => x.AppliedToManufacturers); + return Ok(GetRelatedCollection(key, x => x.AppliedToManufacturers)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetAppliedToProducts(int key) + public IHttpActionResult GetAppliedToProducts(int key) { - return GetRelatedCollection(key, x => x.AppliedToProducts); + return Ok(GetRelatedCollection(key, x => x.AppliedToProducts)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs index 74191fbe8a..1995360dc3 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/LocalizedPropertiesController.cs @@ -56,9 +56,9 @@ public async Task Delete(int key) #region Navigation properties [WebApiQueryable] - public SingleResult GetLanguage(int key) + public IHttpActionResult GetLanguage(int key) { - return GetRelatedEntity(key, x => x.Language); + return Ok(GetRelatedEntity(key, x => x.Language)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs index cd37c345e1..2f60526fe2 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ManufacturersController.cs @@ -4,7 +4,6 @@ using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; -using SmartStore.Core.Domain.Discounts; using SmartStore.Core.Security; using SmartStore.Services.Catalog; using SmartStore.Services.Seo; @@ -112,9 +111,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] - public IQueryable GetAppliedDiscounts(int key) + public IHttpActionResult GetAppliedDiscounts(int key) { - return GetRelatedCollection(key, x => x.AppliedDiscounts); + return Ok(GetRelatedCollection(key, x => x.AppliedDiscounts)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs index be90a29d4d..7cffcc6c15 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderItemsController.cs @@ -2,7 +2,6 @@ using System.Net; using System.Threading.Tasks; using System.Web.Http; -using SmartStore.Core.Domain.Catalog; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; using SmartStore.Services.Orders; @@ -75,16 +74,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult GetOrder(int key) + public IHttpActionResult GetOrder(int key) { - return GetRelatedEntity(key, x => x.Order); + return Ok(GetRelatedEntity(key, x => x.Order)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProduct(int key) + public IHttpActionResult GetProduct(int key) { - return GetRelatedEntity(key, x => x.Product); + return Ok(GetRelatedEntity(key, x => x.Product)); } #endregion @@ -100,7 +99,7 @@ public static void Init(WebApiConfigurationBroadcaster configData) [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public OrderItemInfo Infos(int key) + public IHttpActionResult Infos(int key) { var result = new OrderItemInfo(); var entity = GetEntityByKeyNotNull(key); @@ -115,7 +114,7 @@ public OrderItemInfo Infos(int key) result.NotDeliveredItemsCount = entity.GetNotDeliveredItemsCount(); }); - return result; + return Ok(result); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs index f48236c269..de1a9c67a6 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrderNotesController.cs @@ -85,9 +85,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult GetOrder(int key) + public IHttpActionResult GetOrder(int key) { - return GetRelatedEntity(key, x => x.Order); + return Ok(GetRelatedEntity(key, x => x.Order)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs index ed8c34ca8b..d9ec9e4b65 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/OrdersController.cs @@ -4,11 +4,8 @@ using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; -using SmartStore.Core.Domain.Common; -using SmartStore.Core.Domain.Customers; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Domain.Payments; -using SmartStore.Core.Domain.Shipping; using SmartStore.Core.Security; using SmartStore.Services.Orders; using SmartStore.Web.Framework.WebApi; @@ -95,45 +92,44 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult GetCustomer(int key) + public IHttpActionResult GetCustomer(int key) { - return GetRelatedEntity(key, x => x.Customer); + return Ok(GetRelatedEntity(key, x => x.Customer)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult
GetBillingAddress(int key) + public IHttpActionResult GetBillingAddress(int key) { - return GetRelatedEntity(key, x => x.BillingAddress); + return Ok(GetRelatedEntity(key, x => x.BillingAddress)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public SingleResult
GetShippingAddress(int key) + public IHttpActionResult GetShippingAddress(int key) { - return GetRelatedEntity(key, x => x.ShippingAddress); + return Ok(GetRelatedEntity(key, x => x.ShippingAddress)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public IQueryable GetOrderNotes(int key) + public IHttpActionResult GetOrderNotes(int key) { - //var entity = GetEntityByKeyNotNull(key); // if ProxyCreationEnabled = true - return GetRelatedCollection(key, x => x.OrderNotes); + return Ok(GetRelatedCollection(key, x => x.OrderNotes)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public IQueryable GetShipments(int key) + public IHttpActionResult GetShipments(int key) { - return GetRelatedCollection(key, x => x.Shipments); + return Ok(GetRelatedCollection(key, x => x.Shipments)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public IQueryable GetOrderItems(int key) + public IHttpActionResult GetOrderItems(int key) { - return GetRelatedCollection(key, x => x.OrderItems); + return Ok(GetRelatedCollection(key, x => x.OrderItems)); } #endregion @@ -181,7 +177,7 @@ public static void Init(WebApiConfigurationBroadcaster configData) [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Read)] - public OrderInfo Infos(int key) + public IHttpActionResult Infos(int key) { var result = new OrderInfo(); var entity = GetEntityByKeyNotNull(key); @@ -193,7 +189,7 @@ public OrderInfo Infos(int key) result.CanAddItemsToShipment = entity.CanAddItemsToShipment(); }); - return result; + return Ok(result); } [HttpPost] @@ -217,10 +213,9 @@ public IHttpActionResult Pdf(int key) [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Update)] - public SingleResult PaymentPending(int key) + public IHttpActionResult PaymentPending(int key) { - var result = GetSingleResult(key); - var order = GetExpandedEntity(key, result, null); + var order = GetEntityByKeyNotNull(key); this.ProcessEntity(() => { @@ -228,15 +223,14 @@ public SingleResult PaymentPending(int key) Service.UpdateOrder(order); }); - return result; + return Ok(order); } [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Update)] - public SingleResult PaymentPaid(int key, ODataActionParameters parameters) + public IHttpActionResult PaymentPaid(int key, ODataActionParameters parameters) { - var result = GetSingleResult(key); - var order = GetExpandedEntity(key, result, null); + var order = GetEntityByKeyNotNull(key); this.ProcessEntity(() => { @@ -251,15 +245,14 @@ public SingleResult PaymentPaid(int key, ODataActionParameters parameters _orderProcessingService.Value.MarkOrderAsPaid(order); }); - return result; + return Ok(order); } [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Update)] - public SingleResult PaymentRefund(int key, ODataActionParameters parameters) + public IHttpActionResult PaymentRefund(int key, ODataActionParameters parameters) { - var result = GetSingleResult(key); - var order = GetExpandedEntity(key, result, null); + var order = GetEntityByKeyNotNull(key); this.ProcessEntity(() => { @@ -277,30 +270,28 @@ public SingleResult PaymentRefund(int key, ODataActionParameters paramete } }); - return result; + return Ok(order); } [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Update)] - public SingleResult Cancel(int key) + public IHttpActionResult Cancel(int key) { - var result = GetSingleResult(key); - var order = GetExpandedEntity(key, result, "OrderItems, OrderItems.Product"); + var order = GetEntityByKeyNotNull(key); this.ProcessEntity(() => { _orderProcessingService.Value.CancelOrder(order, true); }); - return result; + return Ok(order); } [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.EditShipment)] - public SingleResult AddShipment(int key, ODataActionParameters parameters) + public IHttpActionResult AddShipment(int key, ODataActionParameters parameters) { - var result = GetSingleResult(key); - var order = GetExpandedEntity(key, result, "OrderItems, OrderItems.Product, Shipments, Shipments.ShipmentItems"); + var order = GetEntityByKeyNotNull(key); this.ProcessEntity(() => { @@ -320,22 +311,21 @@ public SingleResult AddShipment(int key, ODataActionParameters parameters } }); - return result; + return Ok(order); } [HttpPost] [WebApiAuthenticate(Permission = Permissions.Order.Update)] - public SingleResult CompleteOrder(int key) + public IHttpActionResult CompleteOrder(int key) { - var result = GetSingleResult(key); - var order = GetExpandedEntity(key, result, "OrderItems, OrderItems.Product, Shipments, Shipments.ShipmentItems"); + var order = GetEntityByKeyNotNull(key); this.ProcessEntity(() => { _orderProcessingService.Value.CompleteOrder(order); }); - return result; + return Ok(order); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs index 2d8c839449..c3f9225ed2 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsController.cs @@ -64,9 +64,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult GetProductAttributeOptionsSet(int key) + public IHttpActionResult GetProductAttributeOptionsSet(int key) { - return GetRelatedEntity(key, x => x.ProductAttributeOptionsSet); + return Ok(GetRelatedEntity(key, x => x.ProductAttributeOptionsSet)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs index 16858d8ef4..67628e360f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributeOptionsSetsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -65,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public SingleResult GetProductAttribute(int key) + public IHttpActionResult GetProductAttribute(int key) { - return GetRelatedEntity(key, x => x.ProductAttribute); + return Ok(GetRelatedEntity(key, x => x.ProductAttribute)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public IQueryable GetProductAttributeOptions(int key) + public IHttpActionResult GetProductAttributeOptions(int key) { - return GetRelatedCollection(key, x => x.ProductAttributeOptions); + return Ok(GetRelatedCollection(key, x => x.ProductAttributeOptions)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs index b443fa3138..1ea647c14f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductAttributesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -65,9 +64,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Variant.Read)] - public IQueryable GetProductAttributeOptionsSets(int key) + public IHttpActionResult GetProductAttributeOptionsSets(int key) { - return GetRelatedCollection(key, x => x.ProductAttributeOptionsSets); + return Ok(GetRelatedCollection(key, x => x.ProductAttributeOptionsSets)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs index a8464db545..548d4bee90 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductBundleItemsController.cs @@ -64,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProduct(int key) + public IHttpActionResult GetProduct(int key) { - return GetRelatedEntity(key, x => x.Product); + return Ok(GetRelatedEntity(key, x => x.Product)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetBundleProduct(int key) + public IHttpActionResult GetBundleProduct(int key) { - return GetRelatedEntity(key, x => x.BundleProduct); + return Ok(GetRelatedEntity(key, x => x.BundleProduct)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs index 9d9e9a3d80..dcf737bd8f 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductCategoriesController.cs @@ -64,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Category.Read)] - public SingleResult GetCategory(int key) + public IHttpActionResult GetCategory(int key) { - return GetRelatedEntity(key, x => x.Category); + return Ok(GetRelatedEntity(key, x => x.Category)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProduct(int key) + public IHttpActionResult GetProduct(int key) { - return GetRelatedEntity(key, x => x.Product); + return Ok(GetRelatedEntity(key, x => x.Product)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs index a9b29021b4..fd50b57809 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductManufacturersController.cs @@ -64,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Manufacturer.Read)] - public SingleResult GetManufacturer(int key) + public IHttpActionResult GetManufacturer(int key) { - return GetRelatedEntity(key, x => x.Manufacturer); + return Ok(GetRelatedEntity(key, x => x.Manufacturer)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProduct(int key) + public IHttpActionResult GetProduct(int key) { - return GetRelatedEntity(key, x => x.Product); + return Ok(GetRelatedEntity(key, x => x.Product)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs index 8cec6bb7f5..5884968d11 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductPicturesController.cs @@ -2,7 +2,6 @@ using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; -using SmartStore.Core.Domain.Media; using SmartStore.Core.Security; using SmartStore.Services.Catalog; using SmartStore.Web.Framework.WebApi; @@ -65,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetPicture(int key) + public IHttpActionResult GetPicture(int key) { - return GetRelatedEntity(key, x => x.MediaFile); + return Ok(GetRelatedEntity(key, x => x.MediaFile)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProduct(int key) + public IHttpActionResult GetProduct(int key) { - return GetRelatedEntity(key, x => x.Product); + return Ok(GetRelatedEntity(key, x => x.Product)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs index 64824d65e6..878c567c6a 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductSpecificationAttributesController.cs @@ -64,9 +64,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetSpecificationAttributeOption(int key) + public IHttpActionResult GetSpecificationAttributeOption(int key) { - return GetRelatedEntity(key, x => x.SpecificationAttributeOption); + return Ok(GetRelatedEntity(key, x => x.SpecificationAttributeOption)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs index 6b8182e1d2..1b3396cd98 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeCombinationsController.cs @@ -2,7 +2,6 @@ using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; -using SmartStore.Core.Domain.Directory; using SmartStore.Core.Security; using SmartStore.Services.Catalog; using SmartStore.Web.Framework.WebApi; @@ -65,9 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] - public SingleResult GetDeliveryTime(int key) + public IHttpActionResult GetDeliveryTime(int key) { - return GetRelatedEntity(key, x => x.DeliveryTime); + return Ok(GetRelatedEntity(key, x => x.DeliveryTime)); + } + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] + public IHttpActionResult GetQuantityUnit(int key) + { + return Ok(GetRelatedEntity(key, x => x.QuantityUnit)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs index e15019fce9..dd62875c82 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributeValuesController.cs @@ -64,9 +64,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProductVariantAttribute(int key) + public IHttpActionResult GetProductVariantAttribute(int key) { - return GetRelatedEntity(key, x => x.ProductVariantAttribute); + return Ok(GetRelatedEntity(key, x => x.ProductVariantAttribute)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs index 8dc7348744..8a2ea2dd1d 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductVariantAttributesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -65,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetProductAttribute(int key) + public IHttpActionResult GetProductAttribute(int key) { - return GetRelatedEntity(key, x => x.ProductAttribute); + return Ok(GetRelatedEntity(key, x => x.ProductAttribute)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductVariantAttributeValues(int key) + public IHttpActionResult GetProductVariantAttributeValues(int key) { - return GetRelatedCollection(key, x => x.ProductVariantAttributeValues); + return Ok(GetRelatedCollection(key, x => x.ProductVariantAttributeValues)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs index 57c58346d8..145f0f8dff 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ProductsController.cs @@ -7,9 +7,6 @@ using System.Web.Http.ModelBinding; using System.Web.OData; using SmartStore.Core.Domain.Catalog; -using SmartStore.Core.Domain.Directory; -using SmartStore.Core.Domain.Discounts; -using SmartStore.Core.Domain.Media; using SmartStore.Core.Search; using SmartStore.Core.Security; using SmartStore.Services.Catalog; @@ -141,30 +138,30 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.DeliveryTime.Read)] - public SingleResult GetDeliveryTime(int key) + public IHttpActionResult GetDeliveryTime(int key) { - return GetRelatedEntity(key, x => x.DeliveryTime); + return Ok(GetRelatedEntity(key, x => x.DeliveryTime)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Measure.Read)] - public SingleResult GetQuantityUnit(int key) + public IHttpActionResult GetQuantityUnit(int key) { - return GetRelatedEntity(key, x => x.QuantityUnit); + return Ok(GetRelatedEntity(key, x => x.QuantityUnit)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public SingleResult GetCountryOfOrigin(int key) + public IHttpActionResult GetCountryOfOrigin(int key) { - return GetRelatedEntity(key, x => x.CountryOfOrigin); + return Ok(GetRelatedEntity(key, x => x.CountryOfOrigin)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Media.Download.Read)] - public SingleResult GetSampleDownload(int key) + public IHttpActionResult GetSampleDownload(int key) { - return GetRelatedEntity(key, x => x.SampleDownload); + return Ok(GetRelatedEntity(key, x => x.SampleDownload)); } @@ -344,51 +341,51 @@ public IHttpActionResult DeleteProductPictures(int key, int relatedKey = 0 /*med [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductSpecificationAttributes(int key) + public IHttpActionResult GetProductSpecificationAttributes(int key) { - return GetRelatedCollection(key, x => x.ProductSpecificationAttributes); + return Ok(GetRelatedCollection(key, x => x.ProductSpecificationAttributes)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductTags(int key) + public IHttpActionResult GetProductTags(int key) { - return GetRelatedCollection(key, x => x.ProductTags); + return Ok(GetRelatedCollection(key, x => x.ProductTags)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetTierPrices(int key) + public IHttpActionResult GetTierPrices(int key) { - return GetRelatedCollection(key, x => x.TierPrices); + return Ok(GetRelatedCollection(key, x => x.TierPrices)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetAppliedDiscounts(int key) + public IHttpActionResult GetAppliedDiscounts(int key) { - return GetRelatedCollection(key, x => x.AppliedDiscounts); + return Ok(GetRelatedCollection(key, x => x.AppliedDiscounts)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductVariantAttributes(int key) + public IHttpActionResult GetProductVariantAttributes(int key) { - return GetRelatedCollection(key, x => x.ProductVariantAttributes); + return Ok(GetRelatedCollection(key, x => x.ProductVariantAttributes)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductVariantAttributeCombinations(int key) + public IHttpActionResult GetProductVariantAttributeCombinations(int key) { - return GetRelatedCollection(key, x => x.ProductVariantAttributeCombinations); + return Ok(GetRelatedCollection(key, x => x.ProductVariantAttributeCombinations)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductBundleItems(int key) + public IHttpActionResult GetProductBundleItems(int key) { - return GetRelatedCollection(key, x => x.ProductBundleItems); + return Ok(GetRelatedCollection(key, x => x.ProductBundleItems)); } #endregion @@ -424,7 +421,7 @@ public static void Init(WebApiConfigurationBroadcaster configData) [HttpPost, WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable Search([ModelBinder(typeof(WebApiCatalogSearchQueryModelBinder))] CatalogSearchQuery query) + public IHttpActionResult Search([ModelBinder(typeof(WebApiCatalogSearchQueryModelBinder))] CatalogSearchQuery query) { CatalogSearchResult result = null; @@ -438,7 +435,7 @@ public IQueryable Search([ModelBinder(typeof(WebApiCatalogSearchQueryMo result = _catalogSearchService.Value.Search(query); }); - return result.Hits.AsQueryable(); + return Ok(result.Hits.AsQueryable()); } private decimal? CalculatePrice(int key, bool lowestPrice) diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs index ee24ce2a60..8c29885622 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ReturnRequestsController.cs @@ -1,7 +1,6 @@ using System.Net; using System.Threading.Tasks; using System.Web.Http; -using SmartStore.Core.Domain.Customers; using SmartStore.Core.Domain.Orders; using SmartStore.Core.Security; using SmartStore.Services.Orders; @@ -62,9 +61,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Customer.Read)] - public SingleResult GetCustomer(int key) + public IHttpActionResult GetCustomer(int key) { - return GetRelatedEntity(key, x => x.Customer); + return Ok(GetRelatedEntity(key, x => x.Customer)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs index 0f8bbaa5fb..a4c3a845f5 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentItemsController.cs @@ -59,5 +59,17 @@ public async Task Delete(int key) var result = await DeleteAsync(key, entity => Service.DeleteShipmentItem(entity)); return result; } + + #region Navigation properties + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public IHttpActionResult GetShipment(int key) + { + return Ok(GetRelatedEntity(key, x => x.Shipment)); + } + + #endregion + } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs index af99894339..63c45a1a58 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/ShipmentsController.cs @@ -59,5 +59,16 @@ public async Task Delete(int key) var result = await DeleteAsync(key, entity => Service.DeleteShipment(entity)); return result; } + + #region Navigation properties + + [WebApiQueryable] + [WebApiAuthenticate(Permission = Permissions.Order.Read)] + public IHttpActionResult GetShipmentItems(int key) + { + return Ok(GetRelatedCollection(key, x => x.ShipmentItems)); + } + + #endregion } } diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs index c8afcb7899..5589359d3c 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributeOptionsController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -65,16 +64,16 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public SingleResult GetSpecificationAttribute(int key) + public IHttpActionResult GetSpecificationAttribute(int key) { - return GetRelatedEntity(key, x => x.SpecificationAttribute); + return Ok(GetRelatedEntity(key, x => x.SpecificationAttribute)); } [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Product.Read)] - public IQueryable GetProductSpecificationAttributes(int key) + public IHttpActionResult GetProductSpecificationAttributes(int key) { - return GetRelatedCollection(key, x => x.ProductSpecificationAttributes); + return Ok(GetRelatedCollection(key, x => x.ProductSpecificationAttributes)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs index 32dd211d43..6659f141da 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/SpecificationAttributesController.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Web.Http; using System.Web.OData; using SmartStore.Core.Domain.Catalog; @@ -65,9 +64,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Catalog.Attribute.Read)] - public IQueryable GetSpecificationAttributeOptions(int key) + public IHttpActionResult GetSpecificationAttributeOptions(int key) { - return GetRelatedCollection(key, x => x.SpecificationAttributeOptions); + return Ok(GetRelatedCollection(key, x => x.SpecificationAttributeOptions)); } #endregion diff --git a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs index c059e884ee..b286231498 100644 --- a/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs +++ b/src/Plugins/SmartStore.WebApi/Controllers/OData/StateProvincesController.cs @@ -64,9 +64,9 @@ public async Task Delete(int key) [WebApiQueryable] [WebApiAuthenticate(Permission = Permissions.Configuration.Country.Read)] - public SingleResult GetCountry(int key) + public IHttpActionResult GetCountry(int key) { - return GetRelatedEntity(key, x => x.Country); + return Ok(GetRelatedEntity(key, x => x.Country)); } #endregion diff --git a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs index 22f93c01ee..2dc59acab0 100644 --- a/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs +++ b/src/Presentation/SmartStore.Web.Framework/WebApi/WebApiEntityController.cs @@ -68,7 +68,7 @@ protected internal virtual TEntity GetEntityByKeyNotNull(int key) throw this.InvalidModelStateException(); } - var entity = Repository.GetById(key); + var entity = GetEntitySet().FirstOrDefault(x => x.Id == key); if (entity == null) { throw Request.NotFoundException(WebApiGlobal.Error.EntityNotFound.FormatInvariant(key)); @@ -180,11 +180,12 @@ protected internal virtual IQueryable GetRelatedCollection Date: Tue, 18 Aug 2020 20:51:45 +0200 Subject: [PATCH 053/695] shopping cart > renamed order processing 'order total validation' methods and variables --- .../Orders/IOrderProcessingService.cs | 6 +- .../Orders/OrderProcessingService.cs | 86 +++++++++---------- .../Controllers/CheckoutController.cs | 24 +++--- .../Controllers/ShoppingCartController.cs | 52 +++++------ .../Models/ShoppingCart/ShoppingCartModel.cs | 2 +- .../ShoppingCart/Partials/OrderSummary.cshtml | 2 +- .../Partials/_RefreshCartScript.cshtml | 2 +- 7 files changed, 87 insertions(+), 87 deletions(-) diff --git a/src/Libraries/SmartStore.Services/Orders/IOrderProcessingService.cs b/src/Libraries/SmartStore.Services/Orders/IOrderProcessingService.cs index c458fc5e11..a0e545e499 100644 --- a/src/Libraries/SmartStore.Services/Orders/IOrderProcessingService.cs +++ b/src/Libraries/SmartStore.Services/Orders/IOrderProcessingService.cs @@ -288,7 +288,7 @@ IList GetOrderPlacementWarnings( /// /// Shopping cart /// true - OK; false - minimum order amount is not reached - (bool isValid, decimal minOrderAmount) ValidateMinOrderAmount(IList cart, int[] customerRoleIds); + (bool valid, decimal orderTotalMinimum) IsAboveMinimumOrderTotal(IList cart, int[] customerRoleIds); /// /// Valdiate maximum order amount. @@ -297,7 +297,7 @@ IList GetOrderPlacementWarnings( /// /// Shopping cart, customer role ids /// true - OK; false - maximum order amount is exceeded - (bool isValid, decimal maxOrderAmount) ValidateMaxOrderAmount(IList cart, int[] customerRoleIds); + (bool valid, decimal orderTotalMaximum) IsBelowOrderTotalMaximum(IList cart, int[] customerRoleIds); /// /// Valdiate minimum and maximum order amount. @@ -306,7 +306,7 @@ IList GetOrderPlacementWarnings( /// /// Shopping cart, customer role ids /// true - OK; false - minimum amount is not reached or maximum amount is exceeded - bool ValidateOrderAmount(IList cart, int[] customerRoleIds); + bool IsInOrderTotalsRange(IList cart, int[] customerRoleIds); /// /// Adds a shipment to an order. diff --git a/src/Libraries/SmartStore.Services/Orders/OrderProcessingService.cs b/src/Libraries/SmartStore.Services/Orders/OrderProcessingService.cs index 0e90c84612..dc0f9411b0 100644 --- a/src/Libraries/SmartStore.Services/Orders/OrderProcessingService.cs +++ b/src/Libraries/SmartStore.Services/Orders/OrderProcessingService.cs @@ -523,34 +523,34 @@ public virtual IList GetOrderPlacementWarnings( } } - // Min amount validation + // Order total minimum validation var customerRoleIds = customer.GetRoleIds(); - var minOrderAmountValidation = ValidateMinOrderAmount(cart, customerRoleIds); - if (!minOrderAmountValidation.isValid) + var (isAboveMinOrderTotal, orderTotalMinimum) = IsAboveMinimumOrderTotal(cart, customerRoleIds); + if (!isAboveMinOrderTotal) { - var minOrderAmount = _currencyService.ConvertFromPrimaryStoreCurrency( - minOrderAmountValidation.minOrderAmount, + orderTotalMinimum = _currencyService.ConvertFromPrimaryStoreCurrency( + orderTotalMinimum, _workContext.WorkingCurrency); var msg = _orderSettings.ApplyToSubtotal - ? T("Checkout.MinOrderSubtotalAmount", _priceFormatter.FormatPrice(minOrderAmount, true, false)) - : T("Checkout.MinOrderTotalAmount", _priceFormatter.FormatPrice(minOrderAmount, true, false)); + ? T("Checkout.MinOrderSubtotalAmount", _priceFormatter.FormatPrice(orderTotalMinimum, true, false)) + : T("Checkout.MinOrderTotalAmount", _priceFormatter.FormatPrice(orderTotalMinimum, true, false)); warnings.Add(msg); return warnings; } - // Max amount validation - var maxOrderAmountValidation = ValidateMaxOrderAmount(cart, customerRoleIds); - if (minOrderAmountValidation.isValid && !maxOrderAmountValidation.isValid) + // Order total maximum validation + var (isBelowMaxOrderTotal, orderTotalMaximum) = IsBelowOrderTotalMaximum(cart, customerRoleIds); + if (isAboveMinOrderTotal && !isBelowMaxOrderTotal) { - var maxOrderAmount = _currencyService.ConvertFromPrimaryStoreCurrency( - maxOrderAmountValidation.maxOrderAmount, + orderTotalMaximum = _currencyService.ConvertFromPrimaryStoreCurrency( + orderTotalMaximum, _workContext.WorkingCurrency); var msg = _orderSettings.ApplyToSubtotal - ? T("Checkout.MaxOrderSubtotalAmount", _priceFormatter.FormatPrice(maxOrderAmount, true, false)) - : T("Checkout.MaxOrderTotalAmount", _priceFormatter.FormatPrice(maxOrderAmount, true, false)); + ? T("Checkout.MaxOrderSubtotalAmount", _priceFormatter.FormatPrice(orderTotalMaximum, true, false)) + : T("Checkout.MaxOrderTotalAmount", _priceFormatter.FormatPrice(orderTotalMaximum, true, false)); warnings.Add(msg); return warnings; @@ -2646,7 +2646,7 @@ public virtual bool IsReturnRequestAllowed(Order order) return numberOfDaysReturnRequestAvailableValid; } - public virtual (bool isValid, decimal minOrderAmount) ValidateMinOrderAmount(IList cart, int[] customerRoleIds) + public virtual (bool valid, decimal orderTotalMinimum) IsAboveMinimumOrderTotal(IList cart, int[] customerRoleIds) { var query = _customerService.GetAllCustomerRoles().SourceQuery; var customerRole = query @@ -2654,44 +2654,44 @@ public virtual (bool isValid, decimal minOrderAmount) ValidateMinOrderAmount(ILi .OrderByDescending(x => x.MinOrderAmount) .FirstOrDefault(); - var minOrderAmount = customerRole == null + var minimumOrderTotal = customerRole == null ? _orderSettings.MinOrderAmount : customerRole.MinOrderAmount; - return ValidateMinOrderAmount(cart, minOrderAmount); + return IsAboveOrderAmountMinimum(cart, minimumOrderTotal); } /// - /// Valdiate minimum order amount. + /// Valdiate order total minimum. /// - /// Shopping cart, minimum order amount - /// true - OK; false - minimum order amount is not reached - private (bool isValid, decimal minOrderAmount) ValidateMinOrderAmount(IList cart, decimal minOrderAmount) + /// Shopping cart, minimum order total + /// true - OK; false - minimum order total is not reached + private (bool valid, decimal orderTotalMinimum) IsAboveOrderAmountMinimum(IList cart, decimal minimumOrderTotal) { if (cart == null) throw new ArgumentNullException("cart"); - if (cart.Count > 0 && minOrderAmount > decimal.Zero) + if (cart.Count > 0 && minimumOrderTotal > decimal.Zero) { if (_orderSettings.ApplyToSubtotal) { _orderTotalCalculationService.GetShoppingCartSubTotal( cart, out _, out _, out var cartSubtotal, out _); - if (cartSubtotal < minOrderAmount) - return (false, minOrderAmount); + if (cartSubtotal < minimumOrderTotal) + return (false, minimumOrderTotal); } else { decimal? cartTotal = _orderTotalCalculationService.GetShoppingCartTotal(cart); - if (cartTotal.HasValue && cartTotal.Value < minOrderAmount) - return (false, minOrderAmount); + if (cartTotal.HasValue && cartTotal.Value < minimumOrderTotal) + return (false, minimumOrderTotal); } } - return (true, minOrderAmount); + return (true, minimumOrderTotal); } - public virtual (bool isValid, decimal maxOrderAmount) ValidateMaxOrderAmount(IList cart, int[] customerRoleIds) + public virtual (bool valid, decimal orderTotalMaximum) IsBelowOrderTotalMaximum(IList cart, int[] customerRoleIds) { var query = _customerService.GetAllCustomerRoles().SourceQuery; var customerRole = query @@ -2699,47 +2699,47 @@ public virtual (bool isValid, decimal maxOrderAmount) ValidateMaxOrderAmount(ILi .OrderBy(x => x.MaxOrderAmount) .FirstOrDefault(); - var maxOrderAmount = customerRole == null + var maximumOrderTotal = customerRole == null ? _orderSettings.MaxOrderAmount : customerRole.MaxOrderAmount; - return ValidateMaxOrderAmount(cart, maxOrderAmount); + return IsBelowOrderTotalMaximum(cart, maximumOrderTotal); } /// - /// Valdiate maximum order amount. + /// Valdiate order total maximum. /// - /// Shopping cart, maximum order amount - /// true - OK; false - maximum order amount is exceeded - private (bool isValid, decimal maxOrderAmount) ValidateMaxOrderAmount(IList cart, decimal maxOrderAmount) + /// Shopping cart, maximum order total + /// true - OK; false - maximum order total is exceeded + private (bool valid, decimal orderTotalMaximum) IsBelowOrderTotalMaximum(IList cart, decimal maximumOrderTotal) { if (cart == null) throw new ArgumentNullException("cart"); - if (cart.Count > 0 && maxOrderAmount > decimal.Zero) + if (cart.Count > 0 && maximumOrderTotal > decimal.Zero) { if (_orderSettings.ApplyToSubtotal) { _orderTotalCalculationService.GetShoppingCartSubTotal( cart, out _, out _, out var cartSubtotal, out _); - if (cartSubtotal > maxOrderAmount) - return (false, maxOrderAmount); + if (cartSubtotal > maximumOrderTotal) + return (false, maximumOrderTotal); } else { decimal? cartTotal = _orderTotalCalculationService.GetShoppingCartTotal(cart); - if (cartTotal.HasValue && cartTotal.Value > maxOrderAmount) - return (false, maxOrderAmount); + if (cartTotal.HasValue && cartTotal.Value > maximumOrderTotal) + return (false, maximumOrderTotal); } } - return (true, maxOrderAmount); + return (true, maximumOrderTotal); } - public virtual bool ValidateOrderAmount(IList cart, int[] customerRoleIds) + public virtual bool IsInOrderTotalsRange(IList cart, int[] customerRoleIds) { - return ValidateMinOrderAmount(cart, customerRoleIds).isValid - && ValidateMaxOrderAmount(cart, customerRoleIds).isValid; + return IsAboveMinimumOrderTotal(cart, customerRoleIds).valid + && IsBelowOrderTotalMaximum(cart, customerRoleIds).valid; } public virtual Shipment AddShipment( diff --git a/src/Presentation/SmartStore.Web/Controllers/CheckoutController.cs b/src/Presentation/SmartStore.Web/Controllers/CheckoutController.cs index f2aaaaab59..937c8ad1d1 100644 --- a/src/Presentation/SmartStore.Web/Controllers/CheckoutController.cs +++ b/src/Presentation/SmartStore.Web/Controllers/CheckoutController.cs @@ -353,33 +353,33 @@ protected CheckoutConfirmModel PrepareConfirmOrderModel(IList x.IsRequired).Count() == 0 && orderAmountIsValid; + var isInOrderTotalsRange = _orderProcessingService.IsInOrderTotalsRange(cart, _workContext.CurrentCustomer.GetRoleIds()); + model.DisplayCheckoutButton = checkoutAttributes.Where(x => x.IsRequired).Count() == 0 && isInOrderTotalsRange; // Products. sort descending (recently added products) cart = cart.ToList(); // TBD: (mc) Why? @@ -1658,7 +1658,7 @@ public ActionResult DeleteCartItem(int cartItemId, bool? wishlistItem) if (!_permissionService.Authorize(isWishlistItem ? Permissions.Cart.AccessWishlist : Permissions.Cart.AccessShoppingCart)) { - return Json(new { success = false, showCheckoutButtons = true }); + return Json(new { success = false, displayCheckoutButtons = true }); } // Get shopping cart item. @@ -1667,7 +1667,7 @@ public ActionResult DeleteCartItem(int cartItemId, bool? wishlistItem) if (item == null) { - return Json(new { success = false, showCheckoutButtons = true, message = _localizationService.GetResource("ShoppingCart.DeleteCartItem.Failed") }); + return Json(new { success = false, displayCheckoutButtons = true, message = _localizationService.GetResource("ShoppingCart.DeleteCartItem.Failed") }); } // Remove the cart item. @@ -1679,7 +1679,7 @@ public ActionResult DeleteCartItem(int cartItemId, bool? wishlistItem) var cartHtml = String.Empty; var totalsHtml = String.Empty; var cartItemCount = 0; - var showCheckoutButtons = true; + var displayCheckoutButtons = true; if (cartType == ShoppingCartType.Wishlist) { @@ -1695,7 +1695,7 @@ public ActionResult DeleteCartItem(int cartItemId, bool? wishlistItem) cartHtml = this.RenderPartialViewToString("CartItems", model); totalsHtml = this.InvokeAction("OrderTotals", routeValues: new RouteValueDictionary(new { isEditable = true })).ToString(); cartItemCount = cart.Count; - showCheckoutButtons = model.IsValidOrderAmount; + displayCheckoutButtons = model.IsInOrderTotalsRange; } // Updated cart. @@ -1706,7 +1706,7 @@ public ActionResult DeleteCartItem(int cartItemId, bool? wishlistItem) message = _localizationService.GetResource("ShoppingCart.DeleteCartItem.Success"), cartHtml = cartHtml, totalsHtml = totalsHtml, - showCheckoutButtons = showCheckoutButtons + displayCheckoutButtons = displayCheckoutButtons }); } @@ -2095,30 +2095,30 @@ public ActionResult OrderTotals(bool isEditable) model.ShowConfirmOrderLegalHint = _shoppingCartSettings.ShowConfirmOrderLegalHint; var customerRoleIds = customer.GetRoleIds(); - var minOrderAmountValidation = _orderProcessingService.ValidateMinOrderAmount(cart, customerRoleIds); - if (!minOrderAmountValidation.isValid) + var (isAboveMinimumOrderTotal, orderTotalMinimum) = _orderProcessingService.IsAboveMinimumOrderTotal(cart, customerRoleIds); + if (!isAboveMinimumOrderTotal) { - var minOrderAmount = _currencyService.ConvertFromPrimaryStoreCurrency( - minOrderAmountValidation.minOrderAmount, + orderTotalMinimum = _currencyService.ConvertFromPrimaryStoreCurrency( + orderTotalMinimum, currency); var resource = _orderSettings.ApplyToSubtotal ? "Checkout.MinOrderSubtotalAmount" : "Checkout.MinOrderTotalAmount"; model.OrderAmountWarning = string.Format( _localizationService.GetResource(resource), - _priceFormatter.FormatPrice(minOrderAmount, true, false)); + _priceFormatter.FormatPrice(orderTotalMinimum, true, false)); } - var maxOrderAmountValidation = _orderProcessingService.ValidateMaxOrderAmount(cart, customerRoleIds); - if (minOrderAmountValidation.isValid && !maxOrderAmountValidation.isValid) + var (isBelowOrderTotalMaximum, orderTotalMaximum) = _orderProcessingService.IsBelowOrderTotalMaximum(cart, customerRoleIds); + if (isAboveMinimumOrderTotal && !isBelowOrderTotalMaximum) { - var maxOrderAmount = _currencyService.ConvertFromPrimaryStoreCurrency( - maxOrderAmountValidation.maxOrderAmount, + orderTotalMaximum = _currencyService.ConvertFromPrimaryStoreCurrency( + orderTotalMaximum, currency); var resource = _orderSettings.ApplyToSubtotal ? "Checkout.MaxOrderSubtotalAmount" : "Checkout.MaxOrderTotalAmount"; model.OrderAmountWarning = string.Format( _localizationService.GetResource(resource), - _priceFormatter.FormatPrice(maxOrderAmount, true, false)); + _priceFormatter.FormatPrice(orderTotalMaximum, true, false)); } // Cart total @@ -2203,7 +2203,7 @@ public ActionResult RemoveDiscountCoupon() success = true, totalsHtml, discountHtml, - showCheckoutButtons = model.IsValidOrderAmount + displayCheckoutButtons = model.IsInOrderTotalsRange }); } @@ -2229,7 +2229,7 @@ public ActionResult RemoveGiftCardCode(int giftCardId) { success = true, totalsHtml, - showCheckoutButtons = model.IsValidOrderAmount + displayCheckoutButtons = model.IsInOrderTotalsRange }); } @@ -2309,7 +2309,7 @@ public ActionResult UpdateCartItem(int sciItemId, int newQuantity, bool isCartPa var cartHtml = string.Empty; var totalsHtml = string.Empty; - var showCheckoutButtons = true; + var displayCheckoutButtons = true; if (isCartPage) { @@ -2327,7 +2327,7 @@ public ActionResult UpdateCartItem(int sciItemId, int newQuantity, bool isCartPa PrepareShoppingCartModel(model, cart); cartHtml = this.RenderPartialViewToString("CartItems", model); totalsHtml = this.InvokeAction("OrderTotals", routeValues: new RouteValueDictionary(new { isEditable = true })).ToString(); - showCheckoutButtons = model.IsValidOrderAmount; + displayCheckoutButtons = model.IsInOrderTotalsRange; } } @@ -2338,7 +2338,7 @@ public ActionResult UpdateCartItem(int sciItemId, int newQuantity, bool isCartPa message = warnings, cartHtml, totalsHtml, - showCheckoutButtons + displayCheckoutButtons }); } @@ -2484,7 +2484,7 @@ public ActionResult MoveItemBetweenCartAndWishlistAjax(int cartItemId, ShoppingC }); } - var showCheckoutButtons = true; + var displayCheckoutButtons = true; var customer = _workContext.CurrentCustomer; var storeId = _storeContext.CurrentStore.Id; var cart = customer.GetCartItems(cartType, storeId); @@ -2540,7 +2540,7 @@ public ActionResult MoveItemBetweenCartAndWishlistAjax(int cartItemId, ShoppingC totalsHtml = this.InvokeAction("OrderTotals", routeValues: new RouteValueDictionary(new { isEditable = true })).ToString(); message = T("Products.ProductHasBeenAddedToTheWishlist"); cartItemCount = cart.Count; - showCheckoutButtons = model.IsValidOrderAmount; + displayCheckoutButtons = model.IsInOrderTotalsRange; } } @@ -2552,7 +2552,7 @@ public ActionResult MoveItemBetweenCartAndWishlistAjax(int cartItemId, ShoppingC cartHtml, totalsHtml, cartItemCount, - showCheckoutButtons + displayCheckoutButtons }); } } diff --git a/src/Presentation/SmartStore.Web/Models/ShoppingCart/ShoppingCartModel.cs b/src/Presentation/SmartStore.Web/Models/ShoppingCart/ShoppingCartModel.cs index a78c516c7e..44bdea536b 100644 --- a/src/Presentation/SmartStore.Web/Models/ShoppingCart/ShoppingCartModel.cs +++ b/src/Presentation/SmartStore.Web/Models/ShoppingCart/ShoppingCartModel.cs @@ -39,7 +39,7 @@ public ShoppingCartModel() public IList CheckoutAttributes { get; set; } public IList Warnings { get; set; } - public bool IsValidOrderAmount { get; set; } + public bool IsInOrderTotalsRange { get; set; } public bool TermsOfServiceEnabled { get; set; } public EstimateShippingModel EstimateShipping { get; set; } public DiscountBoxModel DiscountBox { get; set; } diff --git a/src/Presentation/SmartStore.Web/Views/ShoppingCart/Partials/OrderSummary.cshtml b/src/Presentation/SmartStore.Web/Views/ShoppingCart/Partials/OrderSummary.cshtml index 2413eee28a..3c451c5a0d 100644 --- a/src/Presentation/SmartStore.Web/Views/ShoppingCart/Partials/OrderSummary.cshtml +++ b/src/Presentation/SmartStore.Web/Views/ShoppingCart/Partials/OrderSummary.cshtml @@ -106,7 +106,7 @@
-
+