Surprised no one has mentioned Nancy: https://github.com/NancyFx/Nancy I can't imagine building APIs without it now.
I find NancyFX really interesting, but I can't really see a reason to stray away from Web API2 besides Mono support. Any specific reasons you prefer Nancy?
Open Source .NET libraries that make your life easier
41–50 of 116 posts
Re: Open Source .NET libraries that make your life easier
#42To add to the author's list: * I seem to install Json.net in every .NET project I create (json serializer - thanks James Newton-King!) * NLog for logging. It's fantastic. * Dapper is also excellent (Micro ORM) (and anything written by Marc Gravell is generally top-notch - see protobuf-net, miniprofiler, StackExchange.Redis) * Automapper, to avoid writing boilerplate code to convert between similarly shaped types (E.G…
Re: Open Source .NET libraries that make your life easier
#43Earlier quoted context omitted.
I've just rolled out a service using TopShelf having not used it previously. It really does simplify things. The best bit for me is being able to just hit F5 and having the thing run as a console application. No need to manually attach to processes for debugging.
This technique lets you debug your service as if it were a console app - just pass in -a on the command line. In your Main method: if (args.Length > 0 && args[0] == "-a") { // Running as an application MyService ms = new MyService(); ms.DoStart(); Console.WriteLine("Press Enter to Stop"); Console.ReadLine(); ms.DoStop(); } else { // Running as a service ServiceBase[] servicesToRun = { new MyService() }; ServiceBase.R…
private static void Main()
{
var serviceHandler = new ServiceHandler();
if (Environment.UserInteractive)
{
serviceHandler.OnStart(null);
Console.WriteLine("Service started! Press to terminate service.");
Console.ReadLine();
serviceHandler.OnStop();
Console.WriteLine("Service stopped!");
return;
}
Run(serviceHandler);
}Re: Open Source .NET libraries that make your life easier
#44Knowing that'll need some of those libraries later I decided to compile into a list here: https://github.com/tallesl/.NET-libraries
Re: Open Source .NET libraries that make your life easier
#45 T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings in many places.
[0]: https://github.com/T4MVC/T4MVCRe: Open Source .NET libraries that make your life easier
#46Re: Open Source .NET libraries that make your life easier
#47Earlier quoted context omitted.
In fact it is not uncommon for me to use both Dapper and EF on the same project. Usually I'll use Dapper for the query/reporting side and EF for the domain model/update side. (Used to use nHibernate, but it seems to have really stagnated unfortunately)
Even then, for query building I found EF (or any LINQ provider for SQL) to be easier solution than string concatenation. Well, at least for relatively simple queries with pagination and stuff. For filters, Dynamic.Linq would be helpful here. On the other side, if you need to work extensively with stored procedures or you have complicated or custom SQL to run, Dapper (or Insight.Database - https://github.com/jonwagner…
Re: Open Source .NET libraries that make your life easier
#48I'd like to add one that's great for turning the web into a query-able database: HtmlAgilityPack. HtmlAgilityPack + Linq is amazing.
Re: Open Source .NET libraries that make your life easier
#49To add to the author's list: * I seem to install Json.net in every .NET project I create (json serializer - thanks James Newton-King!) * NLog for logging. It's fantastic. * Dapper is also excellent (Micro ORM) (and anything written by Marc Gravell is generally top-notch - see protobuf-net, miniprofiler, StackExchange.Redis) * Automapper, to avoid writing boilerplate code to convert between similarly shaped types (E.G…
Another interesting library for doing REST APIs is Refit: https://github.com/paulcbetts/refit
Re: Open Source .NET libraries that make your life easier
#50I used to use NLog for logging until I've discovered Serilog ( http://serilog.net/ ) - simple .NET logging with fully-structured events.