Initialize 0.0.2-alpha
This is a prerelease version of Initialize.
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 Initialize --version 0.0.2-alpha
NuGet\Install-Package Initialize -Version 0.0.2-alpha
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="Initialize" Version="0.0.2-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Initialize --version 0.0.2-alpha
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Initialize, 0.0.2-alpha"
#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 Initialize as a Cake Addin #addin nuget:?package=Initialize&version=0.0.2-alpha&prerelease // Install Initialize as a Cake Tool #tool nuget:?package=Initialize&version=0.0.2-alpha&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Overview
High performance automatic DTO mapper and properties initializer based on Roslyn dynamic code and compilation
Example Usage
var test = new Test();
var test2 = new Test2();
// INITIALIZER EXAMPLE
test.Dump("Test Pre Init");
// 1.Optional If you want to manipuate the default initialization logic.
Initializer<Test>.Template.Clear();
Initializer<Test>.Template.Add(typeof(string),
(obj, propInfo) => "string.Empty");
Initializer<Test>.Template.Add(typeof(Nullable<>),
(obj, propInfo) => string.Format("{0}.{1}!.InitValueOrDefault()", obj, propInfo.Name));
Initializer<Test>.Template.Add(typeof(ValueType),
(obj, propInfo) => string.Format("{0}.{1}.InitValueOrDefault()", obj, propInfo.Name));
// 2. Call initialize
Initializer<Test>.Initialize(test);
test.Dump("Test Post Init");
//MAPPER EXAMPLE
test2.Dump("Test2 Pre Map");
Mapper<Test, Test2>.Map(test, test2);
test2.Dump("Test2 Post Map");
Feedback, Suggestions and Contributions
Are all welcome!
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
- Microsoft.CodeAnalysis.CSharp (>= 4.4.0)
-
net7.0
- Microsoft.CodeAnalysis.CSharp (>= 4.4.0)
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.3.2 | 349 | 11/28/2023 |
0.2.8 | 308 | 2/17/2023 |
0.2.7 | 252 | 2/17/2023 |
0.2.6 | 249 | 2/16/2023 |
0.2.4 | 241 | 2/16/2023 |
0.2.3 | 247 | 2/15/2023 |
0.2.2 | 253 | 2/15/2023 |
0.2.1 | 268 | 2/15/2023 |
0.0.2-alpha | 148 | 2/14/2023 |
0.0.1-alpha | 146 | 2/14/2023 |