Articles : Page 1 of 1

  • Abstracting away issues of HttpContext from your ASP.NET MVC controllers

    Abstracting away issues of HttpContext from your ASP.NET MVC controllers

    Feb 12
    03

    I've noticed that I write software in one of three modes: For myself: Shortcuts, less testing, not well-factored. For myself but in public: Mostly POP Forums, which I try to avoid letting it suck since others will use it and see the code. For sharing: Any day job or gig where others will use or maintain your code. You don't want to unleash crapsauce on others. I have to admit that second case isn't the most clean of endeavors. While I'm generally happy with the forum app and the feedba...


  • 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...


  • 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...


  • ASP.NET MVC Unit Testing with UpdateModel and TryUpdateModel

    ASP.NET MVC Unit Testing with UpdateModel and TryUpdateModel

    Jan 11
    25

    Last week I was in the middle of re-writing an old MVC application. The app was written during the early days of MVC, and as a consequence it was a playground for learning and experimentation. As a developer, I am continuously learning new tricks so its’ no surprise that when I look at the code I wrote a few years ago, I generally will feel the urge to refactor it. For example, when I started out with ASP.NET MVC I did not fully understand how the model binders worked. Unfortunately, this mean...


  • Are you Mocking Me?

    Are you Mocking Me?

    Jan 11
    15

    Jimmy has had a couple posts (mocks, mocks, and less mocks) that prompted Derick to post this on his experience with tests Id like to add my thoughts to mix. First, let me say Im not offering an answer to Dericks question (sorry Derick), simply some ideas to consider. If they help you, great. If not, please join the mix. Not All Tests are created equal If I told you there are only X types of programs you can write to solve any problem and they could only be created a certain way, etc. youd ...



  • 1