Skip to content

AsInsert with IDictionary<string,object> throws NullReferenceException #752

Open
@brodrigz

Description

@brodrigz

Passing an IDictionary<string,object> to .AsInsert() seems to result in an unhandled NullReferenceException
SqlKata 2.4.0
SqlKata.Execution 2.4.0

Example:

            IDictionary<string, object> obj = new ExpandoObject();
            obj.Add("col1", "value");
            QueryFactory queryFactory = new();
            queryFactory.Query("tableName").AsInsert(new[] {obj}).Get(); //throws error

Call stack:

	SqlKata.Execution.dll!SqlKata.Execution.QueryFactory.CompileAndLog(SqlKata.Query query)	Unknown
 	SqlKata.Execution.dll!SqlKata.Execution.QueryFactory.Get<object>(SqlKata.Query query, System.Data.IDbTransaction transaction, int? timeout)	Unknown
 	SqlKata.Execution.dll!SqlKata.Execution.QueryExtensions.Get<object>(SqlKata.Query query, System.Data.IDbTransaction transaction, int? timeout)	Unknown
 	SqlKata.Execution.dll!SqlKata.Execution.QueryExtensions.Get(SqlKata.Query query, System.Data.IDbTransaction transaction, int? timeout)	Unknown

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