Я понял это.Мне пришлось отредактировать файл EF.Reverse.POCO.Core.ttinclude, добавив IsGeneratedAlwaysType к ряду классов, методов и SQL-запросов.Я в основном добавил его везде, где нашел 'IsForeignKey'.Я вставил ниже фрагмент того, что я добавил в каждый раздел.
public class Column
{
public bool IsGeneratedAlwaysType;
private void SetupConfig()
{
else if (IsGeneratedAlwaysType)
{
if(Settings.UseDataAnnotations)
DataAnnotations.Add("DatabaseGenerated(DatabaseGeneratedOption.Computed)");
else
databaseGeneratedOption = string.Format(".HasDatabaseGeneratedOption({0}DatabaseGeneratedOption.Computed)", schemaReference);
}
private static Column CreateColumn(IDataRecord rdr, Regex rxClean, Table table, Regex columnFilterExclude)
{
var col = new Column
{
IsGeneratedAlwaysType = rdr["IsGeneratedAlwaysType"].ToString().Trim().ToLower() == "true",
private class SqlServerSchemaReader : SchemaReader
{
private const string TableSQL = @"
CAST(CASE WHEN COLUMNPROPERTY(OBJECT_ID(QUOTENAME(c.TABLE_SCHEMA) + '.' + QUOTENAME(c.TABLE_NAME)), c.COLUMN_NAME, 'GeneratedAlwaysType') > 0 THEN 1
ELSE 0
END AS BIT) AS IsGeneratedAlwaysType
FROM #Columns c
private const string SynonymTableSQLSetup = @"
CAST(CASE WHEN COLUMNPROPERTY(OBJECT_ID(QUOTENAME(sc.NAME) + '.' + QUOTENAME(o.NAME)), c.NAME, 'GeneratedAlwaysType') > 0 THEN 1
ELSE 0
END AS BIT) AS IsGeneratedAlwaysType
INTO #SynonymDetails
FROM sys.synonyms sn
INSERT INTO #SynonymDetails (SchemaName, TableName, TableType, Ordinal, ColumnName, IsNullable, TypeName, [MaxLength], [Precision],
[Default], DateTimePrecision, Scale, IsIdentity, IsStoreGenerated, PrimaryKey, PrimaryKeyOrdinal, IsForeignKey, IsGeneratedAlwaysType)
CAST(CASE WHEN COLUMNPROPERTY(st.base_object_id, c.NAME, ''GeneratedAlwaysType'') > 0 THEN 1
ELSE 0
END AS BIT) AS IsGeneratedAlwaysType
FROM #SynonymTargets st
INNER JOIN sys.columns c
private const string SynonymTableSQL = @"
SELECT SchemaName, TableName, TableType, Ordinal, ColumnName, IsNullable, TypeName, [MaxLength], [Precision],
[Default], DateTimePrecision, Scale, IsIdentity, IsStoreGenerated, PrimaryKey, PrimaryKeyOrdinal, IsForeignKey, IsGeneratedAlwaysType FROM #SynonymDetails";
private const string TableSQLCE = @"
0 as IsGeneratedAlwaysType
FROM INFORMATION_SCHEMA.COLUMNS c