Пример #1
0
        protected BuildingUser GetPureModel(BuildingUserDTO dto)
        {
            var pureModel = _mapper.Map <BuildingUserDTO, BuildingUser>(dto);

            pureModel.UsersId    = dto.Users.Id;
            pureModel.BuildingId = dto.Building.Id;

            return(pureModel);
        }
Пример #2
0
        public async Task <BuildingUserDTO> Insert(BuildingUserDTO model)
        {
            var pureModel = _mapper.Map <BuildingUserDTO, BuildingUser>(model);

            pureModel.UsersId    = model.Users.Id;
            pureModel.BuildingId = model.Building.Id;

            var result = _mapper.Map <BuildingUser, BuildingUserDTO>(await _repository.Insert(pureModel));

            return(result);
        }
Пример #3
0
 public async Task <BuildingUserDTO> Update(BuildingUserDTO model)
 {
     return(_mapper.Map <BuildingUser, BuildingUserDTO>(await _repository.Update(GetPureModel(model))));
 }