Last post Oct 16, 2015 03:05 AM by Krunal Parekh
Oct 15, 2015 02:45 AM|Aleksey Mikitin|LINK
I am developing a site to use ASP.NET + DB MSSQL.
In this situation, I am writing WebAPI and I have a problem:
I need using the standard OData, to address to specific tables and make a selection.
How, for example, to work with the Student table in the request http://localhost:[port]/api/values/student get all the rows of the table.
Examples in network have clearly typed table:
public IQueryable <Student> Get ()
return _ctx.Student.AsQueryable ();
But the fact is that we need to make a universal function Get (), because the database can be added to the new tables in the process of finalization.
How do it?
Oct 15, 2015 05:03 AM|damienBod|LINK
Here's an example
Oct 15, 2015 04:44 PM|Aleksey Mikitin|LINK
I have not found a solution for yourself...
is example, wich can create new Entity Movie
1: ODataConventionModelBuilder modelBuilder = new ODataConventionModelBuilder();
3: IEdmModel model = modelBuilder.GetEdmModel();
How do I create an entity unknown to me the table?
This is possible or am I wasting my time?
Oct 16, 2015 03:05 AM|Krunal Parekh|LINK
For generic Get I would recommended you use dynamic linq.
but for Odata I am not sure if it supports generic action methods.