Example #1
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));
        }
Example #2
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));
        }
Example #3
0
 public DomainViewModel GetDomainById(int id)
 {
     return(DomainMapper.MapEntityToModel(_domainRepository.GetById(id)));
 }