VReflector 2.1.1.2
dotnet add package VReflector --version 2.1.1.2
NuGet\Install-Package VReflector -Version 2.1.1.2
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="2.1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VReflector --version 2.1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VReflector, 2.1.1.2"
#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=2.1.1.2 // Install VReflector as a Cake Tool #tool nuget:?package=VReflector&version=2.1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
VReflector
VReflector is Object
,Type
,Constructor
,Method
,Member
,Event
,Field
,Property
,Parameter
,Assembly
,StackTrace
,Numerics
String
,DateTime
,DateOnly
,TimeOnly
,TimeSpan
and DateTimeOffset
helpers utility.
Installation
You can install the VReflector package via NuGet:
dotnet add package VReflector
Or you can use the NuGet Package Manager:
Install-Package VReflector
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
Version | Downloads | Last updated |
---|---|---|
2.1.1.2 | 76 | 1/22/2025 |
2.1.1.1 | 61 | 1/22/2025 |
2.1.1 | 64 | 1/21/2025 |
2.1.0 | 74 | 1/20/2025 |
2.0.1.1 | 79 | 1/19/2025 |
2.0.1 | 65 | 1/19/2025 |
2.0.0.1 | 71 | 1/18/2025 |
2.0.0 | 77 | 1/18/2025 |
1.5.0 | 75 | 1/18/2025 |
1.4.0 | 206 | 7/23/2023 |
1.3.1 | 203 | 7/21/2023 |
1.3.0 | 158 | 7/20/2023 |
1.2.3 | 164 | 7/18/2023 |
1.2.2 | 138 | 7/18/2023 |
1.2.1 | 161 | 7/18/2023 |
1.2.0 | 158 | 7/18/2023 |
1.1.1 | 156 | 7/15/2023 |
1.1.0 | 151 | 7/15/2023 |
1.0.1 | 167 | 7/9/2023 |
1.0.0 | 152 | 7/8/2023 |