OJ Develops

Thoughts, tips, and tricks on software development. .NET | C# | Azure

From Method to Func

13 July 2013

In this post we will take a journey from ordinary methods to the Func. Along the way, we will encounter delegates, anonymous methods and lambda expressions. If any of these concepts are unfamiliar to you, don't worry as they will be explained along the way.

Read More

Centralizing Session Access

17 June 2013

Storing and retrieving information from the session state is a common use case in most web applications. For example, user information might be retrieved from the database and then stored in the session upon log in of a user. Following this approach, database calls that retrieve information about a user are reduced (ideally to one call only).

Read More

Extension Methods

12 June 2013

Extension methods are a way to add functionality (methods) to types that you do not own or that you have no access to. This handy feature was introduced in .NET 3.5.

Read More

Using XML with SQL Server

10 June 2013

Sometimes there is a requirement to insert multiple values in the database. This can be done using bulk insert, table-valued functions, through XML, or simply by calling an insert procedure that inserts a single item multiple times. In this post we will be taking a look at how to do multiple inserts using a single query through XML using SQL Server 2008.

Read More

Serializing DateTime into JSON

05 June 2013

In my current project I ran into the requirement of serializing an object with a DateTime property into Json, specifically through the Json() method of the Controller class. I can't say it serialized pretty well though.

Read More

AngularJS: Using ng-repeat

22 May 2013

AngularJS is the Javascript MVC framework developed by Google. In this post we will build a simple application using AngularJS. If you aren't familiar with it, you might want to read my introduction to AngularJS first. This post will introduce the concept of controllers and the app will display a simple list of items (persons) to the view.

Read More

Simple Ways to Prevent SQL Injection Attacks

14 May 2013

Recently I've been working on a library that would allow direct CRUD operations of any object to the database. The library would detect the types and values of the properties of the classes involved then create Insert, Update, GetAll, and GetById procedures depending on what they find.

Read More

Introduction to AngularJS

06 May 2013

If you've been reading about javascript frameworks then you're probably seen AngularJS. AngularJS is a javascript framework developed by Google. It supports a MVC pattern and handles two-way data binding between the model and the view. Aside from two-way data binding, it also has support for declaring new html syntax, validation, routing, and more. In this post we will talk about the data binding capability.

Read More