cs11dotnet7/vscode/PracticalApps/Northwind.Common.EntityModels.SqlServer/Employee.cs

69 lines
2.4 KiB
C#
Raw Normal View History

2022-03-13 17:17:01 +01:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Packt.Shared
{
[Index("LastName", Name = "LastName")]
[Index("PostalCode", Name = "PostalCode")]
public partial class Employee
{
public Employee()
{
InverseReportsToNavigation = new HashSet<Employee>();
Orders = new HashSet<Order>();
Territories = new HashSet<Territory>();
}
[Key]
public int EmployeeId { get; set; }
[StringLength(20)]
public string LastName { get; set; } = null!;
[StringLength(10)]
public string FirstName { get; set; } = null!;
[StringLength(30)]
public string? Title { get; set; }
[StringLength(25)]
public string? TitleOfCourtesy { get; set; }
[Column(TypeName = "datetime")]
public DateTime? BirthDate { get; set; }
[Column(TypeName = "datetime")]
public DateTime? HireDate { get; set; }
[StringLength(60)]
public string? Address { get; set; }
[StringLength(15)]
public string? City { get; set; }
[StringLength(15)]
public string? Region { get; set; }
[StringLength(10)]
public string? PostalCode { get; set; }
[StringLength(15)]
public string? Country { get; set; }
[StringLength(24)]
public string? HomePhone { get; set; }
[StringLength(4)]
public string? Extension { get; set; }
[Column(TypeName = "image")]
public byte[]? Photo { get; set; }
[Column(TypeName = "ntext")]
public string? Notes { get; set; }
public int? ReportsTo { get; set; }
[StringLength(255)]
public string? PhotoPath { get; set; }
[ForeignKey("ReportsTo")]
[InverseProperty("InverseReportsToNavigation")]
public virtual Employee? ReportsToNavigation { get; set; }
[InverseProperty("ReportsToNavigation")]
public virtual ICollection<Employee> InverseReportsToNavigation { get; set; }
[InverseProperty("Employee")]
public virtual ICollection<Order> Orders { get; set; }
[ForeignKey("EmployeeId")]
[InverseProperty("Employees")]
public virtual ICollection<Territory> Territories { get; set; }
}
}