added AllClassMaps static method to BsonClassMap #129

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@alexjamesbrown
Contributor

alexjamesbrown commented Sep 13, 2012

Allows us to get all class maps out of BsonClassMap.

@craiggwilson

This comment has been minimized.

Show comment
Hide comment
@craiggwilson

craiggwilson Sep 19, 2012

Contributor

Good idea Alex. We'll discuss pulling this in.

Contributor

craiggwilson commented Sep 19, 2012

Good idea Alex. We'll discuss pulling this in.

@alexjamesbrown

This comment has been minimized.

Show comment
Hide comment
@alexjamesbrown

alexjamesbrown Sep 19, 2012

Contributor

Thanks :)

Contributor

alexjamesbrown commented Sep 19, 2012

Thanks :)

@alexjamesbrown

This comment has been minimized.

Show comment
Hide comment
@alexjamesbrown

alexjamesbrown Oct 18, 2012

Contributor

just wondering if there was any update on this?

Contributor

alexjamesbrown commented Oct 18, 2012

just wondering if there was any update on this?

@craiggwilson

This comment has been minimized.

Show comment
Hide comment
@craiggwilson

craiggwilson Oct 18, 2012

Contributor

Alex, there is an IsClassMapRegistered method? Is this suitable for what you need, or is there another reason you would like to have a list.

Contributor

craiggwilson commented Oct 18, 2012

Alex, there is an IsClassMapRegistered method? Is this suitable for what you need, or is there another reason you would like to have a list.

@alexjamesbrown

This comment has been minimized.

Show comment
Hide comment
@alexjamesbrown

alexjamesbrown Oct 18, 2012

Contributor

There is, and while that works, it doesn't allow me to get all mapped types, without iterating over my types, and running .IsClassMapRegistered on each one...

Contributor

alexjamesbrown commented Oct 18, 2012

There is, and while that works, it doesn't allow me to get all mapped types, without iterating over my types, and running .IsClassMapRegistered on each one...

@Cyberlane

This comment has been minimized.

Show comment
Hide comment
@Cyberlane

Cyberlane Nov 7, 2012

@craiggwilson I could do with this feature from @alexjamesbrown as well, as I need to call the "Reset" method on each of them. Without a stored list, this does not perform well at all...

@craiggwilson I could do with this feature from @alexjamesbrown as well, as I need to call the "Reset" method on each of them. Without a stored list, this does not perform well at all...

@alexjamesbrown

This comment has been minimized.

Show comment
Hide comment
@alexjamesbrown

alexjamesbrown Nov 7, 2012

Contributor

It would really make life a lot easier for people...

Contributor

alexjamesbrown commented Nov 7, 2012

It would really make life a lot easier for people...

@Cyberlane

This comment has been minimized.

Show comment
Hide comment
@Cyberlane

Cyberlane Nov 7, 2012

As a temp solution, I am using the following...

typeof(BsonClassMap).GetField("__classMaps", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null)

As a temp solution, I am using the following...

typeof(BsonClassMap).GetField("__classMaps", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null)
@alexjamesbrown

This comment has been minimized.

Show comment
Hide comment
@alexjamesbrown

alexjamesbrown Nov 8, 2012

Contributor

Yeah, but again, not ideal
This pull request literally just returns __classMaps.Values as a public IEnumerable<BsonClassMap>
It's even covered by unit tests!

Would make the lives of people wanting this functionality so much easier.

Contributor

alexjamesbrown commented Nov 8, 2012

Yeah, but again, not ideal
This pull request literally just returns __classMaps.Values as a public IEnumerable<BsonClassMap>
It's even covered by unit tests!

Would make the lives of people wanting this functionality so much easier.

@Cyberlane

This comment has been minimized.

Show comment
Hide comment
@Cyberlane

Cyberlane Nov 8, 2012

Fully agree with you that the temp solution I am using is not ideal, and I would much rather have your pull request and a couple other bits from the Experiment branch, as I have to do a lot of dirty hacks to get what I need currently.

Fully agree with you that the temp solution I am using is not ideal, and I would much rather have your pull request and a couple other bits from the Experiment branch, as I have to do a lot of dirty hacks to get what I need currently.

@craiggwilson

This comment has been minimized.

Show comment
Hide comment
@craiggwilson

craiggwilson Nov 9, 2012

Contributor

in code review... track at https://jira.mongodb.org/browse/CSHARP-628.

I renamed the method to GetRegisteredClassMaps().

Contributor

craiggwilson commented Nov 9, 2012

in code review... track at https://jira.mongodb.org/browse/CSHARP-628.

I renamed the method to GetRegisteredClassMaps().

@craiggwilson

This comment has been minimized.

Show comment
Hide comment
@craiggwilson

craiggwilson Nov 10, 2012

Contributor

pushed to master

Contributor

craiggwilson commented Nov 10, 2012

pushed to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment