VReflector 1.3.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package VReflector --version 1.3.1                
NuGet\Install-Package VReflector -Version 1.3.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VReflector" Version="1.3.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VReflector --version 1.3.1                
#r "nuget: VReflector, 1.3.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install VReflector as a Cake Addin
#addin nuget:?package=VReflector&version=1.3.1

// Install VReflector as a Cake Tool
#tool nuget:?package=VReflector&version=1.3.1                

VReflector

Reflection Type helper utility.

Basic usage


// Check type is mutable or not.
public class ImmutableUser
{

    public readonly int Id;
    public string Name { get; init; }

    public static readonly int status;
    public static string Message { get; }
}

public class MutableUser
{

    public readonly int Id;
    public string Name { get; init; }
    public static string Message { get; private set; }
}

var result1 = typeof(ImmutableUser).GetTypeInfo().IsMutable();

var result2 = typeof(MutableUser).GetTypeInfo().IsMutable();


// Deep check type is mutable or not.
public abstract class A  
{
    public int Id { get; private set; }
    public string? Name { get; init; }
}

public class B : A
{

}
public class C : B
{
    public A? MyProperty { get; }
}
public class D : C
{
    public B? MyProperty2 { get; }
    public IA? MyProperty3 { get; init; }
}

var result1 = typeof(D).GetTypeInfo().IsMutable();

var result2 = typeof(D).IsDeepMutable();


// Get all parents.
public abstract class A  
{
    public int Id { get; private set; }
    public string? Name { get; init; }
}

public class B : A
{

}
public class C : B
{
    public A? MyProperty { get; }
}
public class D : C
{
    public B? MyProperty2 { get; }
    public IA? MyProperty3 { get; init; }
}

var result = typeof(D).GetParentTypes();


Check static class

public static class MyStaticClass
{

}
typeof(MyStaticClass).IsStatic()  //true

Check record class

public record MyEmptyRecord
{

}
typeof(MyEmptyRecord).IsRecordClass()  //true

Check anonymous class

// Create an anonymous type.
var anonType = new
{
    Name = "Bill",
    Age = 30
};
var type = anonType.GetType();
var result = type.IsAnonymous(); //true

Get Class,Enum and Struct Access modifier and modifiers

// Create an anonymous type.
protected internal abstract class PublicClass
{
}
var type = typeof(PublicClass);
var result = type.GetAccessModifier(); // protected internal
var info = type.GetTypeModifiers();  // abstract class

Get Method Access modifier and modifiers

// Create an anonymous type.
protected internal abstract class PublicClass
{
}
var type = typeof(PublicClass);
var method = type.GetMethod("ToString");
var result = method.GetMethodAccessModifier(); // public
var info = method.GetMethodModifiers();  // virtual

Lot more...

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on VReflector:

Package Downloads
DocsGen

C# type to document generator (xml,md,yaml,html).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 189 7/23/2023
1.3.1 189 7/21/2023
1.3.0 149 7/20/2023
1.2.3 155 7/18/2023
1.2.2 129 7/18/2023
1.2.1 146 7/18/2023
1.2.0 148 7/18/2023
1.1.1 147 7/15/2023
1.1.0 142 7/15/2023
1.0.1 158 7/9/2023
1.0.0 143 7/8/2023