public async Task <MatHang> Create(MatHang enttity) { var mathang = _repositoryMatHang.FirstOrDefault(x => x.MaMH == enttity.MaMH); if (mathang != null) { throw new UserFriendlyException("Mat hang da ton tai"); } return(await _repositoryMatHang.InsertAsync(enttity)); }
public void Update(MatHang enitity) { _repositoryMatHang.Update(enitity); }