Create the model

  1. In the Mvc/Models folder, create a new class and name it CustomFormWidgetModel.

  2. Open the CustomFormWidgetModel.cs file and add the following form properties:

    C#
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    
    namespace SitefinityWebApp.Mvc.Models
    {
        public class CustomFormWidgetModel
        {
            [Required]
            [DisplayName("Email")]
            public string Email { get; set; }
    
            [Required]
            [DisplayName("First meal")]
            public string FirstMeal { get; set; }
    
            [Required]
            [DisplayName("Second meal")]
            public string SecondMeal { get; set; }
    
            [Required]
            [DisplayName("Dessert")]
            public string Dessert { get; set; }
        }
    }