VReflector 1.2.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package VReflector --version 1.2.1
NuGet\Install-Package VReflector -Version 1.2.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.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VReflector --version 1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VReflector, 1.2.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.2.1 // Install VReflector as a Cake Tool #tool nuget:?package=VReflector&version=1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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
Lot more...
Product | Versions 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.