FluentValidation with ASP.NET Web API 2 and Castle Windsor
Proper validation of input to REST APIs is important and if you also can provide good error messages in case of erronous input you will make the API a lot easer to use for the consumers of your API. Using FluentValidation [https://fluentvalidation.codeplex.
Only use factories if you really need to control the lifetime of the created objects
On the project I am currently working on we need to implement various processes consisting of a series of steps. We have created some reusable classes based on the command pattern [http://en.wikipedia.org/wiki/Command_pattern]. Using these classes we can implement
Custom SharePoint RTE CSS caveat
Recently, I created a custom RTE element style for SharePoint Online. It showed up in the element style list, but did not work. Why? What I did .ms-rteElement-HelpIngress { -ms-name: "Help ingress"; font-size: 1.5em; font-weight: bold; } Well, I wrote everything in a
BrowserLink and Post-Cache Substitution don't mix
I work with an ASP.NET application and the last few days I've been getting this annoying error from time to time: > Post cache substitution is not compatible with modules in the IIS integrated pipeline that modify the response buffers. Either
AngularJS, Internet Explorer, textarea and placeholder
I encountered an issue regarding placeholder attribute and interpolation on textareas in AngularJS(using version 1.2.16) For example: <textarea name="someComment" id="someComment" ng-model="someModel.comment" placeholder="{{somePlaceholder}}"></textarea> In
Versioning legacy database changes
With Entity Framework's model-first approach, keeping track of database changes suddenly became much easier. And as we move steadily away from stored procedures, another part of the puzzle has been solved. But a quick reality check is in order. Many developers -
AngularJS Part 4 - The Factory
This post is part of a series of posts on AngularJS, and here are the parts so far: * AngularJS Part 1 - Getting started with the basics [https://blog.novanet.no/angularjs-getting-started-with-the-basics-2/] * AngularJS Part 2 - Getting started with Controllers [https://blog.novanet.no/
AngularJS Part 3 - Routes and Views
This post is part of a series of posts on AngularJS, and here are the parts so far: * AngularJS Part 1 - Getting started with the basics [https://blog.novanet.no/angularjs-getting-started-with-the-basics-2/] * AngularJS Part 2 - Getting started with Controllers [https://blog.novanet.no/
AngularJS Part 2 - Getting started with Controllers
This post is part of a series of posts on AngularJS, and here are the parts so far: * AngularJS Part 1 - Getting started with the basics [https://blog.novanet.no/angularjs-getting-started-with-the-basics-2/] * AngularJS Part 2 - Getting started with Controllers * AngularJS Part 3 -
AngularJS with JSONP and how I get to work on time
My every morning challenge is reaching the bus to get to work on time. And the bus schedule is not something to rely on. Fortunately, the bus company in Oslo (called "Ruter" from now on) has its own REST API with real
AngularJS Part 1 - Getting started with the basics
This post is part of a series of posts on AngularJS, and here are the parts so far: * AngularJS Part 1 - Getting started with the basics * AngularJS Part 2 - Getting started with Controllers [https://blog.novanet.no/angularjs-getting-started-with-controllers/] * AngularJS Part 3 -
Writing Entity Framework generated SQL to Visual Studio output window
Using a powerful ORM like Entity Framework is great. But once in a while when debugging, not having access to the generated SQL can be a real pain. Fortunately Entity Framework comes with handy logging functionality. What I do is to wire Entity Framework
4 strategies for passing parameters to RequireJS modules
RequireJS is a great library for managing JavaScript files, modules and the dependencies between them. This post requires (pun intended) some knowledge of the framework. If this is all new to you, point your browser to requirejs.org [http://requirejs.org] to find out
Setting user-agent for remote chromedriver in Selenium
Setting the user-agent in .net is not straight forward. Using the chrome webdriver directly this can be done using chromeoptions var ios6ua = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.
Microsoft.AspNet.Web.Optimization Minifies Mediaqueries wrong
Update: The bug mentioned here is now fixed in both WebGrease (making sure there are leading spaces) and in Chrome (making sure it parses mediaqueries without leading spaces in front of keywords). However, since this is a proposal in the future CSS spec that
The quest for a HTML5 document viewer
Background My first thought when we were planning the project was to go with something like Google Docs Viewer or a similar solution, but since the application will be running on the clients intranet, this was a no go. Neither the application nor the
Creating multilingual support using AngularJS
"Create multilingual support for the web site". I just got this task for a client project, and I think it’s fair to assume that others will get this task in the future, so this blog post shows how I implemented this for my project.
Scaling concurrent connections with node.js and Socket.IO on IIS
These days I am working on a websockets-solution based on node.js and Socket.IO. With my development server running in Azure on IIS behind the brilliant iisnode I had everything set up and ready for performing some basic load tests, or so I