Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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