This is my table ts_grp_perm_mapping
grp_permid grp_id perm_id
22 4 1
23 2 2
This is my code to delete row.
usr_groupId below is grp_id in above table.
usr_doctypeids below is perm_id in above table.
public int saveNewUser(int usr_groupId, int usr_doctypeids)
{
ts_grp_perm_mapping tm = db.ts_grp_perm_mapping.Find(usr_groupId);
db.ts_grp_perm_mapping.Remove(tm);
int rowiseffected=db.SaveChanges();
return rowiseffected;
}
When I trace my tm shows null, and error pops up like values cannot be null. So where I am going wrong?
ts_grp_perm_mapping.