Creating the data model class
To create the data model class, perform the following procedure:
-
From the context menu of folder Data, click Add » Class...
-
In the Name input field, enter Testimonial.
-
Open the file Testimonial.cs and define the testimonial properties by pasting the following code:
public Guid Id { get; set; }
public string Name { get; set; }
public string Summary { get; set; }
public string Text { get; set; }
public DateTime DatePosted { get; set; }
public decimal Rating { get; set; }
public bool Published { get; set; }
public string UrlName { get; set; }
-
Add the following constructor:
public Testimonial()
{
DatePosted = DateTime.Now;
}
Testimonial is the name of your model. You define the properties that you need to work with testimonials.
Next, you must define the fluent mappings. For more information, see Creating the fluent mappings.