How to filter on the value of a metadata

Feb 12, 2009 at 1:24 PM
Hello,

I was wondering something. How can I filter on metadata. I know that we can prevent an import to be loaded if it does not have a specific metadata, but is it possible to load it only if the value of a metadata is what we expect. Something like a ImportMetadataIf("metadataKey", expectedValue, operator)

Thanks,
neonp
Feb 12, 2009 at 1:52 PM
What you probably are looking for is a custom Export Provider - they let you to decorate and/or filter exports. Glenn Block has written the first part of a blog series on Export Providers here
http://codebetter.com/blogs/glenn.block/archive/2008/12/25/using-exportprovider-to-customize-container-behavior-part-i.aspx
Coordinator
Feb 12, 2009 at 4:57 PM
Basically you need to import a collection and then apply the metadata filter yourself.  (A custom ExportProvider doesn't sound like it would help much here).

It would be nice to support something like this, but to really support it correctly you'd need to be able to specify the filter as a lambda expression, which isn't possible in attributes.
Feb 12, 2009 at 5:38 PM
"It would be nice to support something like this, but to really support it correctly you'd need to be able to specify the filter as a lambda expression, which isn't possible in attributes."

So, how do we push for lambda experssions in attribute in VNext if not 2010? There are about a billiion reasons we want them

Feb 12, 2009 at 5:49 PM
Vote on connect here.

http://connect.microsoft.com/MSDNProductFeedbackCenterRedirect.aspx?pfcId=FDBK49895
Feb 12, 2009 at 6:30 PM
And do you have a link for generic attributes? I feel a blog post coming on <g>
Feb 13, 2009 at 7:17 AM
Edited Feb 13, 2009 at 7:19 AM
Thanks to all of you for your attention.

dsplaisted :
Thank you for your answer, this is what I was thinking, and what I have done waiting for an answer. 

Thanks for taking time to answer me.
Feb 19, 2009 at 7:59 PM
I just blogged http://cli.gs/LeQhTa on how you can do this, with the help of a lambda expression .. please let me know what you think
Feb 19, 2009 at 8:09 PM
OK - so I just saw it before you posted so I guess you know. Loving it!

I can totally see the use of this: Say above a certain value use this algoritm and below use this other...

M.

On Thu, Feb 19, 2009 at 21:59, TheCodeJunkie <notifications@codeplex.com> wrote:

From: TheCodeJunkie

I just blogged http://cli.gs/LeQhTa on how you can do this, with the help of a lambda expression .. please let me know what you think