New Posts New Posts RSS Feed: How does one use LoadMetadataFromEmbeddedResources?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How does one use LoadMetadataFromEmbeddedResources?

 Post Reply Post Reply
Author
jradxl View Drop Down
Newbie
Newbie


Joined: 14-Jun-2011
Posts: 30
Post Options Post Options   Quote jradxl Quote  Post ReplyReply Direct Link To This Post Topic: How does one use LoadMetadataFromEmbeddedResources?
    Posted: 18-Aug-2011 at 4:08pm
Hi,
How does one use,
IdeaBlade.EntityModel.EntityMetadataStore.Instance.LoadMetadataFromEmbeddedResources(assembly);

Any possiblity of doing this sort of thing, if probing is not possible?
IdeaBlade.EntityModel.EntityMetadataStore.Instance.LoadMetadataFromAnyModelAssembly(assembly);
thanks
John

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 23-Aug-2011 at 7:09pm
Why do you want to call this directly?
 
It's actually something used internally by DevForce when looking for and initializing Code First models.  The method will search for any *.ibmmx files embedded in the given assembly and merge the contained metadata into the EntityMetadataStore.  This all happens automatically, or is supposed to, whenever a new entity type is seen in a query or save list.  The assembly normally passed into the method is one holding entity declarations, so should already be probed.
 
If you're seeing a problem with your Code First entities, please let us know the details of the problem.   
 
Back to Top
jradxl View Drop Down
Newbie
Newbie


Joined: 14-Jun-2011
Posts: 30
Post Options Post Options   Quote jradxl Quote  Post ReplyReply Direct Link To This Post Posted: 24-Aug-2011 at 1:11am
Hi,
Thanks for response. Idle interest really! I noticed it and was wondering why there wasn't a family of such methods!

I was trying to get the metadata from within a T4 template, but the metadata store instance was returning nothing.
var et =  IdeaBlade.EntityModel.EntityMetadataStore.Instance.GetEntityTypes();
I suppose the MEF probing couldn't operate correctly.

Since then I've moved over to a PreProcessed T4 template and it's working fine.

thanks
John

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 24-Aug-2011 at 7:22am
That's great that you found an answer to your issue with the preprocessed templates.
 
Regarding MEF probing - at design/build time the only way to have MEF probe an assembly is to add it to the IdeaBladeConfig ProbeAssemblyNames collection, since the normal MEF probing is turned off.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down