OJ Develops

Thoughts on software development. .NET | C# | Azure

Multiple Many-to-Many Associations - Entity Framework Code First

28 January 2014

Entity Framework Code First lets you build domain classes first without an existing database. As soon as a database is needed, Entity Framework will create the database for you based on the shape of your classes. Entity Framework is smart enough to figure out things such as column names, column types, one-to-many associations, many-to-many associations, and more, according to your intentions. But sometimes, we have to explicitly tell the framework what our intentions are. In this post, we will talk about multiple many-to-many relationships.

Read More

AngularJS and Strongly Typed Views

14 January 2014

AngularJS is a powerful templating MVC Javascript framework developed by Google. In this post, we will be talking about how to use AngularJS with ASP.NET MVC, particularly with strongly-typed views.

Read More

Custom Validator in Fluent Validation

19 December 2013

Fluent validation is an excellent validation framework for and written in .NET. It is easy to use and supports the most common validation scenarios out of the box; I highly recommend that you use it in your projects. There are times, however, that you want to add your own validators in order to support your business rules. In this post, we will be implementing a custom generic validator with arguments.

Read More

Scope Inheritance in AngularJS

13 December 2013

Scopes in AngularJS use prototypical inheritance. When a child scope tries to access a variable, it first looks for that variable in its own scope. If it doesn't find any, it looks for it in the parent scope, and so on until the $rootScope is reached. This post will illustrate this concept of inheritance in AngularJS.

Read More

Automapper Quickstart

08 October 2013

Mapping code is ubiquitous in most web applications. The most common use case is when mapping DTO's to business entities or from business entities to view models. Manually writing mapping code, though necessary, is tedious, time-consuming, error prone, and hard to maintain. Fortunately there are libraries such as AutoMapper that help us with the task.

Read More

Enabling SQL Server Authentication after Installation

19 September 2013

If you install SQL Server using the default options, Windows authentication will be enabled and SQL Server authentication will be disabled. This post discusses how to enable SQL Server Authentication after installation and also enable the sa login.

Read More