Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
chinadragon0515 committed Jul 14, 2016
1 parent 8c71c19 commit f8ddcbd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Microsoft.OData.Service.Sample.Trippin.Api
{
public class TrippinApi : EntityFrameworkApi<TrippinModel>
{
public new TrippinModel Context
public TrippinModel ModelContext
{
get { return DbContext; }
}
Expand Down Expand Up @@ -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,
Expand All @@ -114,7 +114,7 @@ protected IQueryable<Sponsor> OnFilterSponsor(IQueryable<Sponsor> entitySet)

private IQueryable<Person> PeopleWithFriends
{
get { return Context.People.Include("Friends"); }
get { return ModelContext.People.Include("Friends"); }
}

/// <summary>
Expand Down Expand Up @@ -292,7 +292,7 @@ public int GetNumberOfFriends(Person person)
[Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", IsBound = true)]
public int GetBoundEntitySetIEnumerable(IEnumerable<Person> people, int n)
{
return n*10;
return n * 10;
}

/// <summary>
Expand All @@ -305,7 +305,7 @@ public int GetBoundEntitySetIEnumerable(IEnumerable<Person> people, int n)
[Operation(Namespace = "Microsoft.OData.Service.Sample.Trippin.Models", IsBound = true)]
public int GetBoundEntitySetICollection(ICollection<Person> people, int n, int m)
{
return n*m;
return n * m;
}

/// <summary>
Expand Down Expand Up @@ -545,7 +545,7 @@ public IEnumerable<Person> GetWithException()
[Operation(IsBound = true)]
public int GetBoundPrimitive(int i)
{
return i*100;
return i * 100;
}

/// <summary>
Expand Down Expand Up @@ -605,7 +605,7 @@ public async Task<IEdmModel> 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));
Expand All @@ -615,7 +615,7 @@ public async Task<IEdmModel> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private TrippinModel DbContext
{
get
{
return Api.Context;
return Api.ModelContext;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private TrippinModel DbContext
{
get
{
return Api.Context;
return Api.ModelContext;
}
}

Expand Down

0 comments on commit f8ddcbd

Please sign in to comment.