Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Retrieving all BsonClassMaps
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alex Brown  
View profile  
 More options Sep 13 2012, 9:57 am
From: Alex Brown <a...@alexjamesbrown.com>
Date: Thu, 13 Sep 2012 06:57:24 -0700 (PDT)
Local: Thurs, Sep 13 2012 9:57 am
Subject: Retrieving all BsonClassMaps

Is there a way of getting back a collection of all currently mapped types?

I've forked the repo, and submitted a patch to enable me to do this easily:
https://github.com/mongodb/mongo-csharp-driver/pull/129

However, in the meantime, is there a way of doing this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
craiggwilson  
View profile  
 More options Sep 13 2012, 10:03 am
From: craiggwilson <craiggwil...@gmail.com>
Date: Thu, 13 Sep 2012 07:03:29 -0700 (PDT)
Local: Thurs, Sep 13 2012 10:03 am
Subject: Re: Retrieving all BsonClassMaps

No, there is not a way to do this.  May I ask why you need this
functionality?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Brown  
View profile  
 More options Sep 13 2012, 10:08 am
From: Alex Brown <a...@alexjamesbrown.com>
Date: Thu, 13 Sep 2012 15:07:39 +0100
Local: Thurs, Sep 13 2012 10:07 am
Subject: Re: [mongodb-csharp] Re: Retrieving all BsonClassMaps

Didn't think so. At least i wasn't going mad.

Easiest way to describe it is creating a kind of web api

request comes in as /customer/find-all

Rather than strong typing each of my services, i want a "base" service to
handle them

so, "customer" is the type
We then look in our AllClassMaps collection, for a type, where name is
"customer"

Can then instantiate the according repository, based on the retrieved Type
from AllClassMaps

Hope that makes sense....

On 13 September 2012 15:03, craiggwilson <craiggwil...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
craiggwilson  
View profile  
 More options Sep 13 2012, 2:23 pm
From: craiggwilson <craiggwil...@gmail.com>
Date: Thu, 13 Sep 2012 11:23:44 -0700 (PDT)
Local: Thurs, Sep 13 2012 2:23 pm
Subject: Re: [mongodb-csharp] Re: Retrieving all BsonClassMaps

Have you considered odata for this?  

Otherwise, the class maps listing is going to contain a number of classes
that you might not want...  For instance, there is a class map for
System.Object.  Hence, you'd somehow need to provide a filter to limit it
to valid types.  Once you get there, you might as well just keep a list of
all the support types or do some assembly level reflection for all types in
a given namespace or implementing a particular interface.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Brown  
View profile  
 More options Oct 23 2012, 4:28 am
From: Alex Brown <a...@alexjamesbrown.com>
Date: Tue, 23 Oct 2012 09:27:51 +0100
Local: Tues, Oct 23 2012 4:27 am
Subject: Re: [mongodb-csharp] Re: Retrieving all BsonClassMaps

It would be much easier to have the list of mapped classes available.

ie: get the types via reflection
Then assert they are in BsonClassMap.AllClassMaps

OData wouldn't be appropriate for this

Currently, I'm iterating over the types retrieved by reflection, and doing
a BsonClassMap.IsClassMapRegistered on each type...
Not very performant!

On 13 September 2012 19:23, craiggwilson <craiggwil...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »