Summary
This is a list of awesome libraries and tools that help write great applications. As they say, we stand on the shoulders of giants!
>> Write cleaner code and avoid using exceptions for control flow
An implementation of discriminated unions in C#
public OneOf<User, InvalidName, NameTaken> CreateUser(string username)
{
if (!IsValid(username)) return new InvalidName();
var user = _repo.FindByUsername(username);
if(user != null) return new NameTaken();
var user = new User(username);
_repo.Save(user);
return user;
}
>> Build a URI/URL using a fluent API
using Flurl;
var url = "http://www.some-api.com"
.AppendPathSegment("endpoint")
.SetQueryParams(new {
api_key = ConfigurationManager.AppSettings["SomeApiKey"],
max_results = 20,
q = "Don't worry, I'll get encoded!"
})
.SetFragment("after-hash");
Web API Documentation
- Swashbuckle
- Swashbuckle.AspNetCore.Filters - provides extensions for more comprehensive docs such as request and response samples etc.
>> Read and write CSV | Excel or any delimited file
EP Plus - Can only do excel files.
>> Sending Emails
- Using SMTP Mailkit
- Sendgrid
- Mailgun
>> ReportGenerator
converts XML reports generated by OpenCover, PartCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo or Clover into human readable reports in various formats.