1. To enable debug output to visual studio output window, when creating the dbContext, set the Database.log to System.Diagnostics.Debug as below
public mysqldbEntities()
: base("name=mysqldbEntities")
{
this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
System.Diagnostics.Debug.WriteLine("log enabled");
}
2. When EntityFramework is used to retrieve data from database, the controller name must match the EntitySet's name defined in Register method as below
public static void Register(HttpConfiguration config)
{
ODataModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet<Product>("Product");
config.MapODataServiceRoute(
routeName: "ODataRoute",
routePrefix: null,
model: builder.GetEdmModel());
public mysqldbEntities()
: base("name=mysqldbEntities")
{
this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
System.Diagnostics.Debug.WriteLine("log enabled");
}
2. When EntityFramework is used to retrieve data from database, the controller name must match the EntitySet's name defined in Register method as below
public static void Register(HttpConfiguration config)
{
ODataModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet<Product>("Product");
config.MapODataServiceRoute(
routeName: "ODataRoute",
routePrefix: null,
model: builder.GetEdmModel());
public class ProductController : ODataController
{
...
}
3. When routing the request, WebAPI controller matches controller and action name case insensitive. But oDataController matches controller and action name case sensitive.
3. When routing the request, WebAPI controller matches controller and action name case insensitive. But oDataController matches controller and action name case sensitive.
No comments:
Post a Comment