-
So what is Closure?
I’m not talking about closure in a relationship :). I am talking about closure in programming. I first encountered closure in JavaScript the hard way. I was debugging for days the following code as to why it was not behaving the way I expect it to be. var setRowsOnclickEvent = function () { var table = $("tableList"); for (var i... Read More
-
C#: Predicates in LINQ to Entities
If you started programming MVC, in particular the Entity Framework Model, and find yourself filtering your data model using the **Where()** method, you should know by now that you can chain this method instead of using the query syntax. // using query syntax - calling Where method once carQuery.Where(c => c.Color == ‘red’ && c.Price ... Read More
-
ASP.NET: Beginner's Resource on MVC 4, Entity Framework, and Razor
New to MVC 4/Entity Framework/Razor? Then here are some links that are useful: Getting Started with EF 5 using MVC 4 Tutorial The tutorial above uses Code First to a New Database, meaning you create the EF model classes and generate the database. But if you have an existing database, you can use Code First to an Existing Database. For ... Read More
-
C#: Quick notes on some cool features…
… namely object initializer, collection initializer, implicitly typed local variable, anonymous type, anonymous method, and lambda expression. Object Initializer // we have here an object we are going to initialize in some other class public class ToDoItem { // the following are the auto-implemented or automatic properties public in... Read More
-
Design Patterns: Strategy, Observer, and Decorator
Here and in the next posts, I will talk about design patterns, it’s definition, the guiding design principles they embody, and their C# examples. But before you dive into design patterns, here is a refresher on four OO basics. Design Pattern #1: Strategy Pattern Defines a family of algorigthms, encapsulates each one, and makes them intercha... Read More