From f8ddcbd55d996dc58425a6ddadba37483b22a53f Mon Sep 17 00:00:00 2001 From: Vincent He Date: Thu, 14 Jul 2016 10:08:40 +0800 Subject: [PATCH] Minor update --- .../Api/TrippinApi.cs | 16 ++++++++-------- .../Controllers/PeopleController.cs | 2 +- .../Controllers/TrippinController.cs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Api/TrippinApi.cs b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Api/TrippinApi.cs index 5a9fc510..febca760 100644 --- a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Api/TrippinApi.cs +++ b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Api/TrippinApi.cs @@ -28,7 +28,7 @@ namespace Microsoft.OData.Service.Sample.Trippin.Api { public class TrippinApi : EntityFrameworkApi { - public new TrippinModel Context + public TrippinModel ModelContext { get { return DbContext; } } @@ -87,7 +87,7 @@ public PersonWithAge PeopleWithAgeMe { get { - return Context.People.Select(p => new PersonWithAge + return ModelContext.People.Select(p => new PersonWithAge { Id = p.PersonId, UserName = p.UserName, @@ -114,7 +114,7 @@ protected IQueryable OnFilterSponsor(IQueryable entitySet) private IQueryable PeopleWithFriends { - get { return Context.People.Include("Friends"); } + get { return ModelContext.People.Include("Friends"); } } /// @@ -292,7 +292,7 @@ public int GetNumberOfFriends(Person person) [Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", IsBound = true)] public int GetBoundEntitySetIEnumerable(IEnumerable people, int n) { - return n*10; + return n * 10; } /// @@ -305,7 +305,7 @@ public int GetBoundEntitySetIEnumerable(IEnumerable people, int n) [Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", IsBound = true)] public int GetBoundEntitySetICollection(ICollection people, int n, int m) { - return n*m; + return n * m; } /// @@ -545,7 +545,7 @@ public IEnumerable GetWithException() [Operation(IsBound = true)] public int GetBoundPrimitive(int i) { - return i*100; + return i * 100; } /// @@ -605,7 +605,7 @@ public async Task GetModelAsync(ModelContext context, CancellationTok // Set computed annotation var tripType = (EdmEntityType)model.SchemaElements.Single(e => e.Name == "Trip"); var trackGuidProperty = tripType.DeclaredProperties.Single(prop => prop.Name == "TrackGuid"); - var timeStampValueProp= model.EntityContainer.FindEntitySet("Airlines").EntityType().FindProperty("TimeStampValue"); + var timeStampValueProp = model.EntityContainer.FindEntitySet("Airlines").EntityType().FindProperty("TimeStampValue"); var term = new EdmTerm("Org.OData.Core.V1", "Computed", EdmPrimitiveTypeKind.Boolean); var anno1 = new EdmAnnotation(trackGuidProperty, term, new EdmBooleanConstant(true)); var anno2 = new EdmAnnotation(timeStampValueProp, term, new EdmBooleanConstant(true)); @@ -615,7 +615,7 @@ public async Task GetModelAsync(ModelContext context, CancellationTok var personType = (EdmEntityType)model.SchemaElements.Single(e => e.Name == "Person"); var type = personType.FindProperty("PersonId").Type; - var isNullableField = typeof(EdmTypeReference).GetField("isNullable",BindingFlags.Instance | BindingFlags.NonPublic); + var isNullableField = typeof(EdmTypeReference).GetField("isNullable", BindingFlags.Instance | BindingFlags.NonPublic); if (isNullableField != null) { isNullableField.SetValue(type, false); diff --git a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/PeopleController.cs b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/PeopleController.cs index 53cc5ba5..4782d75f 100644 --- a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/PeopleController.cs +++ b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/PeopleController.cs @@ -36,7 +36,7 @@ private TrippinModel DbContext { get { - return Api.Context; + return Api.ModelContext; } } diff --git a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/TrippinController.cs b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/TrippinController.cs index 2b46870b..4d9056bd 100644 --- a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/TrippinController.cs +++ b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Controllers/TrippinController.cs @@ -34,7 +34,7 @@ private TrippinModel DbContext { get { - return Api.Context; + return Api.ModelContext; } }