Tuesday, August 12, 2014

Recipe: Albondigas

Flashback!

A few months ago, I visited a my friend  in Ann Arbor, Michigan. We smoked cigars, drank great cognacs and scotch (thanks jess!), and ate the most fantastic meatballs.

What!? Something's wrong in the state of Denmark. Meatballs doesn't belong in that statement.  These weren't your traditional meatballs you might associate with spaghetti and meatballs. No, these were albondigas at Tios Mexican Cafe.  

Out of this world!

Tios' menu description:
"Spanish style meatballs in a garlic chipotle sauce. Served with Michigan craft beer bread."
 Every part of the dish was incredible.  My favorite was using the bread to soak up the leftover sauce.  When I got back to Charlotte I had to try make them.

Meatballs

Ingredients:

  • 1 pound ground beef
  • 1 pound ground pork
  • 4 garlic cloves
  • 1/4 cup chopped scallions
  • 4 tablespoons olive oil (I like to use extra virgin)
  • 1 egg
  • 1/4 cup corn meal
Directions:
  1. Prehead the oven to 400 degrees.
  2. Minced the garlic and scallions in a food processor.
  3. Combine all the ingredients in a mixing bowl, and mix away by hand.
  4. On a baking sheet, make balls of about 2 inches in diameter.
  5. Bake for about 20-25 minutes.  Adjust the time up or down depending on  the size of meatballs you prefer.

Sauce:

Ingredients:
  • olive oil (for sauteeing)
  • 4 garlic cloves  (minced)
  • 1 small sweet onion (minced)
  • 2 jars of roasted tomato sauce
  • 1-4 chipotles  from a can of chipotles in adobe (vary the chipotles depending on your spicyness preference, the adobe will provide a great deep seasoned flavor)
  • 1 cup red wine (I use a rioja)
Directions:
  1. In a large sauce pan, Sautee the garlic and onions.
  2. In a blender, liquify the tomato sauce and chipotles
  3. Pour the tomato sauce and chipotles into the sauce pan.
  4. Add the wine.
  5. Bring to a simmer.

Serving:

Combine the meatballs in the sauce and serve.  I like will serve the sauce and meatballs on top of a bowl of rice with rice and chopped cilantro on top.

Sunday, November 10, 2013

Simple T4 Template to create knockout.js models for an Entity Framework Code First DbContext

At work I use a healthy combo of EF Code First, Asp.Net Web Api, and Knockout.  This combo is really nice for quickly creating crud apps.  Unfortunately, I find myself recreating my entities from the C# in javascript.
"Don't write the same code twice." - Advice from every code book ever.

C# model !== Javascript model, but close enough for me.

This brings me to a small project for today, create a t4 template in Visual Studio to transform the entities exposed by my DbContext into Knockout based Javascript models.

T4 Template source on GitHub



Basic DbContext with POCOs
namespace T4Templates.Entities {
    public class MyDataContext:DbContext {
        public DbSet People { get; set; }
        public DbSet Projects { get; set; }
        public DbSet Vendors { get; set; }
    }
    public class Person {
        public Guid PersonKey { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
    public class Project {
        public Guid ProjectKey { get; set; }
        public Guid Name { get; set; }
        public IEnumerable Vendors { get; set; }
    }
    public class Vendor {
        public Guid VendorKey { get; set; }
        public Guid Name { get; set; }
    }
}
Results from transform.
(function () {
    var nameSpace = 'MyNameSpaceHere';
    var ns = {};
    ns.Models = {
        Person: function (data) {
            this.PersonKey = ko.observable();

            this.FirstName = ko.observable();

            this.LastName = ko.observable();

            this.update = function (data) {
                ko.mapping.fromJS(data, {}, this);
            }
            if (data != undefined) {
                this.update(data);
            }
        },

        Project: function (data) {
            this.ProjectKey = ko.observable();

            this.Name = ko.observable();

            this.Vendors = ko.observableArray();
            this.update = function (data) {
                ko.mapping.fromJS(data, {}, this);
            }
            if (data != undefined) {
                this.update(data);
            }
        },

        Vendor: function (data) {
            this.VendorKey = ko.observable();

            this.Name = ko.observable();

            this.update = function (data) {
                ko.mapping.fromJS(data, {}, this);
            }
            if (data != undefined) {
                this.update(data);
            }
        },

    }
    window[nameSpace] = ns || {};
})();

T4 Template source on GitHub

Wednesday, September 11, 2013