public Ownership CreateOwnership(OwnershipRequest Ownership) { var entityToInsert = new Ownership() { }; MergeOwnership(entityToInsert, Ownership); OwnershipRepository.Insert(entityToInsert); return(entityToInsert); }
public Ownership GetById(int OwnershipId) { var Ownership = OwnershipRepository.GetById(OwnershipId); if (Ownership == null) { throw new BadRequestException(ErrorMessages.PropiedadNoEncontrada); } return(Ownership); }
public void DeleteOwnership(int OwnershipId) { var Ownership = OwnershipRepository.GetById(OwnershipId); OwnershipRepository.Delete(Ownership); }
public Ownership UpdateOwnership(Ownership originalOwnership, OwnershipRequest Ownership) { this.MergeOwnership(originalOwnership, Ownership); OwnershipRepository.Update(originalOwnership); return(originalOwnership); }