Good Morning,
I have a very simple question regarding ASP.NET MVC 2 View Models.
I have created the following view model:
public class ClassifiedsListingDetailsViewModel
{
public int ListingID { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string ImageURL { get; set; }
public string Location { get; set; }
public string ListedBy { get; set; }
public string ContactDetails { get; set; }
public string CategoryName { get; set; }
}
No problems, the problems occur when trying to set the values in the controller:
var listing = db.Listings.Single(l => l.ListingID == id);
var viewModel = new ClassifiedsListingDetailsViewModel
{
ListingID = listing.ListingID;
};
When ever I trying and set ListingID, which is the first property of the view model it wants me to add a "," rather than a ";". Not sure how to overcome this?
Many Thanks, J