示例#1
0
        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));
        }
示例#2
0
        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));
        }