ConstructorIndex.Fody 0.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package ConstructorIndex.Fody --version 0.0.5                
NuGet\Install-Package ConstructorIndex.Fody -Version 0.0.5                
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="ConstructorIndex.Fody" Version="0.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConstructorIndex.Fody --version 0.0.5                
#r "nuget: ConstructorIndex.Fody, 0.0.5"                
#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 ConstructorIndex.Fody as a Cake Addin
#addin nuget:?package=ConstructorIndex.Fody&version=0.0.5

// Install ConstructorIndex.Fody as a Cake Tool
#tool nuget:?package=ConstructorIndex.Fody&version=0.0.5                

<img src="/package_icon.png" height="30px"> ConstructorIndex.Fody

NuGet Status

Inject constructor index automatic assignation into constructor code to ensure which one was used to create object.

This is an add-in for Fody.

Usage

See also Fody usage.

NuGet installation

Install the ConstructorIndex.Fody NuGet package and update the Fody NuGet package:

PM> Install-Package Fody
PM> Install-Package ConstructorIndex.Fody

The Install-Package Fody is required since NuGet always defaults to the oldest, and most buggy, version of any dependency.

Add to FodyWeavers.xml

Add <ConstructorIndex/> to FodyWeavers.xml

<Weavers>
  <ConstructorIndex>
    <Full.Name.ClassA/>
    <Full.Name.ClassB/>
    <Full.Name.BaseClass/>
  </ConstructorIndex>
</Weavers>

Parameter set:

  • NonPublic [bool] - tells weaver to process both public and not public contructors.
  • PropertyName [string] - set field name explicitly (?)
 var usedCtorIndex = obj.GetConstructorIndex();

TODO:

  1. Make derived classes processing switchabled.
  2. Maybe we need to set ClassName with regex?
  3. Will it be good to store constuctor signature instead of index?

DONE:

  1. Inject special internal or private attribute to mark processed class with it. Also it will keep field name where stored ctor index.

0.0.5:

  • Code refactoring.
  • Removed ClassName [string] - full type name of target class, derived class will be processed too. Set target class names inside ConstructorIndex node: <ConstructorIndex> <Full.Name.ClassA/> <Full.Name.ClassB/> </ConstructorIndex>

Mikhail Kanygin

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.6 504 2/3/2022
0.0.5 358 9/12/2021