Page 1 of 1

incomplete MetadataWorkspace?

Posted: Thu 04 Jun 2009 21:19
by robymes
Hello, I'm digging into ObjectContext.MetadataWorkspace.
everything is fine when I query the conceptual model via DataSpace.CSpace.
But I always receive an error when i query for the storage model via DataSpace.SSpace (exception says "System.InvalidOperationException: The space 'SSpace' has no associated collection").
Can you tell me something about this error?
Thanks

Posted: Fri 05 Jun 2009 09:07
by AndreyR
Please post here some sample code reproducing the error.

Posted: Fri 05 Jun 2009 10:20
by robymes
When I want to enumerate all the types defined in the storage model I use the following query:

Code: Select all

var query = 
    from item in
    context.MetadataWorkspace.GetItems(DataSpace.SSpace)
    .Where(m => m.BuiltInTypeKind == BuiltInTypeKind.EntityType)
    select item;
I always get an exception. If I use DataSpace.CSpace (for conceptual model) the query works fine.

Thanks

Posted: Fri 05 Jun 2009 12:29
by AndreyR
This is designed behaviour.
Microsoft models also do not provide items of this collection.