I have a stored procedure in my sqlserver database which is returning multiple resultset.
I am using following link from msdn to read multiple resultset from SP in entity framework.
https://msdn.microsoft.com/en-us/library/jj691402(v=vs.113).aspx
To read data, I need to have DBSets in xyzDBContext class for each of the resultsets.
Model Class:
public class AreaView
{
public String Area { get; set; }
public String Weight { get; set; }
}
DBContext:
public class EnsembleAPIContext : DbContext
{
public DbSet<AreaView> area {get; set;}
// I want to prevent this table from getting created in db
}
This is how I am reading resultset and mapping it with above created dbset.
reader.NextResult();
var contributionArea = ((IObjectContextAdapter)db)
.ObjectContext
.Translate<ContributionArea>(reader, "area ", MergeOption.AppendOnly);
What I need to do is I want to create entity for these resultsets, but I dont want framework to create tables for these entities in database.
Note: Reason for doing this is, resultset which is returned by sp doesnt have a primary key, so suppose we can have a valid table created using entity without PK.
Is this possible?
Any help is appreciated.