Linq To CSV

LinqToCSV Class namespace FooFoo { public static class LinqToCSV { public static string ToCsv<T>(this IEnumerable<T> items) where T : class { var csvBuilder = new StringBuilder(); var properties = typeof(T).GetProperties(); foreach (T item in items) { string line = string.Join(“,”,properties.Select(p => p.GetValue(item, null).ToCsvValue()).ToArray()); csvBuilder.AppendLine(line); } return csvBuilder.ToString(); } private static string ToCsvValue<T>(this T item) { if(item == null) […]

Fix of “The breakpoint will not currently be hit. No symbols have been loaded for this document.”

Start debugging, as soon as you’ve arrived at a breakpoint or used Debug &gt; Break All, use Debug &gt; Windows &gt; Modules. You’ll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information. You’ll get a dialog that lists all […]

How To Get An In Depth Insight Of Your Code With NDepend static analysis tool

As a software developer, you may have come across a situation where you need to measure the quality the source code you have at hand. How well is the code written ? is it easily maintainable ? and similar important questions. Obviously, you don’t want to go through each line of code in the whole project to determine […]

Deploy dotnet Core MVC on Ubuntu with Supervisor

Introduction I Just purchased a Linux VPS and started to install dotnet core on it and use it for deploying dotnet core apps Removing Apache Most of Linux vps comes with apache so first step is to remove it. sudo service apache2 stop sudo apt-get purge apache2 sudo apt-get autoremove Finally, check if there is any configuration files […]

The Mediator Pattern In .NET Core

A couple of years back, I had to help out on a project that was built entirely using the “Mediator Pattern”. Or more specifically, built entirely using the MediatR library. There were all these presentations about the “theory” behind the Mediator Pattern and how it was a real new way of thinking. I couldn’t help but think… We’ve been doing […]

C# RSS generator in less than than 50 lines of code

What kind of technical blog doesn’t have RSS feed? Well, this one didn’t have one. This short post will present single method for generating RSS feed we are using, and answer why we are not using existing solution. After googling for existing solutions for generating RSS feed, one of the first solution was to use Wildermuth’s RssSyndication library. After trying […]

1 2 3 8