The database is : SQL server
Runtime version : LLBLgen 2.6 Final
release : Oct 9 2009.
The type initializer error is coming on running thsi LINQ query.
LinqMetaData metaData = new LinqMetaData();
var q = from c in metaData.UiFlowMachine
where c.MachId == 283
select c;
the execution of this query is not giving any data , but an error below.
The error is :
StackTrace
" at uFACTS.BusinessEntities.FactoryClasses.EntityFactoryFactory..cctor() in C:\uFACTSFramework\Service Tier\Business Logic\uFACTS.BusinessEntities\_generated\FactoryClasses\EntityFactories.cs:line 1883" string
Exception Thrown :
-
base {"The type initializer for 'uFACTS.BusinessEntities.FactoryClasses.EntityFactoryFactory' threw an exception."} System.SystemException {System.TypeInitializationException}
-
[System.NullReferenceException] {"Object reference not set to an instance of an object."} System.NullReferenceException
The line 1883 is in this method in EntityFactories.
/// <summary>Initializes the <see cref="EntityFactoryFactory"/> class.</summary>
static EntityFactoryFactory()
{
Array entityTypeValues = Enum.GetValues(typeof(uFACTS.BusinessEntities.EntityType));
foreach(int entityTypeValue in entityTypeValues)
{
IEntity dummy = GeneralEntityFactory.Create((uFACTS.BusinessEntities.EntityType)entityTypeValue);
_factoryPerType.Add(dummy.GetType(), dummy.GetEntityFactory());
}
}
I saw some links talking about the EntityType Enum and changing it and all. Could not understand what to do exactly.
The unknown entitytype is sent when we are using LINQ to LLBLGen pro .
Can you please suggest what to do?
I tried with different entities and the result is the same.
thanks
sam