Skip to content

Commit

Permalink
Make namespace and class name change for new package
Browse files Browse the repository at this point in the history
  • Loading branch information
chinadragon0515 committed Aug 23, 2016
1 parent 22f5949 commit 22b7f50
Show file tree
Hide file tree
Showing 43 changed files with 84 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .nuget/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="OData Feed" value="https://www.myget.org/F/odata/" />
<!-- add key="WebApi Nightly" value="https://www.myget.org/F/aspnetwebstacknightly/" / -->
<add key="WebApi Nightly" value="https://www.myget.org/F/aspnetwebstacknightly/" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion src/Microsoft.Restier.Core/Microsoft.Restier.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<dependencies>
<dependency id="Microsoft.Extensions.DependencyInjection" version="[1.0.0]" />
<dependency id="Microsoft.Extensions.DependencyInjection.Abstractions" version="[1.0.0]" />
<dependency id="Microsoft.OData.Edm" version="[6.15.0, 7.0.0)" />
<dependency id="Microsoft.OData.Edm" version="[7.0.0, 8.0.0)" />
</dependencies>
</metadata>
</package>
1 change: 0 additions & 1 deletion src/Microsoft.Restier.Core/Model/EdmHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Globalization;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;

namespace Microsoft.Restier.Core.Model
{
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.Restier.Core/Query/QueryExpressionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;
using Microsoft.Restier.Core.Model;

namespace Microsoft.Restier.Core.Query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected T DbContext
/// The <see cref="IServiceCollection"/>.
/// </returns>
[CLSCompliant(false)]
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
Type apiType = this.GetType();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.OData.Edm.Library;
using Microsoft.OData.Edm;
using Microsoft.Restier.Core;
using Microsoft.Restier.Core.Query;
using Microsoft.Restier.Core.Submit;
Expand Down
11 changes: 4 additions & 7 deletions src/Microsoft.Restier.Publishers.OData/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
using System.Web.OData;
using System.Web.OData.Formatter;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Annotations;
using Microsoft.OData.Edm.Library;
using Microsoft.OData.Edm.Library.Annotations;
using Microsoft.OData.Edm.Library.Values;
using Microsoft.OData.Edm.Vocabularies;
using Microsoft.OData.Edm.Vocabularies.V1;
using Microsoft.Restier.Core;
using Microsoft.Restier.Publishers.OData.Model;
Expand Down Expand Up @@ -59,9 +56,9 @@ public static bool IsConcurrencyCheckEnabled(this IEdmModel model, IEdmEntitySet
}

needCurrencyCheck = false;
var annotations = model.FindVocabularyAnnotations<IEdmValueAnnotation>(
var annotations = model.FindVocabularyAnnotations<IEdmVocabularyAnnotation>(
entitySet, CoreVocabularyModel.ConcurrencyTerm);
IEdmValueAnnotation annotation = annotations.FirstOrDefault();
var annotation = annotations.FirstOrDefault();
if (annotation != null)
{
needCurrencyCheck = true;
Expand Down Expand Up @@ -122,7 +119,7 @@ public static IDictionary<string, PropertyAttributes> RetrievePropertiesAttribut
var attributes = PropertyAttributes.None;
foreach (var annotation in annotations)
{
var valueAnnotation = annotation as EdmAnnotation;
var valueAnnotation = annotation as EdmVocabularyAnnotation;
if (valueAnnotation == null)
{
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using System.Web.Http;
using System.Web.Http.Filters;
using System.Web.Http.Results;
using Microsoft.OData.Core;
using Microsoft.OData;
using Microsoft.Restier.Core;
using Microsoft.Restier.Core.Submit;
using Net::System.Net.Http.Formatting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Web.OData;
using System.Web.OData.Formatter.Deserialization;
using Microsoft.OData.Core;
using Microsoft.OData;
using Microsoft.OData.Edm;

namespace Microsoft.Restier.Publishers.OData.Formatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;
using System.Web.OData.Formatter.Serialization;
using Microsoft.OData.Core;
using Microsoft.OData;

namespace Microsoft.Restier.Publishers.OData.Formatter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;
using System.Web.OData.Formatter.Serialization;
using Microsoft.OData.Core;
using Microsoft.OData;

namespace Microsoft.Restier.Publishers.OData.Formatter
{
Expand All @@ -12,6 +12,14 @@ namespace Microsoft.Restier.Publishers.OData.Formatter
/// </summary>
public class RestierEnumSerializer : ODataEnumSerializer
{
/// <summary>
/// Initializes a new instance of the <see cref="RestierEnumSerializer" /> class.
/// </summary>
/// <param name="provider">The serializer provider.</param>
public RestierEnumSerializer(ODataSerializerProvider provider) : base(provider)
{
}

/// <summary>
/// Writes the enum result to the response message.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;
using System.Web.OData.Formatter.Serialization;
using Microsoft.OData.Core;
using Microsoft.OData;

namespace Microsoft.Restier.Publishers.OData.Formatter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
using System.Collections.Generic;
using System.Web.OData.Formatter.Serialization;
using System.Web.OData.Query.Expressions;
using Microsoft.OData.Core;
using Microsoft.OData;
using Microsoft.OData.Edm;

namespace Microsoft.Restier.Publishers.OData.Formatter
{
/// <summary>
/// The serializer for entity collection result.
/// The serializer for resource set result.
/// </summary>
public class RestierFeedSerializer : ODataFeedSerializer
public class RestierResourceSetSerializer : ODataResourceSetSerializer
{
/// <summary>
/// Initializes a new instance of the <see cref="RestierFeedSerializer" /> class.
/// Initializes a new instance of the <see cref="RestierResourceSetSerializer" /> class.
/// </summary>
/// <param name="provider">The serializer provider.</param>
public RestierFeedSerializer(ODataSerializerProvider provider)
public RestierResourceSetSerializer(ODataSerializerProvider provider)
: base(provider)
{
}
Expand Down Expand Up @@ -65,7 +65,7 @@ private bool TryWriteAggregationResult(
{
IEdmEntitySetBase entitySet = writeContext.NavigationSource as IEdmEntitySetBase;
IEdmEntityTypeReference entityType = elementType.AsEntity();
ODataWriter writer = messageWriter.CreateODataFeedWriter(entitySet, entityType.EntityDefinition());
ODataWriter writer = messageWriter.CreateODataResourceSetWriter(entitySet, entityType.EntityDefinition());
WriteObjectInline(graph, feedType, writer, writeContext);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<copyright></copyright>
<dependencies>
<dependency id="Microsoft.Restier.Core" version="[0.6.0]" />
<dependency id="Microsoft.OData.Core" version="[6.15.0, 7.0.0)" />
<dependency id="Microsoft.Spatial" version="[6.15.0, 7.0.0)" />
<dependency id="Microsoft.AspNet.OData" version="[5.9.1,6.0.0)" />
<dependency id="Microsoft.OData.Core" version="[7.0.0, 8.0.0)" />
<dependency id="Microsoft.Spatial" version="[7.0.0, 8.0.0)" />
<dependency id="Microsoft.AspNet.OData" version="[6.0.0,7.0.0)" />
</dependencies>
</metadata>
</package>
1 change: 0 additions & 1 deletion src/Microsoft.Restier.Publishers.OData/Model/EdmHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Globalization;
using System.Linq;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;

namespace Microsoft.Restier.Publishers.OData.Model
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Linq;
using System.Web.OData;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;
using Microsoft.Restier.Core;
using Microsoft.Restier.Core.Model;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Threading.Tasks;
using System.Web.OData.Builder;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;
using Microsoft.Restier.Core.Model;

namespace Microsoft.Restier.Publishers.OData.Model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;
using Microsoft.Restier.Core;
using Microsoft.Restier.Core.Model;
using Microsoft.Restier.Core.Query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using Microsoft.OData.Core;
using Microsoft.OData;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;

namespace Microsoft.Restier.Publishers.OData
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ public static IServiceCollection AddODataServices<T>(this IServiceCollection ser
services.TryAddSingleton<ODataValidationSettings>();

// Make serializer and deserializer provider as DI services
services.TryAddSingleton<ODataSerializerProvider, DefaultRestierSerializerProvider>();
services.TryAddSingleton<ODataDeserializerProvider, DefaultRestierDeserializerProvider>();
// WebApi OData service provider will be added first, need to overwrite.
services.AddSingleton<ODataSerializerProvider, DefaultRestierSerializerProvider>();
services.AddSingleton<ODataDeserializerProvider, DefaultRestierDeserializerProvider>();

services.TryAddSingleton<IOperationExecutor, OperationExecutor>();

Expand Down
3 changes: 1 addition & 2 deletions test/Microsoft.Restier.Core.Tests/Api.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;
using Microsoft.Restier.Core.Model;
using Microsoft.Restier.Core.Query;
using Microsoft.Restier.Core.Submit;
Expand Down Expand Up @@ -80,7 +79,7 @@ public Task<SubmitResult> ExecuteSubmitAsync(SubmitContext context, Cancellation

private class TestApi : ApiBase
{
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
var modelBuilder = new TestModelBuilder();
var modelMapper = new TestModelMapper();
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.Restier.Core.Tests/ApiBase.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ApiBaseTests
{
private class TestApi : ApiBase
{
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
return base.ConfigureApi(services)
.MakeScoped<IService>()
Expand Down
4 changes: 2 additions & 2 deletions test/Microsoft.Restier.Core.Tests/ApiConfiguration.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public ServiceB serviceB
}
}

protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
services.AddService<IServiceA>((sp, next) => serviceA);
services.AddService<IServiceB>((sp, next) => serviceB);
Expand All @@ -103,7 +103,7 @@ protected override IServiceCollection ConfigureApi(IServiceCollection services)
}
private class TestApiC : ApiBase
{
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
var q1 = new ServiceB("q1Pre", "q1Post");
var q2 = new ServiceB("q2Pre", "q2Post");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ApiServiceA ApiService
return _service;
}
}
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
services.AddService<IServiceA>((sp, next) => ApiService);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Library;
using Microsoft.Restier.Core.Model;
using Xunit;

Expand All @@ -17,7 +16,7 @@ public class DefaultModelHandlerTests
{
private class TestApiA : ApiBase
{
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
services.AddService<IModelBuilder>((sp, next) => new TestModelProducer());
services.AddService<IModelBuilder>((sp, next) => new TestModelExtender(2)
Expand All @@ -34,7 +33,7 @@ protected override IServiceCollection ConfigureApi(IServiceCollection services)

private class TestApiB : ApiBase
{
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
var service = new TestSingleCallModelBuilder();
services.AddService<IModelBuilder>((sp, next) => service);
Expand All @@ -44,7 +43,7 @@ protected override IServiceCollection ConfigureApi(IServiceCollection services)

private class TestApiC : ApiBase
{
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
var service = new TestRetryModelBuilder();
services.AddService<IModelBuilder>((sp, next) => service);
Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.Restier.Core.Tests/PropertyBag.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void Dispose()

private class TestApi : ApiBase
{
protected override IServiceCollection ConfigureApi(IServiceCollection services)
public override IServiceCollection ConfigureApi(IServiceCollection services)
{
return base.ConfigureApi(services).AddScoped<MyPropertyBag>();
}
Expand Down
Loading

0 comments on commit 22b7f50

Please sign in to comment.