Developing and Distributing Tools with DNX, DNU and NuGet

npm install -g for .NET? it’s here! There is a (somewhat) hidden gem in the new .NET world with DNVM, DNX and DNU - creating and distributing global tools with ease. Global meaning the application is always available through one or more commands in the command prompt (basically being registered in the PATH system variable). In the Node.js community this has been a central part, allowing you to install useful tools using the Node Package Manager. “Secret Manager”, part of ASP.NET 5, is an example of such a tool in the .NET world - but it is also one of the only examples currently available. Here is how simple it is to get started with it: ...

November 7, 2015 · Jeppe Lund Andersen

ASP.NET Web API Request Throttling with Redis Cache

When developing API’s for external parties to consume, sometimes the need for request throttling becomes relevant. In this article you’ll see a simple approach to create such a middleware component for Web API in ASP.NET 5, based on Redis. You can browse or download the complete sample on GitHub at: https://github.com/jlandersen/web-api-redis-request-throttling. Considerations The general case usually is that you have identifiable consumers of your API. The consumers are usually identified based on an access key (or something equivalent) supplied with each request. Since you will have to check each incoming request up against a history of previous requests, the mechanism should almost always be implemented using in-memory caching or a dedicated caching system, such as memcached or Redis. Before implementing a request throttling mechanism in your API, that rates each of these consumers individually, you should consider how ambitious the mechanism should be. You can choose from a wide range of different parameters to base the rating on. Some examples are: ...

August 16, 2015 · Jeppe Lund Andersen

ASP.NET 5 with Gulp and Bower From an Empty Solution

ASP.NET 5 is on it’s way which will level the playing field a bit in comparison with other web stacks, primarily enabled through the integration of Node.js with Visual Studio. Exciting times indeed! In the project templates provided with the currently available Visual Studio 2015 CTP, the “non-empty” projects are configured with Grunt and Bower. In this post I will walk through setting up an empty solution with Bower and Gulp, an alternative to Grunt. The goal is to demonstrate how all the new possibilities are actually wired up in an ASP.NET 5 solution and show how you might replace Grunt with Gulp as task runner instead. ...

April 10, 2015 · admin

Multitenancy with Subdomains in ASP.NET MVC 5

Developing a product that is multi-tenant is a pretty interesting challenge. Recently I was in the fortunate situation of having to work on such a thing. By giving organisations access to a tenant through a subdomain of choice is a pretty neat approach that provides users a sense of personal ownership of the product. In this post I will show a simple approach of how to use subdomains to identify the corresponding tenant in ASP.NET MVC 5. ...

February 12, 2015 · admin

Xamarin Forms - Customizing Tabbed Page Header and Title on Windows Phone

In this post I will show how to customize the title and header section of the Tabbed Page control, when running on Windows Phone. On WP this is the pivot control being used, which is quite different from the tabs used on both iOS and Android. Let’s say you wish to just change the font or completely restyle the title or the header showing the sections. You can create the complete page as a native Windows Phone XAML page with a pivot control and let that render. This gives complete control of the page and the pivot control, but makes the sacrifice of reducing how much code is shared. ...

December 10, 2014 · admin