public async Task <IActionResult> Create(ListViewModel model) { if (ModelState.IsValid) { var newList = _mapper.Map <List>(model); newList.Items.Count.Equals(0); await _listRepository.Add(newList); await _listRepository.SaveAsync(); return(RedirectToAction("Index", "Lists")); } else { return(BadRequest(ModelState)); } }
public async Task CreateList(ListModel model) { model.Id = Guid.NewGuid(); var list = Mapper.Map <List>(model); await _listRepository.Add(list); }
public void AddList(BllList list) { _listRep.Add(Mapper.ToDalList(list)); _uow.Commit(); }