I want to add Filter on Column (Del_ID is null)
below is code
public ActionResult AllUserTypes()
{
if (string.IsNullOrEmpty(Convert.ToString(Session["UserName"])))
{
RedirectToAction("Login", "Home");
}
var userid = 0;
var usertypeid = 0;
int.TryParse(Convert.ToString(Session["UserID"]), out userid);
int.TryParse(Convert.ToString(Session["usertypeid"]), out usertypeid);
if (usertypeid != 1)
{
return RedirectToAction("Admin", "DashBoard");
}
var List = new List<UserTypeMV>();
var usertypes = DB.tblUserTypes.ToList();
foreach (var Usertype in usertypes)
{
List.Add(new UserTypeMV() { UserTypeID = Usertype.UserTypeID, UserType = Usertype.UserType, Designation = Usertype.Designation,Del_ID=Usertype.Del_ID });
}
return View(List);
}
how to use where clause in above code