mgravell / fast-member

Automatically exported from code.google.com/p/fast-member
Apache License 2.0
1.02k stars 137 forks source link

Add library compatibility for Net20 #27

Closed IkerCelorrio closed 8 years ago

IkerCelorrio commented 8 years ago

Add library compatibility to net20.

mgravell commented 8 years ago

I don't like that this declares System.Runtime.CompilerServices.ExtensionAttribute; that is going to cause chaos with anyone who has already had to declare that to make their code compile. I think it would be better to simply forsake extension methods for 2.0 - or to import those from a MS common package (if one exists). Thoughts?

IkerCelorrio commented 8 years ago

Yes, i think is little messy, but in net20 i have not found any MS (net20) library with that attribute.

If I forsake extensions methods it would change all extension methods to standard static methods and calls

public static bool _IsValueType(this Type type) will change to public static bool _IsValueType(Type type)

And the use field.FieldType._IsValueType() will change to TypeHelpers._isValueType(field.FieldType) or _isValueType(field.FieldType) if I use an using static FastMember.TypeHelpers with C# 6.0 or above

I could not wait to test, and i write the using static statements version

mgravell commented 8 years ago

Thanks; that's a huge improvement. Avoids a big problem.

IkerCelorrio commented 8 years ago

C# 6.0 save us with static using statements :sweat_smile: