Open awjacobson opened 3 years ago
I bypassed this logic when the table name is null and it seems to have fixed my issue on the surface. I do not know if this breaks something else???
private string BuildTemporalTableSqlFromEntityTypeConfiguration(IEntityType entityType, bool appendSeparator)
{
StringBuilder sqlBuilder = new StringBuilder();
var relationalEntityType = context.Model.FindEntityType(entityType.Name);
if (relationalEntityType is IEntityType)
{
string tableName = relationalEntityType.GetTableName();
if (tableName is not null) // the above returns null if not mapped to a table (views)
{
string schema = relationalEntityType.GetSchema() ?? "dbo";
bool isEntityConfigurationTemporal = TemporalEntitiesCache.IsEntityConfigurationTemporal(entityType);
bool isEntityTemporalInDatabase = tableHelper.IsTableTemporal(tableName, schema);
ITemporalTableSqlGenerator temporalTableSqlGenerator = temporalTableSqlGeneratorFactory
.CreateInstance(isEntityConfigurationTemporal, isEntityTemporalInDatabase, tableName, schema);
string temporalTableSql = temporalTableSqlGenerator.Generate();
if (!string.IsNullOrWhiteSpace(temporalTableSql))
{
sqlBuilder.AppendLine(temporalTableSql);
if (appendSeparator)
{
sqlBuilder.AppendLine(new string('-', 100));
}
}
}
}
return sqlBuilder.ToString();
}
I've been having the same issue with views and independently came to the same conclusion.
This doesn't appear to break anything else - any chance of getting the change added to the master?
I've been having the same issue with views and independently came to the same conclusion.
This doesn't appear to break anything else - any chance of getting the change added to the master?
Hi Pete, you are in luck! The master branch has been updated
I came across the same issue. Any time soon it's available in nuget?
I came across the same issue. Any time soon it's available in nuget?
I just downloaded the code and added the project to my solution so as I can continue work on my project. Once the NuGet's updated I'll use that instead.
Any chance of getting an updated version of this package published to NuGet?
I am looking for an example or help on using views along side temporal tables. My current implementation results in an exception when updating the database.
I have used PreventTemporalTables so that only specific tables are made temporal:
I have configured my views as follows:
When I execute
dotnet ef database update
then I receive this exception:I can see the null check in the constructor that generates the exception but I am not seeing a way to get around it: