I have an EF Core 2.2 application that is working fine. Then I introduce procedures and know I can do this:
...In myContext
public virtual DbSet<MyProcsDbSet> MyProcsDbSet{ get; set; }
Example call to get data:
using(var context = myContext())
{
var data = context.MyProcsDbSet.ExecuteSQL("Myproc @p0", 1);
}
This should be noted this works fine. However, when I go to create a new migration it generates a table. Fine no biggie, I will just state in the On Model Creating not to build that table.
bldr.Ignore<MyProcsDbSet>();
Nope, now when I call my procedure that was just working I get this:
Cannot create a DbSet for 'MyProcsDbSet' because this type is not included in the model for the context.
Is there a way to get a dbset for procedure returns and not have to forever suppress the want of ef core to create tables? The ability of .NET Core EF code first always seems like it's biggest drawback was with the custom objects and their creation and retrieval.