Files
ProektstuZhenechka/TheCatHasPawsProject/CatHasPawsDatabase/Models/Worker.cs

35 lines
680 B
C#

using System.ComponentModel.DataAnnotations.Schema;
namespace CatHasPawsDatabase.Models;
internal class Worker
{
public required string Id { get; set; }
public required string FIO { get; set; }
public required string PostId { get; set; }
public DateTime BirthDate { get; set; }
public DateTime EmploymentDate { get; set; }
public bool IsDeleted { get; set; }
public DateTime? DateOfDelete { get; set; }
[NotMapped]
public Post? Post { get; set; }
[ForeignKey("WorkerId")]
public List<Salary>? Salaries { get; set; }
[ForeignKey("WorkerId")]
public List<Sale>? Sales { get; set; }
public Worker AddPost(Post? post)
{
Post = post;
return this;
}
}