/
githubmirror
/
ydb-dotnet-sdk
Обзор
Документация
Войти
/
githubmirror
/
ydb-dotnet-sdk
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/EntityFrameworkCore.Ydb.Samples/Schema.OneToOne/Models.cs
39 строк
1 KB
Kirill Kurdyukov
feat: EF samples & refactoring (#430)
28 май 2025, 19:35
Не верифицирован
28 май 2025, 19:35
942ed4c
Код
Авторство
О чём код?
namespace Schema.OneToOne; public class Department { public int Id { get; set; } public required string Name { get; set; } // Collection navigation containing children public required ICollection<Employee> Employees { get; set; } } public class Employee { public int Id { get; set; } public required string FirstName { get; set; } public required string LastName { get; set; } public required decimal Salary { get; set; } public required DateTime JoinedDate { get; set; } public int DepartmentId { get; set; } // Reference navigation to Department public Department Department { get; set; } = null!; // Reference navigation to EmployeeProfile public EmployeeProfile? Profile { get; set; } } public class EmployeeProfile { public int Id { get; set; } public required string Phone { get; set; } public required string Email { get; set; } // Required foreign key property public int EmployeeId { get; set; } // Required reference navigation to Employee public Employee Employee { get; set; } = null!; }