public void CreateTag(int customerID, TagDto tagDto) { UserTag tag = new UserTag(); tag.Name = tagDto.Title; tag.Description = tagDto.Description; Customer customer = _repository.Load<Customer>(customerID); if (customer != null) { customer.Tags.Add(tag); } using (TransactionScope scope = new TransactionScope()) { _repository.Save<Tag>(tag); _repository.Update<Customer>(customer); scope.Complete(); } }
public void UpdateTag(TagDto tag, int customerID) { Contract.Requires<TagServicesException>(tag != null); Contract.Requires<TagServicesException>(tag.Title != null); Contract.Requires<TagServicesException>(tag.Description != null); }
public void UpdateTag(TagDto tag, int customerID) { TagServices.UpdateTag(tag, customerID); }
public void UpdateTag(TagDto tagDto, int customerID) { Tag tag = _repository.Get<Tag>(tagDto.Id); tag.Name = tagDto.Title; tag.Description = tagDto.Description; using (TransactionScope scope = new TransactionScope()) { _repository.Update(tag); _repository.Flush(); scope.Complete(); } }
public void CreateTag(int customerID, TagDto tag) { TagServices.CreateTag(customerID, tag); }