public List<DropDownItem> GetStateListRepo(string defaultvalue) { var ddlList = new List<DropDownItem>(); using (var context = new BlogEntities()) { var list = context.Categories.ToList(); ddlList.AddRange(list.Select(item => new DropDownItem() { Id = item.CategoryID, Name = item.CategoryName })); } return ddlList; }
public List<DropDown> GetStateList(string defaultvalue) { var mappedResult = new List<DropDown>(); using (var context = new BlogEntities()) { var list = GetStateListRepo(defaultvalue); Mapper.CreateMap<DropDownItem, DropDown>(); mappedResult = Mapper.Map<List<DropDown>>(list); } return mappedResult; }
public ActionResult Edit(string id) { using (BlogEntities _db = new BlogEntities()) { //Customer } return View(); }
public ActionResult Details(string id) { Customer objCusomer = new Customer(); using (BlogEntities _db = new BlogEntities()) { objCusomer = _userService.FindBy(id); if (objCusomer != null) { } } return View(); }
public ActionResult Delete(string id) { using (BlogEntities _db = new BlogEntities()) { //implement here } return View(); }