i have set a table to save the seq for POCO key,that i can set the key before update the POCO. but how to get the tablename from POCO type?
[TableName("dbo.SeqNums")] [PrimaryKey("TableName", AutoIncrement=false)] [ExplicitColumns] public partial class SeqNum { [Column] public string TableName { get; set; } [Column] public string Prefix { get; set; } [Column] public int? Seq { get; set; } }
i found some way is issues but PocoDataFactory.ForType no longer support.
public static string GetTableName(Type type) { // Get the corresponding table information var tableInfo = PocoDataFactory .ForType(type) .TableInfo; return tableInfo.TableName; }
i have set a table to save the seq for POCO key,that i can set the key before update the POCO. but how to get the tablename from POCO type?
[TableName("dbo.SeqNums")] [PrimaryKey("TableName", AutoIncrement=false)] [ExplicitColumns] public partial class SeqNum { [Column] public string TableName { get; set; } [Column] public string Prefix { get; set; } [Column] public int? Seq { get; set; } }
i found some way is issues but PocoDataFactory.ForType no longer support.
public static string GetTableName(Type type) { // Get the corresponding table information var tableInfo = PocoDataFactory .ForType(type) .TableInfo; return tableInfo.TableName; }