From 5e256922e64dc9222da2d6810c2429d7e06b8c13 Mon Sep 17 00:00:00 2001 From: dailyccc <963922242@qq.com> Date: Sun, 5 Mar 2023 00:32:45 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8D=20QuestDb=20CodeFirst=20?= =?UTF-8?q?AutoSubtableAttribute/ColumnAttribute=E5=88=A4=E6=96=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs index 52e499c5..d3f51144 100644 --- a/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs +++ b/Providers/FreeSql.Provider.QuestDb/QuestDbCodeFirst.cs @@ -181,7 +181,11 @@ namespace FreeSql.QuestDb var timeAttr = propety.GetCustomAttribute(); if (timeAttr != null) { - var colName = tb.Columns.FirstOrDefault(it => it.Key == propety.Name).Value; + var ckey = propety.Name; + var colNameAttr = propety.GetCustomAttribute(); + if (!string.IsNullOrWhiteSpace(colNameAttr?.Name)) + ckey = colNameAttr.Name; + var colName = tb.Columns.FirstOrDefault(it => it.Key == ckey).Value; sbalter.Append( $" TIMESTAMP({colName.Attribute.Name}) PARTITION BY {timeAttr.SubtableType};{Environment.NewLine}"); }