/
githubmirror
/
ydb-dotnet-sdk
Обзор
Документация
Войти
/
githubmirror
/
ydb-dotnet-sdk
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/EntityFrameworkCore.Ydb.Samples/Schema.OneToMany/Models.cs
25 строк
703 B
Kirill Kurdyukov
feat: EF samples & refactoring (#430)
28 май 2025, 19:35
Не верифицирован
28 май 2025, 19:35
942ed4c
Код
Авторство
О чём код?
namespace Schema.OneToMany; 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; } // Required foreign key property public int DepartmentId { get; set; } // Required reference navigation to parent public Department Department { get; set; } = null!; }