protected BuildingUser GetPureModel(BuildingUserDTO dto) { var pureModel = _mapper.Map <BuildingUserDTO, BuildingUser>(dto); pureModel.UsersId = dto.Users.Id; pureModel.BuildingId = dto.Building.Id; return(pureModel); }
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); }
public async Task <BuildingUserDTO> Update(BuildingUserDTO model) { return(_mapper.Map <BuildingUser, BuildingUserDTO>(await _repository.Update(GetPureModel(model)))); }