• WF4 hosting option

    • WorkflowInvoker

      Simple "method call" style of workflow execution for short-lived worklfow (persistence is not allowed)

  • Debugging T4

    1. add "template debug="true""
    2. cd %temp%, and find the latest generated cs file
    3. Add System.Diagnostics.Debugger.Break() in you template file, below is example of simple template.
    
  • vs.net template

    User' template location C:\Documents and Settings\[user_name]\My Documents\Visual Studio 2010\Templates\ItemTemplates C:\Documents and Settings\[user_name]\My Documents\Visual Studio 2010\Templates\ProjectTemplates

  • The "OnDelete" property of navigation in Entity Framework

    This property affects the the behavior of entity framework when delete an entity. Here are two scenario.

    [Fact]
            public void can_delete_order_with_lines_loaded()
            {
                TestEntities db = new TestEntities();
                Order o1 = db.Orders.Include("OrderLines").First();
                db.DeleteObject(o1);
                db.SaveChanges();
    
    
  • jQuery.globalEval

    $.globalEval utility is a useful function, because it is preferred compare with eval in calling ajax script. What it does is adding script tag to document, then remove it later.

    globalEval: function( data ) {
     if ( data && rnotwhite.test(data) ) {
      // Inspired by code by Andrea Giammarchi
      // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
      var head = document.getElementsByTagName("head")[0] || document.documentElement,
       script = document.createElement("script");