I have a database context with multiple database set. I have an edit (httpget) and an edit (httppost) method. I want to save specific data in specific datasets. How can I specify which database set I want to use? BTW, the view from of the Edit method uses several models.
My database context looks like this:
public class mycontext :DBContext
{
public DBSet<Table1> table1{get; set;}
public DBSet<Table2> table2{get; set;}
public DBSet<Table3> table3{get; set;}
}
When I define
private mycontext data = new mycontext()
The only option is data.SaveChanges()
. I want to so something like
data.table1.SaveChanges()
and pass in the data I want to save.