次のコードを実行すると:
var db = Database.Open();
var contact = new Contact() {FirstName = "Mark", LastName = "Rendle"} ;
db.Contacts.Insert(contact);
エラーが発生します:
リスト初期化子には、少なくとも 1 つの初期化子が含まれている必要があります
スタック トレース: System.Linq.Expressions.Expression.ListInit(NewExpression newExpression, IEnumerable 1 initializers)
at Simple.Data.Extensions.ObjectEx.MakeToDictionaryFunc(Type type)
at System.Collections.Concurrent.ConcurrentDictionary
2.GetOrAdd(TKey key, Func 1contactsx 2 valueFactory)
at Simple.Data.Extensions.ObjectEx.ObjectToDictionary(Object obj)
at Simple.Data.Commands.InsertCommand.InsertEntity(Object entity, DataStrategy dataStrategy, String tableName, ErrorCallback onError, Boolean resultRequired)
at Simple.Data.Commands.InsertCommand.DoInsert(InvokeMemberBinder binder, Object[] args, DataStrategy dataStrategy, String tableName)
at Simple.Data.Commands.InsertCommand.Execute(DataStrategy dataStrategy, DynamicTable table, InvokeMemberBinder binder, Object[] args)
at Simple.Data.DynamicTable.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
at Simple.Data.ObjectReference.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
at CallSite.Target(Closure , CallSite , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)
at ProjectXBaseDataImporter.DataSaver.PersistContacts(IEnumerable
) c:\Code\XXX\ProjectXBaseDataImporter\ProjectXBaseDataImporter\CSVImporter.cs:line 54 at ProjectXBaseDataImporter. c:\Code\XXX\ProjectXBaseDataImporter\ProjectXBaseDataImporter\CSVImporter.cs: c:\Code\XXX\ProjectXBaseDataImporter\ProjectXBaseDataImporter\CSVImporter_Test の ProjectXBaseDataImporter.DataImporter_Test.Import() の 77 行目の DataImporter.Import[T](String filePath)。 cs:32行目