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));
            }
        }
Exemple #2
0
 public async Task CreateList(ListModel model)
 {
     model.Id = Guid.NewGuid();
     var list = Mapper.Map <List>(model);
     await _listRepository.Add(list);
 }
Exemple #3
0
 public void AddList(BllList list)
 {
     _listRep.Add(Mapper.ToDalList(list));
     _uow.Commit();
 }