Tag framework

Entity type is not part of the model for current context

The entity type <Type> is not part of the model for the current context. ExceptionType: System.InvalidOperationException System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) vid System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() vid System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext() — Slut på stackspårningen från föregående plats där ett undantag utlöstes — vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)…

Call stored procedure via DBContext

Tried to call a SP via Entity framework (DBContext) but got a exception that parameter is not supplied. My call looked like: context.Database.ExecuteSqlCommand(“NameOfSP”, new SqlParameter(“@param1”, 1), new SqlParameter(“@param2”, DateTime.Now), new SqlParameter(“@param3”, “test”)); The right call should look like: context.Database.ExecuteSqlCommand(“NameOfSP @p1,…