Пример #1
0
 public void AddPet(ApiPetResponseModel item)
 {
     if (!this.Pets.Any(x => x.Id == item.Id))
     {
         this.Pets.Add(item);
     }
 }
        public virtual ApiPetRequestModel MapResponseToRequest(
            ApiPetResponseModel response)
        {
            var request = new ApiPetRequestModel();

            request.SetProperties(
                response.BreedId,
                response.ClientId,
                response.Name,
                response.Weight);
            return(request);
        }
        public virtual ApiPetResponseModel MapRequestToResponse(
            int id,
            ApiPetRequestModel request)
        {
            var response = new ApiPetResponseModel();

            response.SetProperties(id,
                                   request.BreedId,
                                   request.ClientId,
                                   request.Name,
                                   request.Weight);
            return(response);
        }