edandersen / core-admin

Fully automatic admin site CRUD UI generator for ASP.NET Core and .NET 8
Other
599 stars 111 forks source link

Null Foreign Key #54

Closed kyle-alm closed 2 years ago

kyle-alm commented 2 years ago

Thanks for this project - it's saving me a ton of time. Currently, I have models with foreign keys that are null by default. However, if I open one to edit it, the foreign key dropdown doesn't allow for a null entry and defaults to the first option. As a result, I can't edit the record without also setting the foreign key to a non-null value.

Of course, as a workaround, I can create default instances that serve the same purpose as null.

edandersen commented 2 years ago

This is now supported in 2.5.0. Nullable FKs will have a blank entry. The sample app has been updated to use this.