if (collection["Department"] == "" || collection["Department"] == null || collection["Department"] == "0")
{
var Department = (from x in db.Departments
where x.Id == 1
orderby x.description ascending
select x.Id).First();
Result.DepartmentId = Department;
}
else
{
var Department = (from x in db.Departments
where x.description == collection["Department"]
orderby x.description ascending
select x.Id).First();
Result.DepartmentId = Department;
}


Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 19, 2018, 10:42 PM EDT
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 19, 2018, 10:02 PM EDT
Bongani Gumede65 reputationPosted Jul 19, 2018, 10:36 PM EDT