danielwertheim/SisoDb-Provider — Issue #5: InvalidCastException when I add indexes
Author: MikaelEliasson
Created: 2011-11-29 12:00:03+00:00
State: open

I thought this would go away after I cleared the database but I still have issues with it.

The top of the stack trace:

[InvalidCastException: Unable to cast object of type 'System.Collections.Generic.HashSet`1[System.String]' to type 'System.Collections.ICollection'.]
PineCone.Structures.Schemas.StructureTypeReflecter.GetSpecificIndexableProperties(IReflect type, ICollection`1 indexablePaths) +74
PineCone.Structures.Schemas.StructureTypeFactory.CreateFor(Type type) +339
PineCone.Structures.Schemas.StructureSchemas.<.ctor>b__0(Type t) +60
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +72
PineCone.Structures.Schemas.StructureSchemas.GetSchema(Type type) +89
SisoDb.DbUnitOfWork.Insert(T item) +116

My indexes

private ISisoDatabase Initiate()
{
var db = GetDB();
db.StructureSchemas.StructureTypeFactory
.Configurations.NewForType()
.OnlyIndexThis(c => c.Name, c => c.Type, c => c.EventInfo.EventID, c => c.EventInfo.EventName, c => c.OwnerInfo.OwnerID);
db.StructureSchemas.StructureTypeFactory
.Configurations.NewForType()
.OnlyIndexThis("StartDate", "t.UserID", "RunnerName");
return db;
}

private ISisoDatabase GetDB()
{
var cInfo = new Sql2008ConnectionInfo("sisodb:provider=Sql2008||plain:" + connectionStrings.Data);
var db = new Sql2008DbFactory().CreateDatabase(cInfo);
return db;
}