Skip to content

DbEntityProvider.GetTable<...>() throws ArgumentNullException #33

Description

@alimbada

I'm trying to insert data into a SQLite DB using LinqPad which uses IQToolkit. The code below throws this exception (no stacktrace) when provider.GetTable<...>() is called:

ArgumentNullException: Value cannot be null.
Parameter name: key
var mailData = new Mail { // snip };

var provider = this.EntityProvider;
var mailTable = provider.GetTable<Mail>();
mailTable.Insert(mailData);

Edit: found the stacktrace

   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
   at IQToolkit.Data.Mapping.AttributeMapping.GetEntity(Type elementType, String tableId, Type entityType)
   at IQToolkit.Data.Mapping.AttributeMapping.GetEntity(Type type, String tableId)
   at IQToolkit.Data.EntityProvider.GetTable(Type type, String tableId)
   at IQToolkit.Data.EntityProvider.GetTable[T](String tableId)
   at IQToolkit.Data.EntityProvider.GetTable[T]()
   at UserQuery.Main() in C:\Users\Ammaar.Limbada\AppData\Local\Temp\LINQPad5\_bsgipmuq\query_ziohpo.cs:line 55
   at LINQPad.ExecutionModel.ClrQueryRunner.Run()
   at LINQPad.ExecutionModel.Server.RunQuery(QueryRunner runner)
   at LINQPad.ExecutionModel.Server.StartQuery(QueryRunner runner)
   at LINQPad.ExecutionModel.Server.<>c__DisplayClass151_0.<ExecuteClrQuery>b__0()
   at LINQPad.ExecutionModel.Server.SingleThreadExecuter.Work()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions