Ramakrishna Pathuri

Ramakrishna Pathuri

  • 1.2k
  • 569
  • 192.6k

Odata Instance properties Error $select Dot net core 3.1 Web

Apr 15 2020 11:16 AM
Activated Odata Support for Dotnet core 3.1 web API project
 
Dot core OData packages are installed
 
In Configure Service added
 
services.AddOData();
 
In Configure Added
 
app.UseMvc(routeBuilder =>
{
routeBuilder.EnableDependencyInjection();
routeBuilder.Expand().Select().Filter().Count().OrderBy();
routeBuilder.MapODataServiceRoute(“odata”, “odata”, GetEdmModel());
});
 
Commented UseEndpoints
 
//app.UseEndpoints(endpoints => //{ // endpoints.MapControllers(); //});
 
After running Odata Instance and querying using the $select query
[{"instance":null,"container":{},"modelID":"b8e0eab9-ec5b-41df-ac70-dc9ebb23ed0b","untypedInstance":null,"instanceType":null,"useInstanceForProperties":false},{"instance":null,"container":{},"modelID":"b8e0eab9-ec5b-41df-ac70-dc9ebb23ed0b","untypedInstance":null,"instanceType":null,"useInstanceForProperties":false},]