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 thePhBkEntity
-project - Select
Add/Class
-menu item - In the dialog enter the name for the class
- PhbkPhoneType
- Click
Add
-button
- Right Click
- Run Visual Studio and Open
- Step #2:
- Open
PhbkPhoneType.cs
-file and modify the body of the class as it is shown on the slide
- Open
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; }
}
}