ModelWrapper 1.1.0

Tool wich enrich the experience of data models manipulation in RestFul APIs for C# WebApi projects.

There is a newer version of this package available.
See the version list below for details.
Install-Package ModelWrapper -Version 1.1.0
dotnet add package ModelWrapper --version 1.1.0
<PackageReference Include="ModelWrapper" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ModelWrapper --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ModelWrapper - Current version 1.1.0

Model wrapper - Tool wich enrich the experience of data models manipulation in RestFul APIs for C# WebApi projects.


Usage

Model class:

public class PatchCustomerCommand : Wrap<Customer>, IRequest<PatchCustomerCommandResponse>
{
    public PatchCustomerCommand()
    {
        KeyProperty(x => x.CustomerID);
        SuppressProperty(x => x.RegistrationDate);
        SuppressProperty(x => x.Orders);
    }
}

Methods:

int categoryID = 12;
model.Project(x=>x.CategoryID = categoryID); //Sets the value into the internal object;
int categoryID = model.Project(x=>x.CategoryID); //Gets the value of the internal object;
Customer entity = model.Post(); //return a new instance of the entity.
model.Patch(entity); //Update the supplied properties on entity.
model.Put(entity); //Update all properties of the entity.

GitHub

https://github.com/isilveira/ModelWrapper

Nuget

https://www.nuget.org/packages/ModelWrapper

Package Manager

PM&gt; Install-Package ModelWrapper -Version 1.1.0

.NET CLI

&gt; dotnet add package ModelWrapper --version 1.1.0

Packet

&gt; paket add ModelWrapper --version 1.1.0

ModelWrapper - Current version 1.1.0

Model wrapper - Tool wich enrich the experience of data models manipulation in RestFul APIs for C# WebApi projects.


Usage

Model class:

public class PatchCustomerCommand : Wrap<Customer>, IRequest<PatchCustomerCommandResponse>
{
    public PatchCustomerCommand()
    {
        KeyProperty(x => x.CustomerID);
        SuppressProperty(x => x.RegistrationDate);
        SuppressProperty(x => x.Orders);
    }
}

Methods:

int categoryID = 12;
model.Project(x=>x.CategoryID = categoryID); //Sets the value into the internal object;
int categoryID = model.Project(x=>x.CategoryID); //Gets the value of the internal object;
Customer entity = model.Post(); //return a new instance of the entity.
model.Patch(entity); //Update the supplied properties on entity.
model.Put(entity); //Update all properties of the entity.

GitHub

https://github.com/isilveira/ModelWrapper

Nuget

https://www.nuget.org/packages/ModelWrapper

Package Manager

PM&gt; Install-Package ModelWrapper -Version 1.1.0

.NET CLI

&gt; dotnet add package ModelWrapper --version 1.1.0

Packet

&gt; paket add ModelWrapper --version 1.1.0

Release Notes

Wrap<TModel, int> removed & Project implemented

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.1.0 171 1/18/2020
2.0.2 86 12/6/2019
2.0.1 90 12/4/2019
2.0.0 72 11/20/2019
1.1.0 160 3/22/2019
1.0.1 144 3/20/2019
1.0.0 146 3/20/2019
1.0.0-beta 271 6/28/2018