Skip to content

支持非公开无参的实体 #2085

@seayxu

Description

@seayxu

现象:

System.MissingMethodException: No parameterless constructor defined for type 'Test.User'.
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
   at FreeSql.Internal.Utils.GetTableByEntity(Type entity, CommonUtils common)

出处:
https://github.com/dotnetcore/FreeSql/blob/master/FreeSql/Internal/UtilsExpressionTree.cs#L22

修改:将 Activator.CreateInstance(entity) 改为 Activator.CreateInstance(entity, true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions