Category: Development

  • Detaching specific objects using Entity Framework before SaveChanges

    Sometimes in large processes that span across multiple classes, it’s possible that an entity is added to Entity Framework’s context tracking. I’ve run into this scenario where we accidentally save things that get immediately deleted afterwards.

    Let’s look at a neat solution that will allow you to detach specific objects out of Entity Framework’s context. In theory this can go in several places: In the code you know causes the entities to be added or before the call to SaveChanges. In this example we’ll look at the latter because it is a nice and generic spot.

    (more…)

  • Cannot set headers after they are sent to the client

    When you are using Node.js with Express and you’ve received the dreaded error [err_http_headers_sent]: cannot set headers after they are sent to the client where do you even begin with err_http_headers_sent’. This article will explore common causes of this error, such as calling res.writeHead, res.write, or res.redirect.

    A problem occurs when servers send out headers after the message has been received by the client. Node JS applications send multiple responses to the same request – eg. calling the request twice instead of a single request with one response res.send headers.

    (more…)

  • Knockout isdirty custom data binding

    This is probably one of my favorite data bindings for Knockout.js: isdirty. The concept behind the function is to track when there is a change to any object including any of its properties. It’s extremely powerful handling nested objects as well.

    Let’s take a look at how to use:

    (more…)

  • LINQ Group By to Dictionary Object

    So many times to have a list of objects that I want to group – as an example – by a customer ID. The end result that I would like would be a: Dictionary<long, List>

    (more…)

  • nlapiCreateRecord vs nlapiTransformRecord – What’s the difference?

    NetSuite Restlet development can be hard; finding documentation is almost next to impossible. I’ve finally had a personal break through of:

    What is the difference between nlapiCreateRecord and nlapiTransformRecord?

    This article assumes that you have some NetSuite experience and have created a NetSuite Restlet. I have written a previous article that describes how to authenticate with NetSuite for calling a Restlet using token based authentication that should help you get up-to-speed.

    (more…)