Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alimbada opened this issue Sep 30, 2024 · 0 comments
Open

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

alimbada opened this issue Sep 30, 2024 · 0 comments

Comments

@alimbada
Copy link

alimbada commented Sep 30, 2024

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant