From 42ce651d4e5a3c6aa7d8857b3b114290a6e2ae84 Mon Sep 17 00:00:00 2001 From: Vincent He Date: Thu, 4 Aug 2016 08:51:25 +0800 Subject: [PATCH] Address comments and more namespace change --- src/GlobalSuppressions.cs | 25 +++-- src/Microsoft.Restier.Core/ApiBase.cs | 3 - src/Microsoft.Restier.Core/ApiContext.cs | 2 - .../ApiContextExtensions.cs | 1 - .../ConventionBasedChangeSetConstants.cs | 2 +- .../ConventionBasedChangeSetItemAuthorizer.cs | 3 +- .../ConventionBasedChangeSetItemProcessor.cs | 3 +- .../ConventionBasedChangeSetItemValidator.cs | 14 +-- .../ConventionBasedOperationAuthorizer.cs | 2 +- .../ConventionBasedOperationProcessor.cs | 2 +- ...ConventionBasedQueryExpressionProcessor.cs | 2 +- src/Microsoft.Restier.Core/DataSourceStub.cs | 1 - .../Microsoft.Restier.Core.csproj | 2 +- .../Model/EdmHelpers.cs | 1 - .../Properties/Resources.Designer.cs | 14 +-- .../Properties/Resources.resx | 8 +- .../Query/DefaultQueryHandler.cs | 1 - .../Query/QueryRequest.cs | 1 - .../Query/QueryResult.cs | 1 - src/Microsoft.Restier.Core/QueryableSource.cs | 1 - .../ServiceCollectionExtensions.cs | 2 - .../Submit/ChangeSetItem.cs | 91 +++++++++---------- .../Submit/DefaultSubmitHandler.cs | 1 - .../Submit/SubmitContext.cs | 1 - .../Model/ModelMapper.cs | 2 +- .../Model/ModelProducer.cs | 14 +-- .../Properties/Resources.Designer.cs | 2 +- .../Query/QueryExecutor.cs | 2 +- .../Query/QueryExpressionProcessor.cs | 2 +- .../Query/QueryExpressionSourcer.cs | 4 +- .../ServiceCollectionExtensions.cs | 3 - .../Spatial/GeographyConverter.cs | 1 - .../Submit/ChangeSetInitializer.cs | 31 +++---- .../Submit/SubmitExecutor.cs | 2 +- .../Batch/RestierBatchHandler.cs | 1 - .../Extensions.cs | 1 - .../DefaultRestierSerializerProvider.cs | 1 - .../RestierCollectionSerializer.cs | 1 - .../RestierComplexTypeSerializer.cs | 1 - .../Serialization/RestierEnumSerializer.cs | 1 - .../Serialization/RestierFeedSerializer.cs | 1 - .../RestierPrimitiveSerializer.cs | 1 - .../Serialization/RestierRawSerializer.cs | 1 - .../Model/EdmHelpers.cs | 1 - .../Operation/OperationExecutor.cs | 1 - .../Properties/Resources.Designer.cs | 2 +- .../Query/RestierQueryBuilder.cs | 1 - .../RestierController.cs | 2 - .../Results/BaseCollectionResult.cs | 2 +- .../Results/BaseResult.cs | 2 +- .../Results/BaseSingleResult.cs | 2 +- .../Results/ComplexResult.cs | 2 +- .../Results/EntityCollectionResult.cs | 2 +- .../Results/EnumResult.cs | 2 +- .../Results/NonEntityCollectionResult.cs | 2 +- .../Results/PrimitiveResult.cs | 2 +- .../Results/RawResult.cs | 2 +- .../Routing/HttpConfigurationExtensions.cs | 1 - .../PublicApi.bsl | 28 +++--- 59 files changed, 134 insertions(+), 176 deletions(-) diff --git a/src/GlobalSuppressions.cs b/src/GlobalSuppressions.cs index c09361d4..dfdce66d 100644 --- a/src/GlobalSuppressions.cs +++ b/src/GlobalSuppressions.cs @@ -9,13 +9,13 @@ [assembly: SuppressMessage("Microsoft.Design", "CA1061:DoNotHideBaseClassMethods", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.Batch.RestierBatchChangeSetRequestItem.#DisposeResponses(System.Collections.Generic.IEnumerable`1)")] [assembly: SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Scope = "member", Target = "Microsoft.Restier.Core.ApiBase.#Dispose()", Justification = "Need to do some clean up before the virtual Dispose(disposing) method gets called.")] [assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "These assemblies are delay-signed.")] -[assembly: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.Model.ModelProducer.#ProduceModelAsync(Microsoft.Restier.Core.Model.ModelContext,System.Threading.CancellationToken)")] +[assembly: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.ModelProducer.#ProduceModelAsync(Microsoft.Restier.Core.Model.ModelContext,System.Threading.CancellationToken)")] [assembly: SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "Microsoft.Restier.Core.Submit.ChangeSetValidationResults")] [assembly: SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Scope = "type", Target = "Microsoft.Restier.Security.ApiPermission")] [assembly: SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Scope = "member", Target = "Microsoft.Restier.Core.Submit.ChangeSetEntry.#Type")] [assembly: SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Scope = "member", Target = "Microsoft.Restier.Core.Query.QueryModelReference.#Type")] [assembly: SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "itemValue", Scope = "member", Target = "Microsoft.Restier.Core.Submit.DataModificationItem.#ApplyPredicate(System.Linq.Expressions.ParameterExpression,System.Linq.Expressions.Expression,System.Collections.Generic.KeyValuePair`2)")] -[assembly: SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.Model.ModelProducer.#.cctor()")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.ModelProducer.#.cctor()")] [assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.RestierController`1.#GetQuery(System.Web.OData.Extensions.HttpRequestMessageProperties)", Justification = "Instance is disposed elsewhere")] [assembly: SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Scope = "type", Target = "Microsoft.Restier.Core.Submit.ChangeSetValidationException", Justification = "We do not intend to support serialization of this exception yet")] [assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly", Justification = "AssemblyInformationalVersion could be string.")] @@ -46,9 +46,6 @@ [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Core.Model")] [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Core.Operation")] [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Providers.EntityFramework")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Providers.EntityFramework.Model")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Providers.EntityFramework.Query")] -[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Providers.EntityFramework.Submit")] [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Publishers.OData")] [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Publishers.OData.Batch")] [assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Microsoft.Restier.Publishers.OData.Filters")] @@ -82,15 +79,15 @@ #region CA1704 Identifiers spelling [assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sourcer", Scope = "type", Target = "Microsoft.Restier.Core.Query.IQueryExpressionSourcer")] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sourcer", Scope = "type", Target = "Microsoft.Restier.Providers.EntityFramework.Query.QueryExpressionSourcer")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sourcer", Scope = "type", Target = "Microsoft.Restier.Providers.EntityFramework.QueryExpressionSourcer")] [assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ef", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.ServiceCollectionExtensions.#AddEfProviderServices`1(Microsoft.Extensions.DependencyInjection.IServiceCollection)")] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ef", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.Submit.ChangeSetInitializer.#ConvertToEfValue(System.Type,System.Object)")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ef", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.ChangeSetInitializer.#ConvertToEfValue(System.Type,System.Object)")] [assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Etag", Scope = "member", Target = "Microsoft.Restier.Core.Submit.DataModificationItem.#ValidateEtag(System.Linq.IQueryable)")] #endregion #region CA1709 Identifiers case [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Ef", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.ServiceCollectionExtensions.#AddEfProviderServices`1(Microsoft.Extensions.DependencyInjection.IServiceCollection)")] -[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Ef", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.Submit.ChangeSetInitializer.#ConvertToEfValue(System.Type,System.Object)")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Ef", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.ChangeSetInitializer.#ConvertToEfValue(System.Type,System.Object)")] #endregion #endregion @@ -101,7 +98,7 @@ #region CA1811 Review uncalled private code [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Core.Submit.DataModificationItem.#ServerValues")] -[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.Query.QueryExecutor.#Inner")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Providers.EntityFramework.QueryExecutor.#Inner")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.Query.RestierQueryExecutor.#Inner")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.ValidationResultDto.#Severity")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.ValidationResultDto.#PropertyName")] @@ -115,8 +112,8 @@ [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.Model.RestierModelExtender+ModelMapper.#.ctor(Microsoft.Restier.Publishers.OData.Model.RestierModelExtender)")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.Model.RestierModelExtender+ModelMapper.#ModelCache")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.Model.RestierModelExtender+ModelMapper.#InnerModelMapper")] -[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.Results.BaseResult.#EdmType")] -[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.Results.BaseResult.#Context")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.BaseResult.#EdmType")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "Microsoft.Restier.Publishers.OData.BaseResult.#Context")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Ensure.#NotNull`1(System.Nullable`1,System.String)")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Linq.Expressions.ExpressionHelperMethods.#EnumerableCastGeneric")] [assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Linq.Expressions.ExpressionHelperMethods.#EnumerableToListGeneric")] @@ -190,10 +187,10 @@ #region CA1812 Uninstantiated internal classes [assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Core.ApiBase+ApiHolder")] -[assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Core.Conventions.ConventionBasedChangeSetItemValidator")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Core.ConventionBasedChangeSetItemValidator")] [assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Core.PropertyBag")] -[assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Providers.EntityFramework.Model.ModelProducer")] -[assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Providers.EntityFramework.Query.QueryExpressionProcessor")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Providers.EntityFramework.ModelProducer")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Providers.EntityFramework.QueryExpressionProcessor")] [assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Publishers.OData.Model.RestierModelExtender+QueryExpressionExpander")] [assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Publishers.OData.Model.RestierModelExtender+QueryExpressionSourcer")] [assembly: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "Microsoft.Restier.Publishers.OData.Query.RestierQueryExecutorOptions")] diff --git a/src/Microsoft.Restier.Core/ApiBase.cs b/src/Microsoft.Restier.Core/ApiBase.cs index 486fb535..7bc5bd76 100644 --- a/src/Microsoft.Restier.Core/ApiBase.cs +++ b/src/Microsoft.Restier.Core/ApiBase.cs @@ -4,9 +4,6 @@ using System; using System.Collections.Concurrent; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Restier.Core.Conventions; -using Microsoft.Restier.Core.Query; -using Microsoft.Restier.Core.Submit; namespace Microsoft.Restier.Core { diff --git a/src/Microsoft.Restier.Core/ApiContext.cs b/src/Microsoft.Restier.Core/ApiContext.cs index 6b5dbbcf..267f8112 100644 --- a/src/Microsoft.Restier.Core/ApiContext.cs +++ b/src/Microsoft.Restier.Core/ApiContext.cs @@ -2,9 +2,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. using System; -using System.Collections.Generic; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core { diff --git a/src/Microsoft.Restier.Core/ApiContextExtensions.cs b/src/Microsoft.Restier.Core/ApiContextExtensions.cs index 4b3823ab..24383438 100644 --- a/src/Microsoft.Restier.Core/ApiContextExtensions.cs +++ b/src/Microsoft.Restier.Core/ApiContextExtensions.cs @@ -12,7 +12,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.OData.Edm; using Microsoft.Restier.Core.Model; -using Microsoft.Restier.Core.Properties; using Microsoft.Restier.Core.Query; using Microsoft.Restier.Core.Submit; diff --git a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetConstants.cs b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetConstants.cs index 9453cc77..a8a56bc3 100644 --- a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetConstants.cs +++ b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetConstants.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -namespace Microsoft.Restier.Core.Conventions +namespace Microsoft.Restier.Core { internal static class ConventionBasedChangeSetConstants { diff --git a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemAuthorizer.cs b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemAuthorizer.cs index 60ad9612..98c1f564 100644 --- a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemAuthorizer.cs +++ b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemAuthorizer.cs @@ -7,10 +7,9 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Restier.Core.Properties; using Microsoft.Restier.Core.Submit; -namespace Microsoft.Restier.Core.Conventions +namespace Microsoft.Restier.Core { /// /// A convention-based change set item authorizer. diff --git a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemProcessor.cs b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemProcessor.cs index e772780e..e8407f25 100644 --- a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemProcessor.cs +++ b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemProcessor.cs @@ -8,10 +8,9 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Restier.Core.Properties; using Microsoft.Restier.Core.Submit; -namespace Microsoft.Restier.Core.Conventions +namespace Microsoft.Restier.Core { /// /// A convention-based change set item processor which calls logic like OnInserting and OnInserted. diff --git a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemValidator.cs b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemValidator.cs index 96089171..a8e1a030 100644 --- a/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemValidator.cs +++ b/src/Microsoft.Restier.Core/Conventions/ConventionBasedChangeSetItemValidator.cs @@ -12,7 +12,7 @@ using Microsoft.Restier.Core.Submit; using DataAnnotations = System.ComponentModel.DataAnnotations; -namespace Microsoft.Restier.Core.Conventions +namespace Microsoft.Restier.Core { /// /// A convention-based change set item validator. @@ -31,14 +31,14 @@ public Task ValidateChangeSetItemAsync( DataModificationItem dataModificationItem = item as DataModificationItem; if (dataModificationItem != null) { - object entity = dataModificationItem.Resource; + object resource = dataModificationItem.Resource; // TODO GitHubIssue#50 : should this PropertyDescriptorCollection be cached? PropertyDescriptorCollection properties = - new DataAnnotations.AssociatedMetadataTypeTypeDescriptionProvider(entity.GetType()) - .GetTypeDescriptor(entity).GetProperties(); + new DataAnnotations.AssociatedMetadataTypeTypeDescriptionProvider(resource.GetType()) + .GetTypeDescriptor(resource).GetProperties(); - DataAnnotations.ValidationContext validationContext = new DataAnnotations.ValidationContext(entity); + DataAnnotations.ValidationContext validationContext = new DataAnnotations.ValidationContext(resource); foreach (PropertyDescriptor property in properties) { @@ -48,7 +48,7 @@ public Task ValidateChangeSetItemAsync( property.Attributes.OfType(); foreach (DataAnnotations.ValidationAttribute validationAttribute in validationAttributes) { - object value = property.GetValue(entity); + object value = property.GetValue(resource); DataAnnotations.ValidationResult validationResult = validationAttribute.GetValidationResult(value, validationContext); if (validationResult != DataAnnotations.ValidationResult.Success) @@ -58,7 +58,7 @@ public Task ValidateChangeSetItemAsync( Id = validationAttribute.GetType().FullName, Message = validationResult.ErrorMessage, Severity = EventLevel.Error, - Target = entity, + Target = resource, PropertyName = property.Name }); } diff --git a/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationAuthorizer.cs b/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationAuthorizer.cs index fb73963b..644374e7 100644 --- a/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationAuthorizer.cs +++ b/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationAuthorizer.cs @@ -8,7 +8,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Restier.Core.Operation; -namespace Microsoft.Restier.Core.Conventions +namespace Microsoft.Restier.Core { /// /// A convention-based operation authorizer. diff --git a/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationProcessor.cs b/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationProcessor.cs index 6adb454a..685463b6 100644 --- a/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationProcessor.cs +++ b/src/Microsoft.Restier.Core/Conventions/ConventionBasedOperationProcessor.cs @@ -9,7 +9,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Restier.Core.Operation; -namespace Microsoft.Restier.Core.Conventions +namespace Microsoft.Restier.Core { /// /// A convention-based change set item filter. diff --git a/src/Microsoft.Restier.Core/Conventions/ConventionBasedQueryExpressionProcessor.cs b/src/Microsoft.Restier.Core/Conventions/ConventionBasedQueryExpressionProcessor.cs index 5bb5ada2..e6243528 100644 --- a/src/Microsoft.Restier.Core/Conventions/ConventionBasedQueryExpressionProcessor.cs +++ b/src/Microsoft.Restier.Core/Conventions/ConventionBasedQueryExpressionProcessor.cs @@ -9,7 +9,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core.Query; -namespace Microsoft.Restier.Core.Conventions +namespace Microsoft.Restier.Core { /// /// A convention-based query expression processor which will apply OnFilter logic into query expression. diff --git a/src/Microsoft.Restier.Core/DataSourceStub.cs b/src/Microsoft.Restier.Core/DataSourceStub.cs index ecf93175..b75fd462 100644 --- a/src/Microsoft.Restier.Core/DataSourceStub.cs +++ b/src/Microsoft.Restier.Core/DataSourceStub.cs @@ -3,7 +3,6 @@ using System; using System.Linq; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core { diff --git a/src/Microsoft.Restier.Core/Microsoft.Restier.Core.csproj b/src/Microsoft.Restier.Core/Microsoft.Restier.Core.csproj index 464905eb..98bb4928 100644 --- a/src/Microsoft.Restier.Core/Microsoft.Restier.Core.csproj +++ b/src/Microsoft.Restier.Core/Microsoft.Restier.Core.csproj @@ -53,7 +53,7 @@ Shared\TypeExtensions.cs - + True True SharedResources.resx diff --git a/src/Microsoft.Restier.Core/Model/EdmHelpers.cs b/src/Microsoft.Restier.Core/Model/EdmHelpers.cs index f7b66bbd..c1dbf443 100644 --- a/src/Microsoft.Restier.Core/Model/EdmHelpers.cs +++ b/src/Microsoft.Restier.Core/Model/EdmHelpers.cs @@ -5,7 +5,6 @@ using System.Globalization; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Library; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core.Model { diff --git a/src/Microsoft.Restier.Core/Properties/Resources.Designer.cs b/src/Microsoft.Restier.Core/Properties/Resources.Designer.cs index 3bc681cf..1b0074f2 100644 --- a/src/Microsoft.Restier.Core/Properties/Resources.Designer.cs +++ b/src/Microsoft.Restier.Core/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace Microsoft.Restier.Core.Properties { +namespace Microsoft.Restier.Core { using System; @@ -115,20 +115,20 @@ internal static string DataModificationMustBeCUD { } /// - /// Looks up a localized string similar to "DataModificationItem.ApplyTo cannot be called on an IsNew item.. + /// Looks up a localized string similar to "DataModificationItem.ApplyTo cannot be called on an new resource.. /// - internal static string DataModificationNotSupportCreateEntity { + internal static string DataModificationNotSupportCreateResource { get { - return ResourceManager.GetString("DataModificationNotSupportCreateEntity", resourceCulture); + return ResourceManager.GetString("DataModificationNotSupportCreateResource", resourceCulture); } } /// - /// Looks up a localized string similar to There should have been at least one predicate applied to the query from the EntityKey. Ensure there is at least one EntityKey.. + /// Looks up a localized string similar to There should have been at least one predicate applied to the query from the resource key. Ensure there is at least one resource key.. /// - internal static string DataModificationRequiresEntityKey { + internal static string DataModificationRequiresResourceKey { get { - return ResourceManager.GetString("DataModificationRequiresEntityKey", resourceCulture); + return ResourceManager.GetString("DataModificationRequiresResourceKey", resourceCulture); } } diff --git a/src/Microsoft.Restier.Core/Properties/Resources.resx b/src/Microsoft.Restier.Core/Properties/Resources.resx index 2c86379e..62490383 100644 --- a/src/Microsoft.Restier.Core/Properties/Resources.resx +++ b/src/Microsoft.Restier.Core/Properties/Resources.resx @@ -135,11 +135,11 @@ A DataModification must be either: IsNew, IsUpdate, or IsDelete. - - "DataModificationItem.ApplyTo cannot be called on an IsNew item. + + "DataModificationItem.ApplyTo cannot be called on an new resource. - - There should have been at least one predicate applied to the query from the EntityKey. Ensure there is at least one EntityKey. + + There should have been at least one predicate applied to the query from the resource key. Ensure there is at least one resource key. Do not call the methods in 'DataSourceStub' directly. diff --git a/src/Microsoft.Restier.Core/Query/DefaultQueryHandler.cs b/src/Microsoft.Restier.Core/Query/DefaultQueryHandler.cs index e60d4e51..4ff2e713 100644 --- a/src/Microsoft.Restier.Core/Query/DefaultQueryHandler.cs +++ b/src/Microsoft.Restier.Core/Query/DefaultQueryHandler.cs @@ -9,7 +9,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.OData.Edm; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core.Query { diff --git a/src/Microsoft.Restier.Core/Query/QueryRequest.cs b/src/Microsoft.Restier.Core/Query/QueryRequest.cs index aa73d00c..25368a66 100644 --- a/src/Microsoft.Restier.Core/Query/QueryRequest.cs +++ b/src/Microsoft.Restier.Core/Query/QueryRequest.cs @@ -4,7 +4,6 @@ using System; using System.Linq; using System.Linq.Expressions; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core.Query { diff --git a/src/Microsoft.Restier.Core/Query/QueryResult.cs b/src/Microsoft.Restier.Core/Query/QueryResult.cs index fdec7e5d..5c1e07f9 100644 --- a/src/Microsoft.Restier.Core/Query/QueryResult.cs +++ b/src/Microsoft.Restier.Core/Query/QueryResult.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using Microsoft.OData.Edm; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core.Query { diff --git a/src/Microsoft.Restier.Core/QueryableSource.cs b/src/Microsoft.Restier.Core/QueryableSource.cs index 7a26f13c..9df9731d 100644 --- a/src/Microsoft.Restier.Core/QueryableSource.cs +++ b/src/Microsoft.Restier.Core/QueryableSource.cs @@ -7,7 +7,6 @@ using System.Linq; using System.Linq.Expressions; using System.Reflection; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core { diff --git a/src/Microsoft.Restier.Core/ServiceCollectionExtensions.cs b/src/Microsoft.Restier.Core/ServiceCollectionExtensions.cs index 463ccf08..3e6d547b 100644 --- a/src/Microsoft.Restier.Core/ServiceCollectionExtensions.cs +++ b/src/Microsoft.Restier.Core/ServiceCollectionExtensions.cs @@ -7,8 +7,6 @@ using System.Reflection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Restier.Core.Conventions; -using Microsoft.Restier.Core.Properties; using Microsoft.Restier.Core.Query; using Microsoft.Restier.Core.Submit; diff --git a/src/Microsoft.Restier.Core/Submit/ChangeSetItem.cs b/src/Microsoft.Restier.Core/Submit/ChangeSetItem.cs index 8e930d42..4bd153eb 100644 --- a/src/Microsoft.Restier.Core/Submit/ChangeSetItem.cs +++ b/src/Microsoft.Restier.Core/Submit/ChangeSetItem.cs @@ -7,15 +7,14 @@ using System.Globalization; using System.Linq; using System.Linq.Expressions; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core.Submit { /// - /// This enum controls the actions requested for an entity. + /// This enum controls the actions requested for an resource. /// /// - /// This is required because during the post-CUD events, the EntityState has been lost. + /// This is required because during the post-CUD events, the resource state has been lost. /// This enum allows the API to remember which pre-CUD event was raised for the Resource. /// public enum DataModificationItemAction @@ -26,17 +25,17 @@ public enum DataModificationItemAction Undefined = 0, /// - /// Specifies the entity is being updated. + /// Specifies the resource is being updated. /// Update, /// - /// Specifies the entity is being inserted. + /// Specifies the resource is being inserted. /// Insert, /// - /// Specifies the entity is being removed. + /// Specifies the resource is being removed. /// Remove } @@ -53,7 +52,7 @@ internal enum ChangeSetItemType } /// - /// Possible states of an entity during a ChangeSet life cycle + /// Possible states of an resource during a ChangeSet life cycle /// internal enum ChangeSetItemProcessingStage { @@ -63,23 +62,23 @@ internal enum ChangeSetItemProcessingStage Initialized, /// - /// The entity has been validated. + /// The resource has been validated. /// Validated, /// - /// The entity set deleting, inserting or updating events are raised + /// The resource set deleting, inserting or updating events are raised /// PreEventing, /// - /// The entity was modified within its own pre eventing interception method. This indicates that the entity + /// The resource was modified within its own pre eventing interception method. This indicates that the resource /// should be revalidated but its pre eventing interception point should not be invoked again. /// ChangedWithinOwnPreEventing, /// - /// The entity's pre events have been raised + /// The resource's pre events have been raised /// PreEvented } @@ -129,32 +128,32 @@ public class DataModificationItem : ChangeSetItem /// Initializes a new instance of the class. /// /// - /// The name of the entity set in question. + /// The name of the resource set in question. /// /// - /// The type of the expected entity type in question. + /// The type of the expected resource type in question. /// /// - /// The type of the actual entity type in question. + /// The type of the actual resource type in question. /// /// /// The DataModificationItemAction for the request. /// - /// - /// The key of the entity being modified. + /// + /// The key of the resource being modified. /// /// - /// Any original values of the entity that are known. + /// Any original values of the resource that are known. /// /// - /// The local values of the entity. + /// The local values of the resource. /// public DataModificationItem( string resourceSetName, Type expectedResourceType, Type actualResourceType, DataModificationItemAction action, - IReadOnlyDictionary entityKey, + IReadOnlyDictionary resourceKey, IReadOnlyDictionary originalValues, IReadOnlyDictionary localValues) : base(ChangeSetItemType.DataModification) @@ -162,34 +161,34 @@ public DataModificationItem( Ensure.NotNull(resourceSetName, "resourceSetName"); Ensure.NotNull(expectedResourceType, "expectedResourceType"); this.ResourceSetName = resourceSetName; - this.ExpectedEntityType = expectedResourceType; + this.ExpectedResourceType = expectedResourceType; this.ActualResourceType = actualResourceType; - this.EntityKey = entityKey; + this.ResourceKey = resourceKey; this.OriginalValues = originalValues; this.LocalValues = localValues; this.DataModificationItemAction = action; } /// - /// Gets the name of the entity set in question. + /// Gets the name of the resource set in question. /// public string ResourceSetName { get; private set; } /// - /// Gets the name of the expected entity type in question. + /// Gets the name of the expected resource type in question. /// - public Type ExpectedEntityType { get; private set; } + public Type ExpectedResourceType { get; private set; } /// - /// Gets the name of the actual entity type in question. - /// In type inheritance case, this is different from expectedEntityType + /// Gets the name of the actual resource type in question. + /// In type inheritance case, this is different from expectedResourceType /// public Type ActualResourceType { get; private set; } /// - /// Gets the key of the entity being modified. + /// Gets the key of the resource being modified. /// - public IReadOnlyDictionary EntityKey { get; private set; } + public IReadOnlyDictionary ResourceKey { get; private set; } /// /// Gets or sets the action to be taken. @@ -197,11 +196,11 @@ public DataModificationItem( public DataModificationItemAction DataModificationItemAction { get; set; } /// - /// Gets or sets a value indicating whether the entity should be fully replaced by the modification. + /// Gets or sets a value indicating whether the resource should be fully replaced by the modification. /// /// /// If true, all properties will be updated, even if the property isn't in LocalValues. - /// If false, only properties identified in LocalValues will be updated on the entity. + /// If false, only properties identified in LocalValues will be updated on the resource. /// public bool IsFullReplaceUpdateRequest { get; set; } @@ -210,7 +209,7 @@ public DataModificationItem( /// /// /// Initially this will be null, however after the change - /// set has been prepared it will represent the pending entity. + /// set has been prepared it will represent the pending resource. /// public object Resource { get; set; } @@ -264,16 +263,16 @@ public IQueryable ApplyTo(IQueryable query) Ensure.NotNull(query, "query"); if (this.DataModificationItemAction == DataModificationItemAction.Insert) { - throw new InvalidOperationException(Resources.DataModificationNotSupportCreateEntity); + throw new InvalidOperationException(Resources.DataModificationNotSupportCreateResource); } Type type = query.ElementType; ParameterExpression param = Expression.Parameter(type); Expression where = null; - if (this.EntityKey != null) + if (this.ResourceKey != null) { - foreach (KeyValuePair item in this.EntityKey) + foreach (KeyValuePair item in this.ResourceKey) { where = ApplyPredicate(param, where, item); } @@ -281,7 +280,7 @@ public IQueryable ApplyTo(IQueryable query) if (where == null) { - throw new InvalidOperationException(Resources.DataModificationRequiresEntityKey); + throw new InvalidOperationException(Resources.DataModificationRequiresResourceKey); } LambdaExpression whereLambda = Expression.Lambda(where, param); @@ -322,8 +321,8 @@ public object ValidateEtag(IQueryable query) LambdaExpression whereLambda = Expression.Lambda(where, param); var queryable = ExpressionHelpers.Where(query, whereLambda, type); - var etagEntity = queryable.SingleOrDefault(); - if (etagEntity == null) + var matchedResource = queryable.SingleOrDefault(); + if (matchedResource == null) { // If ETAG does not match, should return 412 Precondition Failed var message = string.Format( @@ -333,7 +332,7 @@ public object ValidateEtag(IQueryable query) throw new PreconditionFailedException(message); } - return etagEntity; + return matchedResource; } private static Expression ApplyPredicate( @@ -362,7 +361,7 @@ private static Expression ApplyPredicate( /// /// Represents a data modification item in a change set. /// - /// The entity type. + /// The resource type. public class DataModificationItem : DataModificationItem where T : class { @@ -381,11 +380,11 @@ public class DataModificationItem : DataModificationItem /// /// The DataModificationItemAction for the request. /// - /// - /// The key of the entity being modified. + /// + /// The key of the resource being modified. /// /// - /// Any original values of the entity that are known. + /// Any original values of the resource that are known. /// /// /// The local values of the entity. @@ -395,7 +394,7 @@ public DataModificationItem( Type expectedResourceType, Type actualResourceType, DataModificationItemAction action, - IReadOnlyDictionary entityKey, + IReadOnlyDictionary resourceKey, IReadOnlyDictionary originalValues, IReadOnlyDictionary localValues) : base( @@ -403,18 +402,18 @@ public DataModificationItem( expectedResourceType, actualResourceType, action, - entityKey, + resourceKey, originalValues, localValues) { } /// - /// Gets or sets the entity object in question. + /// Gets or sets the resource object in question. /// /// /// Initially this will be null, however after the change - /// set has been prepared it will represent the pending entity. + /// set has been prepared it will represent the pending resource. /// public new T Resource { diff --git a/src/Microsoft.Restier.Core/Submit/DefaultSubmitHandler.cs b/src/Microsoft.Restier.Core/Submit/DefaultSubmitHandler.cs index adb0d709..18164b4b 100644 --- a/src/Microsoft.Restier.Core/Submit/DefaultSubmitHandler.cs +++ b/src/Microsoft.Restier.Core/Submit/DefaultSubmitHandler.cs @@ -10,7 +10,6 @@ using System.Security; using System.Threading; using System.Threading.Tasks; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core.Submit { diff --git a/src/Microsoft.Restier.Core/Submit/SubmitContext.cs b/src/Microsoft.Restier.Core/Submit/SubmitContext.cs index 8431f705..92805ad8 100644 --- a/src/Microsoft.Restier.Core/Submit/SubmitContext.cs +++ b/src/Microsoft.Restier.Core/Submit/SubmitContext.cs @@ -3,7 +3,6 @@ using System; using Microsoft.OData.Edm; -using Microsoft.Restier.Core.Properties; namespace Microsoft.Restier.Core.Submit { diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelMapper.cs b/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelMapper.cs index cf6e99a5..d0b47a8c 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelMapper.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelMapper.cs @@ -10,7 +10,7 @@ using Microsoft.Restier.Core; using Microsoft.Restier.Core.Model; -namespace Microsoft.Restier.Providers.EntityFramework.Model +namespace Microsoft.Restier.Providers.EntityFramework { /// /// Represents a model mapper based on a DbContext. diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelProducer.cs b/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelProducer.cs index 32ae4734..a94963d8 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelProducer.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Model/ModelProducer.cs @@ -19,7 +19,7 @@ using Microsoft.Restier.Core; using Microsoft.Restier.Core.Model; -namespace Microsoft.Restier.Providers.EntityFramework.Model +namespace Microsoft.Restier.Providers.EntityFramework { /// /// Represents a model producer that uses the @@ -56,8 +56,8 @@ public Task GetModelAsync(ModelContext context, CancellationToken can e => ((ICollection) e.FindPrimaryKey().Properties.Select(p => e.ClrType.GetProperty(p.Name)).ToList())); #else - var entitySetTypeMap = new Dictionary(); - var entityTypeKeyPropertiesMap = new Dictionary>(); + var resourceSetTypeMap = new Dictionary(); + var resourceTypeKeyPropertiesMap = new Dictionary>(); var dbContext = context.ApiContext.GetApiService(); var efModel = (dbContext as IObjectContextAdapter).ObjectContext.MetadataWorkspace; @@ -71,7 +71,7 @@ public Task GetModelAsync(ModelContext context, CancellationToken can Type clrType = itemCollection.GetClrType(objectSpaceType); // As entity set name and type map - entitySetTypeMap.Add(efEntitySet.Name, clrType); + resourceSetTypeMap.Add(efEntitySet.Name, clrType); ICollection keyProperties = new List(); foreach (var property in efEntityType.KeyProperties) @@ -79,11 +79,11 @@ public Task GetModelAsync(ModelContext context, CancellationToken can keyProperties.Add(clrType.GetProperty(property.Name)); } - entityTypeKeyPropertiesMap.Add(clrType, keyProperties); + resourceTypeKeyPropertiesMap.Add(clrType, keyProperties); } - context.ResourceSetTypeMap = entitySetTypeMap; - context.ResourceTypeKeyPropertiesMap = entityTypeKeyPropertiesMap; + context.ResourceSetTypeMap = resourceSetTypeMap; + context.ResourceTypeKeyPropertiesMap = resourceTypeKeyPropertiesMap; #endif if (InnerModelBuilder != null) { diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Properties/Resources.Designer.cs b/src/Microsoft.Restier.Providers.EntityFramework/Properties/Resources.Designer.cs index 27013733..d05c1dc1 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Properties/Resources.Designer.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace Microsoft.Restier.Providers.EntityFramework.Properties { +namespace Microsoft.Restier.Providers.EntityFramework { using System; diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExecutor.cs b/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExecutor.cs index 2e9f07d1..564b5e38 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExecutor.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExecutor.cs @@ -18,7 +18,7 @@ using IAsyncQueryProvider = Microsoft.EntityFrameworkCore.Query.Internal.IAsyncQueryProvider; #endif -namespace Microsoft.Restier.Providers.EntityFramework.Query +namespace Microsoft.Restier.Providers.EntityFramework { /// /// Represents a query executor that uses Entity Framework methods. diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionProcessor.cs b/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionProcessor.cs index 4a6f40fd..f9222e7d 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionProcessor.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionProcessor.cs @@ -7,7 +7,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core.Query; -namespace Microsoft.Restier.Providers.EntityFramework.Query +namespace Microsoft.Restier.Providers.EntityFramework { /// /// A query expression filter to handle EF related logic. diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionSourcer.cs b/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionSourcer.cs index 58cb0c97..2a2791fd 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionSourcer.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Query/QueryExpressionSourcer.cs @@ -13,7 +13,7 @@ using Microsoft.Restier.Core; using Microsoft.Restier.Core.Query; -namespace Microsoft.Restier.Providers.EntityFramework.Query +namespace Microsoft.Restier.Providers.EntityFramework { /// /// Represents a query expression sourcer that uses a DbContext. @@ -38,7 +38,7 @@ public Expression ReplaceQueryableSource(QueryExpressionContext context, bool em if (context.ModelReference.EntitySet == null) { - // EF provider can only source *EntitySet*. + // EF provider can only source *ResourceSet*. return null; } diff --git a/src/Microsoft.Restier.Providers.EntityFramework/ServiceCollectionExtensions.cs b/src/Microsoft.Restier.Providers.EntityFramework/ServiceCollectionExtensions.cs index 5edf35b6..748d7df1 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/ServiceCollectionExtensions.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/ServiceCollectionExtensions.cs @@ -12,9 +12,6 @@ using Microsoft.Restier.Core.Model; using Microsoft.Restier.Core.Query; using Microsoft.Restier.Core.Submit; -using Microsoft.Restier.Providers.EntityFramework.Model; -using Microsoft.Restier.Providers.EntityFramework.Query; -using Microsoft.Restier.Providers.EntityFramework.Submit; namespace Microsoft.Restier.Providers.EntityFramework { diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Spatial/GeographyConverter.cs b/src/Microsoft.Restier.Providers.EntityFramework/Spatial/GeographyConverter.cs index 3b74a8c8..076f688a 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Spatial/GeographyConverter.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Spatial/GeographyConverter.cs @@ -5,7 +5,6 @@ using System.Data.Entity.Spatial; using System.Globalization; using System.Text; -using Microsoft.Restier.Providers.EntityFramework.Properties; using Microsoft.Spatial; namespace Microsoft.Restier.Providers.EntityFramework diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Submit/ChangeSetInitializer.cs b/src/Microsoft.Restier.Providers.EntityFramework/Submit/ChangeSetInitializer.cs index 21b56a71..6eb0da76 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Submit/ChangeSetInitializer.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Submit/ChangeSetInitializer.cs @@ -16,10 +16,9 @@ using Microsoft.Restier.Core; using Microsoft.Restier.Core.Query; using Microsoft.Restier.Core.Submit; -using Microsoft.Restier.Providers.EntityFramework.Properties; using Microsoft.Spatial; -namespace Microsoft.Restier.Providers.EntityFramework.Submit +namespace Microsoft.Restier.Providers.EntityFramework { /// /// To prepare changed entries for the given . @@ -43,7 +42,7 @@ public async Task InitializeAsync( object strongTypedDbSet = dbContext.GetType().GetProperty(entry.ResourceSetName).GetValue(dbContext); Type resourceType = strongTypedDbSet.GetType().GetGenericArguments()[0]; - // This means request entity is sub type of entity type + // This means request resource is sub type of resource type if (entry.ActualResourceType != null && resourceType != entry.ActualResourceType) { resourceType = entry.ActualResourceType; @@ -63,12 +62,12 @@ public async Task InitializeAsync( } else if (entry.DataModificationItemAction == DataModificationItemAction.Remove) { - resource = await FindEntity(context, entry, cancellationToken); + resource = await FindResource(context, entry, cancellationToken); set.Remove(resource); } else if (entry.DataModificationItemAction == DataModificationItemAction.Update) { - resource = await FindEntity(context, entry, cancellationToken); + resource = await FindResource(context, entry, cancellationToken); DbEntityEntry dbEntry = dbContext.Entry(resource); SetValues(dbEntry, entry, resourceType); @@ -117,7 +116,7 @@ public virtual object ConvertToEfValue(Type type, object value) return (TimeSpan)timeOfDayValue; } - // In case key is long type, when put an entity, key value will be from key parsing which is type of int + // In case key is long type, when put an resource, key value will be from key parsing which is type of int if (value is int && type == typeof(long)) { return Convert.ToInt64(value, CultureInfo.InvariantCulture); @@ -141,7 +140,7 @@ public virtual object ConvertToEfValue(Type type, object value) return value; } - private static async Task FindEntity( + private static async Task FindResource( SubmitContext context, DataModificationItem item, CancellationToken cancellationToken) @@ -151,8 +150,8 @@ private static async Task FindEntity( QueryResult result = await context.ApiContext.QueryAsync(new QueryRequest(query), cancellationToken); - object entity = result.Results.SingleOrDefault(); - if (entity == null) + object resource = result.Results.SingleOrDefault(); + if (resource == null) { throw new ResourceNotFoundException(Resources.ResourceNotFound); } @@ -160,14 +159,14 @@ private static async Task FindEntity( // This means no If-Match or If-None-Match header if (item.OriginalValues == null || item.OriginalValues.Count == 0) { - return entity; + return resource; } - var etagEntity = item.ValidateEtag(result.Results.AsQueryable()); - return etagEntity; + resource = item.ValidateEtag(result.Results.AsQueryable()); + return resource; } - private void SetValues(DbEntityEntry dbEntry, DataModificationItem item, Type entityType) + private void SetValues(DbEntityEntry dbEntry, DataModificationItem item, Type resourceType) { if (item.IsFullReplaceUpdateRequest) { @@ -177,10 +176,10 @@ private void SetValues(DbEntityEntry dbEntry, DataModificationItem item, Type en // - Copy over the key values and set any updated values from the client on the new instance. // - Then apply all the properties of the new instance to the instance to be updated. // This will set any unspecified properties to their default value. - object newInstance = Activator.CreateInstance(entityType); + object newInstance = Activator.CreateInstance(resourceType); - SetValues(newInstance, entityType, item.EntityKey); - SetValues(newInstance, entityType, item.LocalValues); + SetValues(newInstance, resourceType, item.ResourceKey); + SetValues(newInstance, resourceType, item.LocalValues); dbEntry.CurrentValues.SetValues(newInstance); } diff --git a/src/Microsoft.Restier.Providers.EntityFramework/Submit/SubmitExecutor.cs b/src/Microsoft.Restier.Providers.EntityFramework/Submit/SubmitExecutor.cs index 8cb757a2..85ed70a0 100644 --- a/src/Microsoft.Restier.Providers.EntityFramework/Submit/SubmitExecutor.cs +++ b/src/Microsoft.Restier.Providers.EntityFramework/Submit/SubmitExecutor.cs @@ -12,7 +12,7 @@ using Microsoft.Restier.Core; using Microsoft.Restier.Core.Submit; -namespace Microsoft.Restier.Providers.EntityFramework.Submit +namespace Microsoft.Restier.Providers.EntityFramework { /// /// To execute submission of changes to database. diff --git a/src/Microsoft.Restier.Publishers.OData/Batch/RestierBatchHandler.cs b/src/Microsoft.Restier.Publishers.OData/Batch/RestierBatchHandler.cs index 9252660a..d0542aee 100644 --- a/src/Microsoft.Restier.Publishers.OData/Batch/RestierBatchHandler.cs +++ b/src/Microsoft.Restier.Publishers.OData/Batch/RestierBatchHandler.cs @@ -11,7 +11,6 @@ using System.Web.OData.Batch; using Microsoft.OData.Core; using Microsoft.Restier.Core; -using Microsoft.Restier.Publishers.OData.Properties; namespace Microsoft.Restier.Publishers.OData.Batch { diff --git a/src/Microsoft.Restier.Publishers.OData/Extensions.cs b/src/Microsoft.Restier.Publishers.OData/Extensions.cs index fda1a5d2..ebc0eebd 100644 --- a/src/Microsoft.Restier.Publishers.OData/Extensions.cs +++ b/src/Microsoft.Restier.Publishers.OData/Extensions.cs @@ -16,7 +16,6 @@ using Microsoft.OData.Edm.Vocabularies.V1; using Microsoft.Restier.Core; using Microsoft.Restier.Publishers.OData.Model; -using Microsoft.Restier.Publishers.OData.Properties; namespace Microsoft.Restier.Publishers.OData { diff --git a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/DefaultRestierSerializerProvider.cs b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/DefaultRestierSerializerProvider.cs index c894765e..b1fc3ff8 100644 --- a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/DefaultRestierSerializerProvider.cs +++ b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/DefaultRestierSerializerProvider.cs @@ -5,7 +5,6 @@ using System.Net.Http; using System.Web.OData.Formatter.Serialization; using Microsoft.OData.Edm; -using Microsoft.Restier.Publishers.OData.Results; namespace Microsoft.Restier.Publishers.OData.Formatter { diff --git a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierCollectionSerializer.cs b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierCollectionSerializer.cs index 86174b44..8dc745bf 100644 --- a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierCollectionSerializer.cs +++ b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierCollectionSerializer.cs @@ -4,7 +4,6 @@ using System; using System.Web.OData.Formatter.Serialization; using Microsoft.OData.Core; -using Microsoft.Restier.Publishers.OData.Results; namespace Microsoft.Restier.Publishers.OData.Formatter { diff --git a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierComplexTypeSerializer.cs b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierComplexTypeSerializer.cs index 37b1a39e..72fcdfd5 100644 --- a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierComplexTypeSerializer.cs +++ b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierComplexTypeSerializer.cs @@ -4,7 +4,6 @@ using System; using System.Web.OData.Formatter.Serialization; using Microsoft.OData.Core; -using Microsoft.Restier.Publishers.OData.Results; namespace Microsoft.Restier.Publishers.OData.Formatter { diff --git a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierEnumSerializer.cs b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierEnumSerializer.cs index 034a3699..9b28db98 100644 --- a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierEnumSerializer.cs +++ b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierEnumSerializer.cs @@ -4,7 +4,6 @@ using System; using System.Web.OData.Formatter.Serialization; using Microsoft.OData.Core; -using Microsoft.Restier.Publishers.OData.Results; namespace Microsoft.Restier.Publishers.OData.Formatter { diff --git a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierFeedSerializer.cs b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierFeedSerializer.cs index 48a607d1..4bf01f4e 100644 --- a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierFeedSerializer.cs +++ b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierFeedSerializer.cs @@ -7,7 +7,6 @@ using System.Web.OData.Query.Expressions; using Microsoft.OData.Core; using Microsoft.OData.Edm; -using Microsoft.Restier.Publishers.OData.Results; namespace Microsoft.Restier.Publishers.OData.Formatter { diff --git a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierPrimitiveSerializer.cs b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierPrimitiveSerializer.cs index 5c7a566c..a63f9fd5 100644 --- a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierPrimitiveSerializer.cs +++ b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierPrimitiveSerializer.cs @@ -6,7 +6,6 @@ using Microsoft.OData.Core; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Library; -using Microsoft.Restier.Publishers.OData.Results; namespace Microsoft.Restier.Publishers.OData.Formatter { diff --git a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierRawSerializer.cs b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierRawSerializer.cs index 331af013..63a0a325 100644 --- a/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierRawSerializer.cs +++ b/src/Microsoft.Restier.Publishers.OData/Formatter/Serialization/RestierRawSerializer.cs @@ -4,7 +4,6 @@ using System; using System.Web.OData.Formatter.Serialization; using Microsoft.OData.Core; -using Microsoft.Restier.Publishers.OData.Results; namespace Microsoft.Restier.Publishers.OData.Formatter { diff --git a/src/Microsoft.Restier.Publishers.OData/Model/EdmHelpers.cs b/src/Microsoft.Restier.Publishers.OData/Model/EdmHelpers.cs index e7e29cd7..45d82483 100644 --- a/src/Microsoft.Restier.Publishers.OData/Model/EdmHelpers.cs +++ b/src/Microsoft.Restier.Publishers.OData/Model/EdmHelpers.cs @@ -6,7 +6,6 @@ using System.Linq; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Library; -using Microsoft.Restier.Publishers.OData.Properties; namespace Microsoft.Restier.Publishers.OData.Model { diff --git a/src/Microsoft.Restier.Publishers.OData/Operation/OperationExecutor.cs b/src/Microsoft.Restier.Publishers.OData/Operation/OperationExecutor.cs index b79c1c35..7e9fc474 100644 --- a/src/Microsoft.Restier.Publishers.OData/Operation/OperationExecutor.cs +++ b/src/Microsoft.Restier.Publishers.OData/Operation/OperationExecutor.cs @@ -15,7 +15,6 @@ using Microsoft.Restier.Core; using Microsoft.Restier.Core.Operation; using Microsoft.Restier.Publishers.OData.Formatter; -using Microsoft.Restier.Publishers.OData.Properties; namespace Microsoft.Restier.Publishers.OData.Operation { diff --git a/src/Microsoft.Restier.Publishers.OData/Properties/Resources.Designer.cs b/src/Microsoft.Restier.Publishers.OData/Properties/Resources.Designer.cs index 7227b780..fdb4e813 100644 --- a/src/Microsoft.Restier.Publishers.OData/Properties/Resources.Designer.cs +++ b/src/Microsoft.Restier.Publishers.OData/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace Microsoft.Restier.Publishers.OData.Properties { +namespace Microsoft.Restier.Publishers.OData { using System; diff --git a/src/Microsoft.Restier.Publishers.OData/Query/RestierQueryBuilder.cs b/src/Microsoft.Restier.Publishers.OData/Query/RestierQueryBuilder.cs index de16f56b..cb64c27f 100644 --- a/src/Microsoft.Restier.Publishers.OData/Query/RestierQueryBuilder.cs +++ b/src/Microsoft.Restier.Publishers.OData/Query/RestierQueryBuilder.cs @@ -11,7 +11,6 @@ using Microsoft.OData.Core.UriParser; using Microsoft.OData.Edm; using Microsoft.Restier.Core; -using Microsoft.Restier.Publishers.OData.Properties; namespace Microsoft.Restier.Publishers.OData.Query { diff --git a/src/Microsoft.Restier.Publishers.OData/RestierController.cs b/src/Microsoft.Restier.Publishers.OData/RestierController.cs index 74737bff..38ebec89 100644 --- a/src/Microsoft.Restier.Publishers.OData/RestierController.cs +++ b/src/Microsoft.Restier.Publishers.OData/RestierController.cs @@ -26,9 +26,7 @@ using Microsoft.Restier.Core.Submit; using Microsoft.Restier.Publishers.OData.Batch; using Microsoft.Restier.Publishers.OData.Formatter; -using Microsoft.Restier.Publishers.OData.Properties; using Microsoft.Restier.Publishers.OData.Query; -using Microsoft.Restier.Publishers.OData.Results; // This is a must for creating response with correct extension method using Net::System.Net.Http; diff --git a/src/Microsoft.Restier.Publishers.OData/Results/BaseCollectionResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/BaseCollectionResult.cs index 56ec8bb8..53b248f3 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/BaseCollectionResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/BaseCollectionResult.cs @@ -6,7 +6,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a collection of objects being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/BaseResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/BaseResult.cs index c116d636..9cd2c139 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/BaseResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/BaseResult.cs @@ -5,7 +5,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents the result of an OData query. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/BaseSingleResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/BaseSingleResult.cs index ebf87275..9ab620ee 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/BaseSingleResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/BaseSingleResult.cs @@ -7,7 +7,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a single object being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/ComplexResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/ComplexResult.cs index d4f54921..a8e26a0f 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/ComplexResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/ComplexResult.cs @@ -5,7 +5,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a single complex value being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/EntityCollectionResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/EntityCollectionResult.cs index c54a6bc3..e99e3879 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/EntityCollectionResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/EntityCollectionResult.cs @@ -5,7 +5,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a collection of entity instances being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/EnumResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/EnumResult.cs index 1ae720b2..c76f8ce8 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/EnumResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/EnumResult.cs @@ -5,7 +5,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a single enum value being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/NonEntityCollectionResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/NonEntityCollectionResult.cs index 4a806513..a2f042f2 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/NonEntityCollectionResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/NonEntityCollectionResult.cs @@ -5,7 +5,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a collection of non-entity values being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/PrimitiveResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/PrimitiveResult.cs index ced435fc..7cc4cec1 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/PrimitiveResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/PrimitiveResult.cs @@ -5,7 +5,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a single primitive value being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Results/RawResult.cs b/src/Microsoft.Restier.Publishers.OData/Results/RawResult.cs index 336cb114..fd7dede1 100644 --- a/src/Microsoft.Restier.Publishers.OData/Results/RawResult.cs +++ b/src/Microsoft.Restier.Publishers.OData/Results/RawResult.cs @@ -5,7 +5,7 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; -namespace Microsoft.Restier.Publishers.OData.Results +namespace Microsoft.Restier.Publishers.OData { /// /// Represents a raw value being returned from an action. diff --git a/src/Microsoft.Restier.Publishers.OData/Routing/HttpConfigurationExtensions.cs b/src/Microsoft.Restier.Publishers.OData/Routing/HttpConfigurationExtensions.cs index 02ba43cc..d980124d 100644 --- a/src/Microsoft.Restier.Publishers.OData/Routing/HttpConfigurationExtensions.cs +++ b/src/Microsoft.Restier.Publishers.OData/Routing/HttpConfigurationExtensions.cs @@ -14,7 +14,6 @@ using Microsoft.OData.Edm; using Microsoft.Restier.Core; using Microsoft.Restier.Publishers.OData.Batch; -using Microsoft.Restier.Publishers.OData.Properties; namespace Microsoft.Restier.Publishers.OData { diff --git a/test/Microsoft.Restier.TestCommon/PublicApi.bsl b/test/Microsoft.Restier.TestCommon/PublicApi.bsl index c0318a19..574baf43 100644 --- a/test/Microsoft.Restier.TestCommon/PublicApi.bsl +++ b/test/Microsoft.Restier.TestCommon/PublicApi.bsl @@ -491,16 +491,16 @@ public class Microsoft.Restier.Core.Submit.ChangeSetValidationException : System } public class Microsoft.Restier.Core.Submit.DataModificationItem : Microsoft.Restier.Core.Submit.ChangeSetItem { - public DataModificationItem (string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.Submit.DataModificationItemAction action, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] entityKey, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] originalValues, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] localValues) + public DataModificationItem (string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.Submit.DataModificationItemAction action, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] resourceKey, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] originalValues, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] localValues) System.Type ActualResourceType { [CompilerGeneratedAttribute(),]public get; } Microsoft.Restier.Core.Submit.DataModificationItemAction DataModificationItemAction { [CompilerGeneratedAttribute(),]public get; [CompilerGeneratedAttribute(),]public set; } - System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] EntityKey { [CompilerGeneratedAttribute(),]public get; } - System.Type ExpectedEntityType { [CompilerGeneratedAttribute(),]public get; } + System.Type ExpectedResourceType { [CompilerGeneratedAttribute(),]public get; } bool IsFullReplaceUpdateRequest { [CompilerGeneratedAttribute(),]public get; [CompilerGeneratedAttribute(),]public set; } System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] LocalValues { [CompilerGeneratedAttribute(),]public get; } System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] OriginalValues { [CompilerGeneratedAttribute(),]public get; } object Resource { [CompilerGeneratedAttribute(),]public get; [CompilerGeneratedAttribute(),]public set; } + System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] ResourceKey { [CompilerGeneratedAttribute(),]public get; } string ResourceSetName { [CompilerGeneratedAttribute(),]public get; } System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] ServerValues { [CompilerGeneratedAttribute(),]public get; } @@ -509,7 +509,7 @@ public class Microsoft.Restier.Core.Submit.DataModificationItem : Microsoft.Rest } public class Microsoft.Restier.Core.Submit.DataModificationItem`1 : Microsoft.Restier.Core.Submit.DataModificationItem { - public DataModificationItem`1 (string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.Submit.DataModificationItemAction action, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] entityKey, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] originalValues, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] localValues) + public DataModificationItem`1 (string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.Submit.DataModificationItemAction action, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] resourceKey, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] originalValues, System.Collections.Generic.IReadOnlyDictionary`2[[System.String],[System.Object]] localValues) T Resource { public get; public set; } } @@ -566,6 +566,16 @@ public sealed class Microsoft.Restier.Providers.EntityFramework.ServiceCollectio public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddEfProviderServices (Microsoft.Extensions.DependencyInjection.IServiceCollection services) } +public class Microsoft.Restier.Providers.EntityFramework.ChangeSetInitializer : IChangeSetInitializer { + public ChangeSetInitializer () + + public virtual object ConvertToEfValue (System.Type type, object value) + [ + AsyncStateMachineAttribute(), + ] + public virtual System.Threading.Tasks.Task InitializeAsync (Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) +} + public class Microsoft.Restier.Providers.EntityFramework.EntityFrameworkApi`1 : Microsoft.Restier.Core.ApiBase, IDisposable { public EntityFrameworkApi`1 () @@ -659,16 +669,6 @@ public class Microsoft.Restier.Publishers.OData.RestierPayloadValueConverter : M public virtual object ConvertToPayloadValue (object value, Microsoft.OData.Edm.IEdmTypeReference edmTypeReference) } -public class Microsoft.Restier.Providers.EntityFramework.Submit.ChangeSetInitializer : IChangeSetInitializer { - public ChangeSetInitializer () - - public virtual object ConvertToEfValue (System.Type type, object value) - [ - AsyncStateMachineAttribute(), - ] - public virtual System.Threading.Tasks.Task InitializeAsync (Microsoft.Restier.Core.Submit.SubmitContext context, System.Threading.CancellationToken cancellationToken) -} - public class Microsoft.Restier.Publishers.OData.Batch.RestierBatchChangeSetRequestItem : System.Web.OData.Batch.ChangeSetRequestItem, IDisposable { public RestierBatchChangeSetRequestItem (System.Collections.Generic.IEnumerable`1[[System.Net.Http.HttpRequestMessage]] requests, System.Func`1[[Microsoft.Restier.Core.ApiBase]] apiFactory)