Skip to content
New issue

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

SqlServer DateOnly 字段读取无法绑定 #1855

Open
MadCode1982 opened this issue Jul 9, 2024 · 0 comments
Open

SqlServer DateOnly 字段读取无法绑定 #1855

MadCode1982 opened this issue Jul 9, 2024 · 0 comments

Comments

@MadCode1982
Copy link

MadCode1982 commented Jul 9, 2024

问题描述及重现代码:

   [Column("F_PURCHASE_DATE",TypeName = "date")]
    public DateOnly? FPurchaseDate { get; set; }

  [Column("F_MAINTEN_DATE")]
  public DateOnly? FMaintenDate { get; set; }
  
  生成的获取数据的SQL 包含属性,使用Ado .net 读取拦截跳过了该属性
  
   freeSql.Aop.AuditDataReader += (_, e) =>
        {
            if (e.DataReader.GetFieldType(e.Index) == typeof(DateOnly))
                e.Value = DateOnly.MinValue;
        };
  
// c# code

数据库版本

SqlServer 2008R2

安装的Nuget包

FreeSql 3.2.832
FreeSql.Provider.SqlServerForSystem 3.2.832

.net framework/. net core? 及具体版本

.Net Core 8.0.302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant