The Model in this AuctionWorx Web API project defines the data to send to the authenticated client. The AuctionWorx Web API provides the APIListingnamespace RainWorx.FrameWorx
.MVC.Areas.API.Models class as a comprehensive representation of an item for sale (a listing) on the site . However, this sample is a lightweight mobile client preferring minimal HTTP traffic. For this reason, we're creating a custom subset of an APIListing called APILiteListing that includes only the fields that appear on the client screen.
The following code represents the full contents of APILiteListing.cs to be added to /Areas/Models/ in the RainWorx.FrameWorx.MVC project.
Lines 7 through 17 define 10 properties, including the listing's Title and the location of the item's image (ImageURI).
using System; namespace RainWorx.FrameWorx.MVC.Areas.API.Models { public class APILiteListing { public decimal? CurrentPrice { get; set; } public string Description { get; set; } public DateTime? EndDTTM { get; set; } public int? Hits { get; set; } public int ID { get; set; } public DateTime? StartDTTM { get; set; } public string Status { get; set; } public string Title { get; set; } public string Subtitle { get; set; } public string ImageURI { get; set; } } }
Copyright © 2002-2022. RainWorx Software. All rights reserved.