020 Second entity: Enterprise - 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 continue with PhbkEnterprise

  • 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
      • PhbkEnterprise
      • Click Add-button
  • Step #2:
    • Open PhbkEnterprise.cs-file and modify the body of the class as it is shown on the slide
Click to show the PhbkEnterprise.cs file
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace PhBkEntity.PhBk
{
    public class PhbkEnterprise
    {
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Display(Description = "Row id", Name = "Id of the Enterprise", Prompt = "Enter Enterprise  Id", ShortName = "Enterprise Id")]
        [Required]
        public int EntrprsId { get; set; }

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

        [Display(Description = "Description of the Enterprise", Name = "Description of the Enterprise", Prompt = "Description Enterprise Name", ShortName = "Enterprise Description")]
        [StringLength(250, ErrorMessage = "Invalid")]
        public string? EntrprsDesc { get; set; }

    }
}
Click to show the project structure

project structure

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