007 First entity: PhoneType - chempkovsky/CS82ANGULAR GitHub Wiki

According to the rules defined in the article 006 Development Process Cycle

We can start with any entity from the list: PhoneType or Enterprise

Let's start with PhoneType

  • Step #1:
    • Run Visual Studio and Open PhonebookSolution- solution
      • Right Click PhBk of the PhBkEntity-project
      • Select Add/Class-menu item
      • In the dialog enter the name for the class
      • PhbkPhoneType
      • Click Add-button
  • Step #2:
    • Open PhbkPhoneType.cs-file and modify the body of the class as it is shown on the slide
Click to show the PhbkPhoneType.cs file
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace PhBkEntity.PhBk
{
    public class PhbkPhoneType
    {
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Display(Description = "Row id", Name = "Phone Type Id", Prompt = "Enter Phone Type Id", ShortName = "Phone Type Id")]
        [Required]
        public int PhoneTypeId { get; set; }

        [StringLength(20, MinimumLength = 3, ErrorMessage = "Invalid")]
        [Display(Description = "Name of the Phone Type", Name = "Phone Type Name", Prompt = "Enter Phone Type Name", ShortName = "Phone Type Name")]
        [Required]
        public string PhoneTypeName { get; set; } = null!;

        [Display(Description = "Description of the Phone Type", Name = "Phone Type Description", Prompt = "Enter Phone Type Description", ShortName = "Phone Type Description")]
        [StringLength(250, ErrorMessage = "Invalid")]
        public string? PhoneTypeDesc { get; set; }
    }
}
Click to show the project structure

project structure

⚠️ **GitHub.com Fallback** ⚠️