SimplifyNet / Simplify

Simplify is an open-source set of lightweight .NET libraries that provide infrastructure for your applications. DI and mocking friendly.

Home Page:https://simplifynet.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Foreign key naming convention one-to-one relations support

i4004 opened this issue · comments

Fixed for two examples:

With default relations
Create FK_Employee_User for Employees
User
HasOne(x => x.Employee).Cascade.All();

Employee
HasOne(x => x.User).Constrained();

With using PropertRef and Unique
Create FK_Traveler_EmployeeID for Travelers
Employee
HasOne(x => x.Traveler).PropertyRef(x => x.Employee);

Traveler
References(x => x.Employee).Unique();