I've created a simple POCO class to support user defined fields in my DevForce application. I can get instances of the POCO class into the UI, and push updates back to the server via the SaveChanges method, but an exception is always raised
on the client side after my PocoSaveAdapter executes.
My POCO object is pretty simple:
CustomField
int : Id
string : Name
string : Value
Id is marked with the [Key] attribute.
Is there something I am missing?
Here is the exception:
IdeaBlade.EntityModel.EntityManagerSaveException: EntityManager merge failure: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at IdeaBlade.Core.MemberInfoFns.BuildPropertySet(PropertyInfo property)
at IdeaBlade.EntityModel.EntityProperty.get_SetFunc()
at IdeaBlade.EntityModel.PocoEntityWrapper.CopyValues(Object sourceEntity, Object destEntity)
at IdeaBlade.EntityModel.PocoEntityWrapper.ReplaceCurrentOnLoadCore(EntityWrapper sourceWrapper)
at IdeaBlade.EntityModel.EntityWrapper.ReplaceCurrentOnLoad(EntityWrapper sourceEntity)
at IdeaBlade.EntityModel.EntityWrapper.LoadEntity(EntityWrapper sourceWrapper, MergeStrategy mergeStrategy)
at IdeaBlade.EntityModel.EntityGroup.LoadEntity(EntityWrapper sourceWrapper, MergeStrategy mergeStrategy, Boolean& rowUpdated)
at IdeaBlade.EntityModel.EntityMerger.MergeEntityCore(EntityWrapper sourceWrapper, EntityGroup targetEntityGroup)
at IdeaBlade.EntityModel.EntityMerger.MergeEntity(EntityWrapper sourceWrapper, EntityGroup targetEntityGroup, NavigationContext context)
at IdeaBlade.EntityModel.EntityMerger.<>c__DisplayClass1.<MergeEntities>b__0(EntityWrapper sourceWrapper)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at IdeaBlade.EntityModel.EntityMerger.Merge(IEnumerable`1 sourceEntityWrappersGroupedByType, NavigationContext context)
at IdeaBlade.EntityModel.EntityMerger.Merge(EntityManager targetManager, IEnumerable`1 sourceEntityWrappersGroupedByType, MergeStrategy mergeStrategy, MergeType mergeType)
at IdeaBlade.EntityModel.EntityManager.SaveEntitiesPostProcessing(SaveWorkState workState)
--- End of inner exception stack trace ---
at IdeaBlade.EntityModel.AsyncProcessor`1.<>c__DisplayClass2.<.ctor>b__0(TArgs args)
at IdeaBlade.EntityModel.AsyncProcessor`1.Signal()
at IdeaBlade.EntityModel.AsyncProcessor`1.<Execute>b__5(Object x)
Line: 56
Char: 13
Code: 0