bricelam/EFCore.TextTemplating

Not working with views

Closed this issue · 0 comments

Ef Core 5.0.2
For some reason it is not working with views, returns NRE in 78 line of MyEntityTypeConfigurationGenerator.cs
tableName is null in Code.Literal(tableName).

To detect the view I tried to use isView from the lines above::
var isView = EntityType.FindAnnotation("Relational:ViewDefinition") != null;

However it didn't help and as a temporary solution I fixed it with:
var tableName = EntityType.GetTableName() ?? EntityType.GetViewName();