Skip to content

Commit

Permalink
Change the library to dotnet5.4; use COREFX rather than specific labe…
Browse files Browse the repository at this point in the history
…ls for #if tests
  • Loading branch information
mgravell committed Nov 24, 2015
1 parent 8e4d792 commit 44326df
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
5 changes: 4 additions & 1 deletion FastMember.Signed/project.json
Expand Up @@ -24,7 +24,10 @@
"System.Data": "4.0.0.0"
}
},
"dnxcore50": {
"dotnet5.4": {
"compilationOptions": {
"define": [ "COREFX" ]
},
"dependencies": {
"Microsoft.CSharp": "4.0.1-*",
"System.Collections.NonGeneric": "4.0.1-*",
Expand Down
2 changes: 1 addition & 1 deletion FastMember/MemberSet.cs
Expand Up @@ -86,7 +86,7 @@ public Type Type
public bool IsDefined(Type attributeType)
{
if (attributeType == null) throw new ArgumentNullException("attributeType");
#if DNXCORE50
#if COREFX
return member.IsDefined(attributeType);
#else
return Attribute.IsDefined(member, attributeType);
Expand Down
4 changes: 2 additions & 2 deletions FastMember/ObjectReader.cs
Expand Up @@ -106,7 +106,7 @@ public override int Depth
get { return 0; }
}

#if !DNXCORE50
#if !COREFX
public override DataTable GetSchemaTable()
{
// these are the columns used by DataTable load
Expand Down Expand Up @@ -316,7 +316,7 @@ public override object GetValue(int i)

public override IEnumerator GetEnumerator()
{
#if DNXCORE50
#if COREFX
throw new NotImplementedException(); // https://github.com/dotnet/corefx/issues/4646
#else
return new DbEnumerator(this);
Expand Down
4 changes: 2 additions & 2 deletions FastMember/TypeAccessor.cs
Expand Up @@ -309,14 +309,14 @@ static TypeAccessor CreateNew(Type type, bool allowNonPublicAccessors)
if (assembly == null)
{
AssemblyName name = new AssemblyName("FastMember_dynamic");
#if DNXCORE50
#if COREFX
assembly = AssemblyBuilder.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run);
#else
assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run);
#endif
module = assembly.DefineDynamicModule(name.Name);
}
#if DNXCORE50
#if COREFX
TypeAttributes attribs = typeof(TypeAccessor).GetTypeInfo().Attributes;
#else
TypeAttributes attribs = typeof(TypeAccessor).Attributes;
Expand Down
12 changes: 6 additions & 6 deletions FastMember/TypeHelpers.cs
Expand Up @@ -8,15 +8,15 @@ internal static class TypeHelpers
{
public static bool _IsValueType(this Type type)
{
#if DNXCORE50
#if COREFX
return type.GetTypeInfo().IsValueType;
#else
return type.IsValueType;
#endif
}
public static bool _IsPublic(this Type type)
{
#if DNXCORE50
#if COREFX
return type.GetTypeInfo().IsPublic;
#else
return type.IsPublic;
Expand All @@ -25,15 +25,15 @@ public static bool _IsPublic(this Type type)

public static bool _IsNestedPublic(this Type type)
{
#if DNXCORE50
#if COREFX
return type.GetTypeInfo().IsNestedPublic;
#else
return type.IsNestedPublic;
#endif
}
public static bool _IsClass(this Type type)
{
#if DNXCORE50
#if COREFX
return type.GetTypeInfo().IsClass;
#else
return type.IsClass;
Expand All @@ -42,15 +42,15 @@ public static bool _IsClass(this Type type)

public static bool _IsAbstract(this Type type)
{
#if DNXCORE50
#if COREFX
return type.GetTypeInfo().IsAbstract;
#else
return type.IsAbstract;
#endif
}
public static Type _CreateType(this TypeBuilder type)
{
#if DNXCORE50
#if COREFX
return type.CreateTypeInfo().AsType();
#else
return type.CreateType();
Expand Down
5 changes: 4 additions & 1 deletion FastMember/project.json
Expand Up @@ -18,7 +18,10 @@
"System.Data": "4.0.0.0"
}
},
"dnxcore50": {
"dotnet5.4": {
"compilationOptions": {
"define": [ "COREFX" ]
},
"dependencies": {
"Microsoft.CSharp": "4.0.1-*",
"System.Collections.NonGeneric": "4.0.1-*",
Expand Down

0 comments on commit 44326df

Please sign in to comment.