Esempio n. 1
0
 public void AddSale(ApiSaleResponseModel item)
 {
     if (!this.Sales.Any(x => x.Id == item.Id))
     {
         this.Sales.Add(item);
     }
 }
        public virtual ApiSaleRequestModel MapResponseToRequest(
            ApiSaleResponseModel response)
        {
            var request = new ApiSaleRequestModel();

            request.SetProperties(
                response.Amount,
                response.FirstName,
                response.LastName,
                response.PaymentTypeId,
                response.PetId,
                response.Phone);
            return(request);
        }
        public virtual ApiSaleResponseModel MapRequestToResponse(
            int id,
            ApiSaleRequestModel request)
        {
            var response = new ApiSaleResponseModel();

            response.SetProperties(id,
                                   request.Amount,
                                   request.FirstName,
                                   request.LastName,
                                   request.PaymentTypeId,
                                   request.PetId,
                                   request.Phone);
            return(response);
        }