Month: October 2016

Serializing Anonymous DataMemeber

I've been working win MVC Web API and encountered an annoying problem. It does not, by default serialise anonymous data members.

When you try to serialise this kind of data you get this beautiful exception:

Converting anonymous type to a string also caused exception. But there is also JavaScriptSerializer:

Now using getter,

Continue Reading

One way object binding in JS

This is something I've been putting together this weekend. Due to the fact, that ASP.NET is quite reluctant to get an array of results from a request, I've devised an alternative way of sending data to the server via Web.API. There are already several large frameworks that handle data-binding like Knockout and AngularJS, but these

Continue Reading

Useful Linear Trendline Class in C#

I've searched and searched trying to find a simple class to calculate a slope and intercept from a set of points. Here is the outcome, but I probably modify it to use LINQ rather then loops

Continue Reading