public DomainViewModel UpdateDomain(int id, DomainViewModel domain) { var domainToUpdate = _domainRepository.GetById(id); DomainMapper.MapModelToEntity(domain, domainToUpdate); domainToUpdate.ModifiedBy = "TEST"; var updatedDomain = _domainRepository.Update(domainToUpdate); return(DomainMapper.MapEntityToModel(updatedDomain)); }
public DomainViewModel AddDomain(DomainViewModel domain) { var domainToAdd = DomainMapper.MapModelToEntity(domain); domainToAdd.CreatedBy = "TEST"; domainToAdd.SeedData = false; var addedDomain = _domainRepository.Add(domainToAdd); return(DomainMapper.MapEntityToModel(addedDomain)); }