public async Task <ReqResult> AddNewItem(ItemDTO item) { var payload = _mapper.Map <Item>(item); await _context.AddAsync(payload); await _context.SaveChangesAsync(); return(ReqResult.Success); }
public async Task <Category> AddNewCategory(CategoryDTO newCategory) { var dbInsertPayload = _mapper.Map <Category>(newCategory); await _context.AddAsync(dbInsertPayload); await _context.SaveChangesAsync(); return(dbInsertPayload); }