Quantcast
Channel: Platform – C# City
Browsing latest articles
Browse All 16 View Live

From C# Ruby and Back Again, via IronRuby

Note: This is the first of two articles on integrating C# and scripting languages. You can read the second part (on Javascript) here. I recently created an engine (I know, I know) to create text-based...

View Article



From C# To Javascript and Back Again, Via ClearScript

Note: This is the second of two articles on integrating C# and scripting languages. You can read the second part (for Ruby) here. I recently created an engine (I know, I know) to create text-based...

View Article

Manually Rolling Back a TransactionScope

The standard way to manage exceptions in ASP.NET (and by extension, MVC) web applications is to use the System.Transactions.TransactionScope class. It contains some useful properties: Auto Transaction...

View Article

Mocking Base Class Methods with Moq

Moq does allow you to mock base class methods, via the use of the Moq.Protected namespace. You can read about it here. Imagine you have the following scenario: class Animal {   private int timesTalked...

View Article

Adding Forms Authentication to Web API

When you create a new Web API project, it grafts the API onto the existing web project. This can prove sub-optimal in cases where you want everything (including Forms authentication) to call into the...

View Article


Running FluentMigrator Migrations at Runtime

FluentMigrator’s Migrations Runners wiki page doesn’t mention any way of running migrations through code. Why might you want to do this? Because your application is in the hands of users, or ops teams,...

View Article

Authenticating Against Web API from ASP.NET MVC

In a previous post, we talked about setting up ASP.NET MVC and Web API to accept forms authentication. With this structure in place, your MVC front-end can make Web API calls. The question is, how do...

View Article

Changing the Login URL from login.aspx on ASP.NET MVC with Forms Authentication

In a previous post, we talked about adding forms authentication to an ASP.NET project backed by Web API. One of the caveats of this setup is that if you apply the [Authorize] attribute to a controller...

View Article


How to Subclass .NET Classes from IronPython

IronPython is awesome. The recent revival of the new IronPython 3 project caused me to look again at IronPython (2.7). What if you created a base class in .NET and you want to subclass it in your...

View Article


Consuming RabbitMQ Messages in ASP.NET MVC

TLDR: You want to set up RabbitMQ in an ASP.NET process to persistently consume messages, and do something (like dump them to a database). This has to be independent of the life-cycle of an ASP.NET/MVC...

View Article
Browsing latest articles
Browse All 16 View Live




Latest Images