How to Enable Nullable Reference Types in Entity Developer Models
This article is for dotConnect providers with ORM support (all except Universal and SQL Server).
When generating C# entity classes with Entity Developer, properties may appear as non-nullable even though nullable reference types are expected. This applies to projects using EF Core, EF6, or NHibernate with dotConnect providers that support ORM.
Solution
Entity Developer templates for EF Core, Entity Framework 6, and NHibernate support Nullable Reference Types. The Nullable Reference Types option controls when C# 8 nullable and non-nullable reference types are generated:
Enable — nullable annotation context is enabled.
Disable — #nullable disable directives are generated.
Default — pre-C# 8.0 classic behavior is used.
Set the option: Nullable Reference Types = Enable.
With this setting, the generated fields will be nullable:
Related Articles
How to Enable Logging for SQL Complete
Logging is a standard mechanism used in many software tools to capture detailed information about application behavior, errors, and performance issues. It is particularly useful when diagnosing problems that are difficult to reproduce or analyze in ...
How to Enable Logging for Studios, Standalone Tools, and MiniTools
Logging is essential for capturing detailed information about failures and issues within the software. If reproducing or diagnosing a problem is difficult, or if deeper investigation is needed, logging can help gather more information for ...
How to Enable Logging for Source Control and Data Pump for SQL Server
Logging is essential for capturing detailed information about failures and issues in the program. If reproducing or diagnosing a problem is difficult, logging helps in providing a deeper investigation. This guide applies to the following products: ...
How to get specified Entity from TMappedCollection in EntityDAC
EntityDAC does not provide a method equivalent to TDataSet.Locate. However, you can achieve similar functionality by iterating through a collection to retrieve the desired item, as demonstrated in the EntityDAC demo ("Get Entities by Collections"). ...
Data Compare for Oracle – BINARY_DOUBLE Type Support
When using dbForge Data Compare for Oracle, it's important to understand limitations related to specific Oracle data types, especially when operating in Direct mode. Some Oracle data types are not fully supported in this mode, including: ...