public void CreatePictureProfile(PictureProfileBll profile) { if (profile == null) throw new ArgumentNullException("profile"); repository.Create(profile.ToDal()); uow.Commit(); }
public void CreatePictureProfile(PictureProfileBll profile) { if (profile == null) { throw new ArgumentNullException("profile"); } repository.Create(profile.ToDal()); uow.Commit(); }
public void UpdatePictureProfile(PictureProfileBll profile) { if (profile == null) throw new ArgumentNullException("profile"); PictureProfileDal currentPictureProfile = profile.ToDal(); PictureProfileDal existedPictureProfile = repository.GetById(profile.Id); if (existedPictureProfile == null) throw new EntityNotFoundException("profile", profile.Id); existedPictureProfile.Description = currentPictureProfile.Description; existedPictureProfile.PictureId = currentPictureProfile.PictureId; existedPictureProfile.Rating = currentPictureProfile.Rating; repository.Update(existedPictureProfile); uow.Commit(); }
public void UpdatePictureProfile(PictureProfileBll profile) { if (profile == null) { throw new ArgumentNullException("profile"); } PictureProfileDal currentPictureProfile = profile.ToDal(); PictureProfileDal existedPictureProfile = repository.GetById(profile.Id); if (existedPictureProfile == null) { throw new EntityNotFoundException("profile", profile.Id); } existedPictureProfile.Description = currentPictureProfile.Description; existedPictureProfile.PictureId = currentPictureProfile.PictureId; existedPictureProfile.Rating = currentPictureProfile.Rating; repository.Update(existedPictureProfile); uow.Commit(); }