예제 #1
0
        public async Task <BenhNhan> Create(BenhNhan entity)
        {
            var benhNhan = _repositoryBenhNhan.FirstOrDefault(x => x.Id == entity.Id);

            if (benhNhan != null)
            {
                throw new UserFriendlyException("Da ton tai");
            }
            else
            {
                return(await _repositoryBenhNhan.InsertAsync(entity));
            }
        }
예제 #2
0
 public void Update(BenhNhan entity)
 {
     _repositoryBenhNhan.Update(entity);
 }