NLog is one of the most commonly used free logging platform, thanks to its flexibility and rich capabilities. Most often than not, our application requires logs that could be written out to raw files. But NLog provides the ability to do more, including writing to databases like MongoDb. In this blog post, we will address … Continue reading NLog and MongoDB
Category: Frameworks & Libraries
Development using different Frameworks and Libraries
Protobuf – Handling sub-classes
In this blog post, we will look into how to handle subclasses or interface implementations during protobuf serialization. Consider the following class. [ProtoContract] public class Person { [ProtoMember(1)] public string FirstName { get; set; } [ProtoMember(2)] public string LastName { get; set; } } For serializing an instance of the above with protobuf-net, you could do … Continue reading Protobuf – Handling sub-classes
Automapper vs Mapster
AutoMapper is undoubtedly the most popular object to object mapping library used around and it wouldn't be a surprise to know if any of us, including yours truly, have even tried out alternatives. I recently tried out Mapster and was quite surprised by the results. Even they did mention their Github pages about being faster than Automapper, I honestly didn't believe … Continue reading Automapper vs Mapster
Retrieve DataPoints displayed using Oxyplot when Zooming or Panning
One of questions I recently saw in Stackoverflow involved Oxyplot. User wanted to obtain the points which are currently displayed on screen. Remember, like with most graph controls, User could zoom/pan with Oxyplot and the points which are currently visible could only be a subset of actual points in the series. This could be achieved … Continue reading Retrieve DataPoints displayed using Oxyplot when Zooming or Panning
Oxyplot : Selectable Point
While OxyPlot continues to be one of the attractive plotting library for .Net developers, there are times when you find longing for features that could make it even more better. One of such feature is ability to select/highlight a point in a series. While there is a Selectable Property with LineSeries, it doesn't quite let … Continue reading Oxyplot : Selectable Point
Json Recipies – Part 2
Continuing with our earlier post on Json Recipies, let's explore couple of quick reference recipes using the famous NewtonSoft.Json. Recipe 04: Deserialize to Anonymous Type One of the least explored feature in NewtonSoft is the ability to deserialize a Json to anonymous type. For example, This would produce an output as Isn't that quite useful. … Continue reading Json Recipies – Part 2
Exploring Randomize.Net
Randomize.Net provides an easy and lightweight extensions for System.Random for creating random instances of any given Type T, with generated random value. This can be highly useful for generating POCO's to test your sample code, including LINQ queries against. The API has been designed to make it extremely simple and devoid of any complex syntax. … Continue reading Exploring Randomize.Net
Caliburn.Micro #008: Gesture Recognition using Short-Hand Syntax
In this part of Caliburn.Micro tutorials we would explore how to configure and use Gesture Recognition with Caliburn.Micro, particularly exploiting the Short-Hand syntax for Actions. Caliburn.Micro doesn't support this out of the box, so obviously we need to work around the Actions to provide support for Gestures. Let's first formulate the syntax of how we … Continue reading Caliburn.Micro #008: Gesture Recognition using Short-Hand Syntax
Mapping XML Using Automapper
Automapper comes handy when you have to deal with a lot of DTOs, making it very easy to map one type to another. But there are situations where you might need an extra hand. Consider the following Type definitions. The Source.Address is a XML representation of Address. Your requirement is to configure Automapper to convert … Continue reading Mapping XML Using Automapper
Json Recipes
Here are few quick recipes with Newtonsoft.Json Recipe 01 : Convert Json to XML One way to convert a Json to XML would be to convert Json to intermediate class structure and then serialize the class using XMLSerializer. But why go the long way when you can do it directly. Let's check the code straightaway. … Continue reading Json Recipes