<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>C# on Jeppe Andersen Blog</title><link>https://nocture.dk/tags/c%23/</link><description>Recent content in C# on Jeppe Andersen Blog</description><generator>Hugo -- 0.154.3</generator><language>en-us</language><lastBuildDate>Sat, 07 Nov 2015 09:15:07 +0000</lastBuildDate><atom:link href="https://nocture.dk/tags/c%23/index.xml" rel="self" type="application/rss+xml"/><item><title>Developing and Distributing Tools with DNX, DNU and NuGet</title><link>https://nocture.dk/2015/11/07/developing-and-distributing-tools-with-dnx-and-dnu/</link><pubDate>Sat, 07 Nov 2015 09:15:07 +0000</pubDate><guid>https://nocture.dk/2015/11/07/developing-and-distributing-tools-with-dnx-and-dnu/</guid><description>&lt;p&gt;&lt;em&gt;npm install -g for .NET? it&amp;rsquo;s here!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;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.
&amp;ldquo;&lt;a href="https://docs.asp.net/en/latest/security/app-secrets.html"&gt;Secret Manager&lt;/a&gt;&amp;rdquo;, 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:&lt;/p&gt;</description></item><item><title>ASP.NET Web API Request Throttling with Redis Cache</title><link>https://nocture.dk/2015/08/16/asp-net-web-api-request-throttling-with-redis/</link><pubDate>Sun, 16 Aug 2015 12:26:52 +0000</pubDate><guid>https://nocture.dk/2015/08/16/asp-net-web-api-request-throttling-with-redis/</guid><description>&lt;p&gt;When developing API&amp;rsquo;s for external parties to consume, sometimes the need for request throttling becomes relevant. In this article you&amp;rsquo;ll see a simple approach to create such a middleware component for Web API in ASP.NET 5, based on Redis.&lt;/p&gt;
&lt;p&gt;You can browse or download the complete sample on GitHub at: &lt;a href="https://github.com/jlandersen/web-api-redis-request-throttling"&gt;https://github.com/jlandersen/web-api-redis-request-throttling&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id="considerations"&gt;Considerations&lt;/h1&gt;
&lt;p&gt;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:&lt;/p&gt;</description></item><item><title>Async Camera Pictures with Xamarin Forms</title><link>https://nocture.dk/2015/06/18/async-camera-pictures-with-xamarin-forms/</link><pubDate>Thu, 18 Jun 2015 15:34:00 +0000</pubDate><guid>https://nocture.dk/2015/06/18/async-camera-pictures-with-xamarin-forms/</guid><description>&lt;p&gt;I have seen different approaches to using the device camera with Xamarin Forms. Here&amp;rsquo;s an example of how this might be implemented, with an async interface for easy async-await consumption in the shared Xamarin Forms part of the application. I will show the implementation details of the shared code and iOS version. The full example is available on &lt;a href="https://github.com/jlandersen/xamarin-forms-camera"&gt;https://github.com/jlandersen/xamarin-forms-camera&lt;/a&gt; that includes Windows Phone and Android parts as well. If you are unfamiliar with accessing native features of the different platforms, check out the &lt;a href="http://developer.xamarin.com/guides/cross-platform/xamarin-forms/dependency-service/"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>ASP.NET 5 with Gulp and Bower From an Empty Solution</title><link>https://nocture.dk/2015/04/10/asp-net-5-gulp-bower-scratch/</link><pubDate>Fri, 10 Apr 2015 16:18:18 +0000</pubDate><guid>https://nocture.dk/2015/04/10/asp-net-5-gulp-bower-scratch/</guid><description>&lt;p&gt;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.&lt;/p&gt;</description></item><item><title>Multitenancy with Subdomains in ASP.NET MVC 5</title><link>https://nocture.dk/2015/02/12/subdomain-based-multitenancy-asp-net-mvc-5/</link><pubDate>Thu, 12 Feb 2015 19:47:56 +0000</pubDate><guid>https://nocture.dk/2015/02/12/subdomain-based-multitenancy-asp-net-mvc-5/</guid><description>&lt;p&gt;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.&lt;/p&gt;</description></item><item><title>Xamarin Forms - Customizing Tabbed Page Header and Title on Windows Phone</title><link>https://nocture.dk/2014/12/10/xamarin-forms-customizing-tabbed-page-header-title-windows-phone/</link><pubDate>Wed, 10 Dec 2014 18:53:45 +0000</pubDate><guid>https://nocture.dk/2014/12/10/xamarin-forms-customizing-tabbed-page-header-title-windows-phone/</guid><description>&lt;p&gt;In this post I will show how to customize the title and header section of the &lt;a href="http://iosapi.xamarin.com/?link=T%3aXamarin.Forms.TabbedPage"&gt;Tabbed Page&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;</description></item><item><title>Dynamics CRM 2011/2013 - Re-register Plugin Assembly With New Strong Name Key</title><link>https://nocture.dk/2014/06/26/dynamics-crm-20112013-re-register-plugins-key/</link><pubDate>Thu, 26 Jun 2014 08:29:39 +0000</pubDate><guid>https://nocture.dk/2014/06/26/dynamics-crm-20112013-re-register-plugins-key/</guid><description>&lt;p&gt;All CRM plugins must be signed with a strong key in order to be deployed (both for letting Dynamics CRM be able to handle assembly naming conflicts and if you deploy it to the GAC on the server). I have come across a couple of projects where the password for the strong name key file was stuck in the head of another person – and later forgotten – making it troublesome set up a new development machine to build and deploy a solution.&lt;/p&gt;</description></item><item><title>Custom pushpin icon for Windows Store Apps with Bing Maps and C#</title><link>https://nocture.dk/2012/11/04/custom-pushpin-icon-for-windows-store-apps-with-bing-maps-and-c/</link><pubDate>Sun, 04 Nov 2012 16:14:56 +0000</pubDate><guid>https://nocture.dk/2012/11/04/custom-pushpin-icon-for-windows-store-apps-with-bing-maps-and-c/</guid><description>&lt;p&gt;While the Bing Maps SDK is out of Release Preview and made final along with the release of Windows 8, i find that the documentation is still lacking quite a bit. Here is a couple of examples of how you can customize the pushpin control by changing the displayed image overlay, without having to implement a seperate Control.&lt;/p&gt;
&lt;h2 id="custom-icon-for-pushpin-using-xaml-and-c"&gt;Custom icon for pushpin using XAML and C#&lt;/h2&gt;
&lt;p&gt;Add the following to the resources (e.g. in your XAML for the Page containing the Bing Maps Control):&lt;/p&gt;</description></item><item><title>ABAP Reflection - Part One (The RTTS and Type Introspection)</title><link>https://nocture.dk/2012/11/01/abap-reflection-part-one-the-rtts-and-type-introspection/</link><pubDate>Thu, 01 Nov 2012 14:56:50 +0000</pubDate><guid>https://nocture.dk/2012/11/01/abap-reflection-part-one-the-rtts-and-type-introspection/</guid><description>&lt;p&gt;Reflection provides the ability to examine, modify and create data types and behaviour at runtime. Developers of C# (or Java) not familiar with this concept, have most likely encountered it at some point, or even used it, through the .NET or Java reflection library. Have you ever used the typeof operator or invoked the GetType() methods in C#? Then you have already encountered it first hand.&lt;/p&gt;
&lt;p&gt;Recently I found the need for reflection in ABAP, all the way from type inspection to creation of new data types at runtime, which I found to be documented only very superficial. This (and the following) post is a result of my experiences working with reflection in ABAP. In this first post I will briefly introduce an overview of reflection in ABAP and how this can be used to inspect types at runtime. If you just want to get down with reflection in ABAP I suggest you skip the next section.&lt;/p&gt;</description></item><item><title>NetMeter tool</title><link>https://nocture.dk/2010/01/13/netmeter-tool-released/</link><pubDate>Wed, 13 Jan 2010 17:37:04 +0000</pubDate><guid>https://nocture.dk/2010/01/13/netmeter-tool-released/</guid><description>&lt;p&gt;I have always been using a small tool to monitor my network usage for various reasons, but recently my favourite decided to take the step away from being a free tool. Instead of tracking down another, I decided to use this opportunity to start a new project of my own, and use it as an opportunity to take a look at &lt;a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation"&gt;WPF &lt;/a&gt;for the first time.&lt;/p&gt;
&lt;p&gt;&lt;img alt="NetMeter screenshot" loading="lazy" src="https://nocture.dk/images/2015/04/NetMeter.png"&gt;&lt;/p&gt;
&lt;p&gt;Currently it simply displays your network usage, but should only be considered an appetizer in its current state – I got some ideas lined up to give this some more sweet features!&lt;/p&gt;</description></item><item><title>Dijkstra's algorithm in C#</title><link>https://nocture.dk/2009/10/25/dijkstras-algorithm-in-c/</link><pubDate>Sun, 25 Oct 2009 20:11:07 +0000</pubDate><guid>https://nocture.dk/2009/10/25/dijkstras-algorithm-in-c/</guid><description>&lt;p&gt;I had the pleasure of working with this algorithm one year ago during a project on route planning. Recently I encountered this algorithm again during a course, and decided to do a small implementation of this algorithm along with a graphical interface to use it. Use it for anything you want.&lt;/p&gt;
&lt;p&gt;It finds the shortest path from a starting point to all nodes in a graph, but keeps track of how to get there, so if you want to use it for the shortest path between 2 points, simply follow the previous node located in *path *from the destination point.&lt;/p&gt;</description></item></channel></rss>