Articles : Page 1 of 2

  • Rebuilding CoasterBuzz, Part II: Hot data objects

    Rebuilding CoasterBuzz, Part II: Hot data objects

    Mar 12
    19

    This is the second post, originally from my personal blog, in a series about rebuilding one of my Web sites, which has been around for 12 years. More: Part I: Evolution, and death to WCF After the rush to get moving on stuff, I temporarily lost interest. I went almost two weeks without touching the project, in part because the next thing on my backlog was doing up a bunch of administrative pages. So boring. Unfortunately, because most of the site's content is user-generated, you need some...


  • Using an alternate JSON Serializer in ASP.NET Web API

    Using an alternate JSON Serializer in ASP.NET Web API

    Mar 12
    09

    The new ASP.NET Web API that Microsoft released alongside MVC 4.0 Beta last week is a great framework for building REST and AJAX APIs. I've been working with it for quite a while now and I really like the way it works and the complete set of features it provides 'in the box'. It's about time that Microsoft gets a decent API for building generic HTTP endpoints into the framework. DataContractJsonSerializer sucks As nice as Web API's overall design is one thing still sucks: The built-in JSON S...


  • Referencing Routes in ASP.NET MVC The Rails Way

    Referencing Routes in ASP.NET MVC The Rails Way

    May 11
    30

    Routing is probably the most confusing aspect of working with ASP.NET MVC. It’s hard to craft a groovy URL - even harder to link properly off to that groovy URL. Rails leans on Ruby’s forgiving and friendly nature to make this a bit more simple - C#4 allows to get close to this as well. With Rails 3  you define a route in your config/routes.rb like this: match "order/receipt/:id" => "orders#receipt", :as => :receipt # receipt_url You can access this route anywhere in your application ...


  • Conditional Filters in ASP.NET MVC 3

    Conditional Filters in ASP.NET MVC 3

    Apr 11
    25

    Say you want to apply an action filter to very action except one. How would you go about it? For example, suppose you want to apply an authorization filter to every action except the action that lets the user login. Seems like a pretty good idea, right? Currently, it takes a bit of work to do this. If you add a filter to the GlobalFilters.Filters collection, it applies to every action, which in the previous scenario would mean you already need to be authorized to login. Now that is security ...


  • Using ActionFilters with ASP.NET MVC and NHibernate

    Using ActionFilters with ASP.NET MVC and NHibernate

    Mar 11
    22

    I like a challenge. My last post was how to effectively wire up data operations in an effort to get the EntityFramework machinery out of your Controller. I think people were a bit confused. On a bit of a personal note: this isn’t my first time doing this. I understand Dependency Injection, and I understand the need for IoC and Common Service Locator. I didn’t always understand these things - so I took it upon myself to try and learn them. One thing that drives me nuts about the .NET commun...


  • Using ActionFilters with ASP.NET MVC and NHibernate

    Using ActionFilters with ASP.NET MVC and NHibernate

    Mar 11
    22

    I like a challenge. My last post was how to effectively wire up data operations in an effort to get the EntityFramework machinery out of your Controller. I think people were a bit confused. On a bit of a personal note: this isn’t my first time doing this. I understand Dependency Injection, and I understand the need for IoC and Common Service Locator. I didn’t always understand these things - so I took it upon myself to try and learn them. One thing that drives me nuts about the .NET commun...


  • Using EntityFramework with ASP.NET MVC 3

    Using EntityFramework with ASP.NET MVC 3

    Mar 11
    21

    A few people have asked about a comment I made on my last post: I might suggest (in this case) creating an ActionFilter and wrapping the Action in a transaction. It’s transparent, it’s fun… and all the kids are doing it. … and it got me thinking. All of the MSDN samples that I’ve seen which talk about using EF or LinqToSql with ASP.NET MVC almost always show the context being created inside an action or being passed in via a repository. This doesn’t have to be the case - in fact it probabl...


  • Using EntityFramework with ASP.NET MVC 3

    Using EntityFramework with ASP.NET MVC 3

    Mar 11
    21

    A few people have asked about a comment I made on my last post: I might suggest (in this case) creating an ActionFilter and wrapping the Action in a transaction. It’s transparent, it’s fun… and all the kids are doing it. … and it got me thinking. All of the MSDN samples that I’ve seen which talk about using EF or LinqToSql with ASP.NET MVC almost always show the context being created inside an action or being passed in via a repository. This doesn’t have to be the case - in fact it probably...


  • Building a Self Updating Site Using NuGet

    Building a Self Updating Site Using NuGet

    Jan 11
    16

    For those of you who enjoy learning about a technology via screencast, I’ve recorded a video to accompany and complement this blog post. The screencast shows you what this package does, and the blog post covers more of the implementation details. A key feature of any package manager is the ability to let you know when there’s an update available for a package and let you easily install that update. For example, when we deployed the release candidate for NuGet, the Visual Studio Extension M...


  • ASP.NET MVC and jQuery Mobile

    ASP.NET MVC and jQuery Mobile

    Jan 11
    13

    With the release of Windows Phone 7 last year, Im really interested in mobile applications. Why? Well, developing for Windows Phone 7 did not require me to learn new things. I can use my current skill set and build cool apps for that platform. But what about the other platforms? If you look at all platforms from a web developer perspective, theres one library that also allows you to use your existing skill set: jQuery Mobile. Know HTML? Know jQuery? Know *any* web development language like P...