Print Page | Close Window

Unable to get metadata error

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3455
Printed Date: 13-May-2026 at 8:27am


Topic: Unable to get metadata error
Posted By: scapstick
Subject: Unable to get metadata error
Date Posted: 24-May-2012 at 2:03pm
I found the problem, the AuthenticationContext wasn't set on that EntityManager.
 
I have a new error I can't find though.  When executing this statement

            var query = emInboxPromoCatalog.Member_PromoCatalog
                        .With(QueryStrategy.CacheOnly)
                        .Where(memberIDPredicate)
                        .Execute();
 
I get this error:
Unable to get metadata for LEAF.BusinessObjects.Promotions.Member_PromoCatalog. Make sure it is a valid entity type or POCO type with a KeyAttribute
   at IdeaBlade.EntityModel.EntityMetadataStore.GetEntityMetadata(Type entityType, Boolean canThrowException)
   at IdeaBlade.EntityModel.EntityManager.CreateEntityGroupAndInitialize(Type entityType)
   at IdeaBlade.EntityModel.EntityManager.GetEntityGroup(Type entityType)
   at lambda_method(Closure , EntityManager )
   at IdeaBlade.EntityModel.EntityQuery`1.ExecuteExpression()
   at IdeaBlade.EntityModel.EntityQuery`1.ExecuteCacheQuery()
   at IdeaBlade.EntityModel.EntityQueryFinder.ExecuteFind(Guid queryGuid)
   at IdeaBlade.EntityModel.EntityQueryFinder.Execute()
   at IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)
   at IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)
   at IdeaBlade.EntityModel.EntityQueryExtensions.Execute[T](IEntityQuery`1 query)
   at LEAF.DataModels.PromoCatalog.PromoCatalog_DataModel.load_InboxMemberPromoCatalogsForMemberIDAsync(Decimal memberID)
   at LEAF.DataModels.PromoCatalog.PromoCatalog_DataModel.<load_InboxMemberPromoCatalogsForMemberIDCoroutine>d__19.MoveNext()
   at IdeaBlade.EntityModel.CoroutineSerialProcessor.Process()
I don't see a request to the server yet so it looks like it's a client side isse (Silverlight).  Where should I look to try and find what is missing? 
 
Thanks,
Sean



Replies:
Posted By: sbelini
Date Posted: 24-May-2012 at 2:46pm
Sean,
 
Is all Member_PromoCatalog's partial classes shared/referenced/present in the client?
 
On a separate note, if you expect a request to the server, you should be running this query async. (This is a Silverlight app, correct?)
 
Silvio.


Posted By: scapstick
Date Posted: 25-May-2012 at 8:24am
PromoCatalog.edmx is in it's own project.  It of course has PromoCatalog.edmx.tt and the generated PromoCatalog.IB.Designer.cs in it.  No other classes.
The silverlight app has a file link to PromoCatalog.IB.Designer.cs so it gets included in the compile.
 
And I didn't know what to expect from the call but you're right, it's not a server call.


Posted By: sbelini
Date Posted: 29-May-2012 at 12:32pm
Hi Sean,
 
Does the issue only occurs with the Member_PromoCatalog entity? Also, does it only occur when querying CacheOnly? Is this a multi-model solution?
 
Can you provide a small solution reproducing the issue?
 
Regards,
   Silvio.


Posted By: scapstick
Date Posted: 30-May-2012 at 11:17am
Yes, only that entity and only CacheOnly.  If I skip the CacheOnly, execute the async server request, it runs and returns 2 rows, and if I execute the CacheOnly after that, it runs, returning the 2 rows cached by the async call.
I'll see if I can make a small solution of it. 
By multi-model do you mean multiple edmx's?  If so then yes, there's 7 edmx models and most have been called before this point.



Print Page | Close Window