Last active
April 15, 2019 01:56
-
-
Save adlerpagliarini/0ad175df3c6e59cb761832a001864d56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ODataEntitiesConfiguration | |
{ | |
public static IEdmModel GetEdmModel(IServiceProvider provider) | |
{ | |
var builder = new ODataConventionModelBuilder(provider); | |
builder.EntitySet<Developer>(nameof(Developer)).EntityType | |
.Expand(SelectExpandType.Automatic) | |
.Filter() | |
.OrderBy() | |
.Count() | |
.Page() | |
.Select(); | |
// Enables Select for TaskToDo IF it isn't configured | |
// .HasMany(t => t.TasksToDo).Select(); | |
builder.EntitySet<TaskToDo>(nameof(TaskToDo)).EntityType | |
.Expand() | |
.Filter() | |
.OrderBy() | |
.Select(); | |
return builder.GetEdmModel(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment