Creating the data model class

To create the data model class, perform the following procedure:

  1. From the context menu of folder Data, click Add » Class...

  2. In the Name input field, enter Testimonial.

  3. 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; }
  4. 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.

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK