I'm trying to call a stored procedure by using Linq. For that I wrote this code:
public class CtxDb:DbContext
{
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
public virtual ObjectResult<Employee> GetEmployee()
{
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Employee>("GetEmployee");
}
}
When I'm calling my sp from Web API I'm getting an error:
The FunctionImport 'GetEmployee' could not be found in the container 'CtxDb'