Browse by Tags

All Tags » c# (RSS)

Secure ASP.NET Web API with Windows Azure AD

Note that the APIs, tools and methods change quickly in this area, this blog post will get old and die eventually… Many organizations now look at the Azure environment to host their websites and web APIs, and some decide to move their mail and Active...

Binding MediaElement to a ViewModel in a Windows 8 Store App

If you want to play a video from your video-library in a MediaElement control of a Metro Windows Store App and tried to bind the Url of the video file as a source to the MediaElement control like this, you may have noticed it’s not working as well for...
Posted by jdanforth | 3 comment(s)
Filed under: ,

File Activation in Windows RT

The code sample for file activation on MSDN is lacking some code so a simple way to pass the file clicked to your MainPage could be: protected override void OnFileActivated( FileActivatedEventArgs args) { var page = new Frame (); page.Navigate( typeof...
Posted by jdanforth | 1 comment(s)
Filed under: , , , , ,

Read All Text from Textfile with Encoding in Windows RT

A simple extension for reading all text from a text file in WinRT with a specific encoding, made as an extension to StorageFile: public static class StorageFileExtensions {     async public static Task<string> ReadAllTextAsync(this...
Posted by jdanforth
Filed under: , ,

MiniBuss on Codeplex

The micro service bus framework for msmq called MiniBuss is now open source on Codeplex at There is also now a NuGet package available for easy install into projects: If you’re interested in co-op on this project, please contact...

Create Tag-Cloud from RSS Feed in ASP.NET MVC

Say you want to generate your own tag-cloud from a list of categories or tags you pull from an RSS-feed or similar. This is one way to do it. I’m using ASP.NET MVC for this sample which creates a simple tag-cloud in a Razor-view with HTML looking something...
Posted by jdanforth
Filed under: , ,

Refactored Dapper Extensions

Making extensions for Dapper-dot-net was so fun and I needed a few more simple ones so I refactored a bit and made a few Update() and Delete() extensions as well. I’m also looking for Id-properties with the [Key] attribute on them. The class grew a bit...
Posted by jdanforth | 2 comment(s)
Filed under: ,

Simple Insert Extension for Dapper

Last week I started using Dapper ( dapper-dot-net on Google Code ) for a project I’m working on. Dapper is a micro ORM, which extends IDbConnection. It’s very fast and works very well for queries where you want to return both typed and dynamic lists of...
Posted by jdanforth | 10 comment(s)
Filed under: ,

Case Switching on CLR Types

As most .NET developers know, you cannot do case/switch on CLR types and one of the reasons for it was explained pretty well years ago by Peter Hallam on the C# team . But there are many cases where you would like to iterate through a list of objects...
Posted by jdanforth | 2 comment(s)
Filed under: , ,
More Posts