public JsonPatchDocument <ApiSpecialOfferRequestModel> CreatePatch(ApiSpecialOfferRequestModel model) { var patch = new JsonPatchDocument <ApiSpecialOfferRequestModel>(); patch.Replace(x => x.Category, model.Category); patch.Replace(x => x.Description, model.Description); patch.Replace(x => x.DiscountPct, model.DiscountPct); patch.Replace(x => x.EndDate, model.EndDate); patch.Replace(x => x.MaxQty, model.MaxQty); patch.Replace(x => x.MinQty, model.MinQty); patch.Replace(x => x.ModifiedDate, model.ModifiedDate); patch.Replace(x => x.Rowguid, model.Rowguid); patch.Replace(x => x.StartDate, model.StartDate); patch.Replace(x => x.Type, model.Type); return(patch); }
public virtual ApiSpecialOfferRequestModel MapResponseToRequest( ApiSpecialOfferResponseModel response) { var request = new ApiSpecialOfferRequestModel(); request.SetProperties( response.Category, response.Description, response.DiscountPct, response.EndDate, response.MaxQty, response.MinQty, response.ModifiedDate, response.Rowguid, response.StartDate, response.Type); return(request); }