public ActionResult Create1(VMRosterApplication obj) { List <string> ValidationError = new List <string>(); // check for validation Expression <Func <RosterApplication, bool> > SpecificEntries = item => obj.DateStarted <item.DateEnded && item.DateEnded> item.DateStarted && item.CriteriaData == obj.CrewID; List <RosterApplication> tempVM = RosterApplicationService.GetIndexSpecific(SpecificEntries); if (tempVM.Count > 0) { ValidationError.Add("Rosters already created with same criteria"); } if (ValidationError.Count == 0) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; VMRosterModel vm = RosterService.PostCreate1(obj, LoggedInUser); return(View("Create2", vm)); } else { ViewBag.ErrorList = ValidationError.ToList(); CreateHelper(); return(View("Create1", obj)); } }