DDev.Tooling.ObjectManipulation
1.0.1
dotnet add package DDev.Tooling.ObjectManipulation --version 1.0.1
NuGet\Install-Package DDev.Tooling.ObjectManipulation -Version 1.0.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="DDev.Tooling.ObjectManipulation" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DDev.Tooling.ObjectManipulation --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DDev.Tooling.ObjectManipulation, 1.0.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 DDev.Tooling.ObjectManipulation as a Cake Addin #addin nuget:?package=DDev.Tooling.ObjectManipulation&version=1.0.1 // Install DDev.Tooling.ObjectManipulation as a Cake Tool #tool nuget:?package=DDev.Tooling.ObjectManipulation&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DDev.Tooling.ObjectManipulation
What is this package?
DDev.Tooling.ObjectManipulation creates easy ways to manipulate objects within C# with ease.
How do I use this package?
Install the package using Nuget into your project.
Call the various methods depending on your usage as outlined below.
DDev.Tooling.ObjectManipulation.ConvertObject<T>(SourceObject);
Example Objects
internal class SourceClass
{
public string? Name { get; set; } = "Name";
public string? Nullable { get; set; } = "Nullable";
public string NotNullable { get; set; } = "NotNullable";
public string? Description { get; set; } = "Description";
public int? Number { get; set; } = 5;
}
internal class DestinationClass
{
public string? Name { get; }
public string? Nullable { get; set; }
public string? NotNullable { get; set; }
public string? Description { get; set; }
public int Number { get; set; }
}
Example Usage
var Source = new SourceClass();
Console.Write(JsonSerializer.Serialize(Source, Source.GetType(), new JsonSerializerOptions() { WriteIndented = true }));
var Destination = DDev.Tooling.ObjectManipulation.ConvertObject<DestinationClass>(Source);
Console.Write(JsonSerializer.Serialize(Destination, Destination.GetType(), new JsonSerializerOptions() { WriteIndented = true }));
Example Output
Source
{
"Name": "Name",
"Nullable": "Nullable",
"NotNullable": "NotNullable",
"Description": "Description",
"Number": 5
}
Destination
{
"Name": null,
"Nullable": "Nullable",
"NotNullable": "NotNullable",
"Description": "Description",
"Number": 5
}
Tips
If you find any tools within here helpful, consider buying me a beer - I'd appreciate it.
Change Log
1.0.0 → DDev.Tooling.ObjectManipulation.ConvertObject<T>()
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 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.