So i work according to the LINQ model and want to do an update using the where statement but i don’t know how to pass my 2 ids down…
This is my code…
The sc from my form:
tblEvk p= new tblEvk();
p.fk_externvakID = currentCategoryId;
p.fk_studentID = 2;
The bll:
public void update(tblEvk p)
{
DALstudent.update(p);
}
The DAL
public void update(tblEvk s)
{
var recordToUpdate = (from p in dc.tblEvks
where p.fk_studentID == id && p.fk_externvakID = vakid
select p).Single();
recordToUpdate.evkBijlageGepost = 1;
dc.SubmitChanges();
}
The question is how can i pass these variables? Using an insert i can just do public void insert (int id int vakid) but i cant do this with an update 🙁
If the
idandvakidare two properties of the entitytblEvkspassed to the update method, then you can just do the following: