We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在使用 fsql.Ado.Query("select * from TestTable ", CommandType.Text).ToList(); 查询时,如果列有ColumnAttribute的话,查询出来的列的值为null。
使用 fsql.Select().ToList(); 查询时,如果列有ColumnAttribute的话,查询出来的列的值正常。
表结构和数据:
CREATE TABLE [dbo].[TestTable]( [Id] [int] NOT NULL, [Name] nvarchar NULL, PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY]
GO INSERT [dbo].[TestTable] ([Id], [Name]) VALUES (1, N'name1 ') INSERT [dbo].[TestTable] ([Id], [Name]) VALUES (2, N'name2')
模型代码:
[Table(Name = "TestTable")] public class TestTable1 { public int Id { get; set; } [Column(Name ="Name")] public string NameColumn { get; set; } }
The text was updated successfully, but these errors were encountered:
Ado.Query 是单纯的 ado 操作,对特性设置无效,他是单纯的从实体类找相同名的属性。
ISelect 有特性映射行为,所以正常。
额外提醒,fsql.Select<T>().AsTable 这个方法可以以做 sql 查询。
var sql = fsql.Select<User>() .AsTable((a, b) => "(select * from user where clicks > 10)") .Page(1, 10).ToList()
请注意 AsTable 里面的 SQL 两侧的括号
Sorry, something went wrong.
回复真神速,厉害。
我觉得既然是指定sql语句查询为类型T的方法,合理是不是应该做一下列属性的处理。
No branches or pull requests
在使用
fsql.Ado.Query("select * from TestTable ", CommandType.Text).ToList();
查询时,如果列有ColumnAttribute的话,查询出来的列的值为null。
使用
fsql.Select().ToList();
查询时,如果列有ColumnAttribute的话,查询出来的列的值正常。
表结构和数据:
模型代码:
The text was updated successfully, but these errors were encountered: