42 Profil modellerini yapısal olarak oluşturma

using System.ComponentModel.DataAnnotations;

public class ProfilTemel
{
    [Required(ErrorMessage = "Ad Boş bırakılamaz")]
    public string Ad { get; set; }

    [Required(ErrorMessage = "Soyad Boş bırakılamaz")]
    public string Soyad { get; set; }

    [Required(ErrorMessage = "Okul Numarası Boş bırakılamaz")]
    [Display(Name = "Okul Numarası")]
    public string OkulNumarasi { get; set; }
}
using System.ComponentModel.DataAnnotations;

public class Kayit:ProfilTemel
{
   

    [Required(ErrorMessage = "Email Boş bırakılamaz")]
    [EmailAddress]
    public string Email { get; set; }

    [DataType(DataType.Password)]
    [Required(ErrorMessage = "Şifre Boş bırakılamaz")]
    public string Sifre { get; set; }

    [DataType(DataType.Password)]
    [Required(ErrorMessage = "Şifre Tekrarı Boş bırakılamaz")]
    [Compare("Sifre")]
    [Display(Name = "Şifre Takrarı")]
    public string SifreTekrari { get; set; }
}