Some Of The Useful Nuget Packages For Dotnet Project

Now a days all the packages from microsoft also available on nuget. Just to remind that here I am providing some list of packages that are not standard package that comes with project as a default.

Also it is possible that I will keep update this post as I will find new packages that are useful.

Validation

Used for validation of object. This will be used to validate any type of object. It also supports various level of configuration.

Following two are type of validation but It is specially use for when you have to check parameter or argument of method.

Mapper

Mappper functionality is used to map object of one type to another type. This is specially used when object pass from one layer to another layer and you only want to expose object as DTO and not the actual business object.

UnitTesting

For mocking purpose following packages is being used.

Domain Driven Design

CQRS (Command query responsibility segregation)

  • MediatR

    nuget.org/packages/mediatr

    This is simple implementation of mediator pattern. It is very good for CQRS implementation and it is not heavy too.

Result Checking

While working with API, there is possibility to have multiple result possible. Like actual result or some kind of error or some other indication.

  • OneOf

    nuget.org/packages/OneOf

    This is used when there is multiple result type possible but at a time there is only one result from type provided.

  • FluentResults

    nuget.org/packages/FluentResults

    This is also used same purpose as OneOf. Checking success or failure and result type.

CommandLine Utility Building

To build the command line utility in more manageable way. It allows to add multiple option, easy to extend.

  • Cocona

    nuget.org/packages/Cocona

    This is simple yet useful. Also its syntax is quite intuitive.

  • System.CommandLine

    nuget.org/packages/System.CommandLine/2.0.0..

    This is still in preview but has rich set of functionality. For simple command it is not as intuitive as Cocona but it is still in beta so we can hope for good final release. It has many supported package as well.

Summary

There are many other package I will put over here. Also if you are using any package in any category ( category even not listed over here) then also put that in comment section.

Update 1 : 02-03-2022

  • TinyMapper Added to the list for Mapper category.

Update 2: 15-03-2022

  • Commandline tool building package added.