07 First entity: Genre (for WPF and Xamarin) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki

According to the Database structure

And according to the rules defined in the article "06 Development Process Cycle"

we can start with any entity from the list: Edition, Genre, Country and Language

Let's start with Genre

  • Step #1:
    • Run Visual Studio and Open “DmLit” solution
      • Right Click “Literature” of the “Dm01Entity”-project
      • Select “Add/Class” menu item
      • In the dialog enter the name for the class
      • LitGenre
      • Click “Add”
  • Step #2:
    • Open LitGenre file and modify the body of the class as it is shown on the slide
public class LitGenre {
    [Display(Description = "Row id", Name = "Id of the genre", Prompt = "Enter Genre Id", ShortName = "Genre Id")]
    [Required]
    public int GenreId { get; set; }

    [Display(Description = "Name of the genre", Name = "Name of the genre", Prompt = "Enter Genre Name", ShortName = "Genre Name")]
    [StringLength(20, MinimumLength = 3, ErrorMessage = "Invalid")]
    [Required]
    public string GenreName { get; set; }
}