public ActionResult Create([Bind(Include = "ID,Name,CreatedDate,UpdatedDate,IsActive,IsDeleted,CreatedByID,UpdatedByID")] CityTypeEntity cityTypeEntity) { if (ModelState.IsValid) { cityTypeEntity.CreatedByID = User.Identity.GetUserId(); cityTypeService.Add(cityTypeEntity); cityTypeService.Save(); return(RedirectToAction("Index")); } return(View(cityTypeEntity)); }
public ActionResult Create([Bind(Include = "ID,Name,CreatedDate,UpdatedDate,IsActive,IsDeleted,CityTypeID,CreatedByID,UpdatedByID")] CityEntity cityEntity) { if (ModelState.IsValid) { cityEntity.CreatedByID = User.Identity.GetUserId(); cityService.Add(cityEntity); cityService.Save(); return(RedirectToAction("Index")); } ViewBag.CityTypeID = new SelectList(cityTypeService.GetMany(e => e.IsActive == true && e.IsDeleted == false), "ID", "Name"); return(View(cityEntity)); }