Skip to content

Update操作的时候CanUpdate=false 未生效 #803

Closed
@aprilyush

Description

@aprilyush

问题描述及重现步骤:

Update的时候IgnoreColumns和字段上属性 CanUpdate = false没有同时生效,只有IgnoreColumns生效了
实体

    [JsonProperty, Column(DbType = "varchar(30)", CanUpdate = false)]
    public string create_by { get; set; } = string.Empty;

    [JsonProperty, Column(DbType = "datetime", CanUpdate = false)]
    public DateTime create_time { get; set; }

Sqldb.Update<crm_sale_order>().SetSource(dto).IgnoreColumns(s=>new {s.tag_count,s.gateway_count}).ExecuteAffrows();
更新操作执行后create_by 和create_time 的值被更新了 CanUpdate 没有生效

数据库的具体版本

mysql5.7

安装的包

freesql2.5.2

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

.net 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions