Shiju Varghese's Blog
Cloud First and Mobile First
-
Commands, Command Handlers and Command Dispatcher
In this post, I am trying to add some CQRS principles onto my EFMVC project. EFMVC is a small web app for demonstrating ASP.NET MVC and EF Code First. Please keep in mind that this is not the implementation CQRS patterns, but trying to add some CQRS flavors on the Solution Architecture with Commands that changes the data (Create, Update and Delete). The current implementation of command execution is implemented in a synchronous way.
-
EFMVC 1.0 Preview Released
A while ago, I have released EFMVC, a demo web app built using ASP.NET MVC 3, EF Code First and Unity. The EFMVC app has demonstrated many architectural patterns and practices such as Generic Repository, Repository pattern, Unit of Work pattern, Dependency Injection pattern and Application Service later. Today I would like to announce the release of EFMVC 1.0 Preview. This release is an early preview release that has made some changes in the solution architecture. The preview is written in ASP.NET MVC 3 version and will be migrated to ASP.NET MVC 4 with new features on later.
-
Removing EdmMetadata table in EF Code First
EF Code First Framework is using a table named EdmMetadata on the database to check the current model is compatible with the database. When your model is changing, you need to drop the database and create a new database. In that scenario, you can add a initialization strategy using DropCreateDatabaseIfModelChanges<TContext>. You can avoid the EdmMetadata table from your database so it won't check the schema of database with model. When you are using Code First Migrations or updating your database schema is manually, you don't need to EdmMetadata on the database. The following code in the DbContext class will not create EdmMetadata on the database.
-
Autofac - My Choice of IoC Container
I have been using Unity for dependency injection since the early days of ASP.NET MVC framework. Recently I have evaluated other IoC containers and really impressed with Autofac. The next version of my codeplex project EFMVC will be use Autofac as IoC container. Autofac is a lightweight IoC container that providing better performance and can easily integrate with .NET applications. Autofac is developed by Nicholas Blumhardt and the community is actively working on the code base.
-
ASP.NET MVC 4 Enhancements to Default Project Templates
The ASP.NET MVC 4 provides an additional project teamplate for Mobile Web Application. The new Project dialog is shown below
-
ASP.NET MVC 4 Developer Preview Released
Microsoft has announced the availability of ASP.NET MVC 4 Developer Preview. The following are the some of the new features of ASP.NET MVC 4 Developer Preview.
-
Auto Registration in Microsoft Unity
Unlike many other .NET IoC containers, Microsoft Unity does not support auto registrations. Auto registration is a very useful feature for any IoC container and it would be very helpful in some specific contexts. The Unity Auto Registration project in Codeplex will provide the support for automatic registration using a fluent API. You can add Unity Auto Registration package using NuGet. The following command will add reference to Unity Auto Registration.
PM> Install-Package UnityAutoRegistration
The following registration syntax will scan the all assemblies except system assemblies and will register all types that implemented the open generic type ICommandHandler<> -
Building JavaScript MVVM apps in ASP.NET MVC using KnockoutJS
JavaScript is getting more attention in modern web application development and increasing the popularity of JavaScript on every day. HTML 5 is making a revolution in web apps world and it is becoming a common platform for variety of scenarios. JavaScript is the language for HTML 5. The next question is how we can write highly maintainable JavaScript code and how to write testable JavaScript code. The answer would be to use a high level JavaScript framework such as KnockoutJS, BackboneJS and SpineJS. In this post, I will demonstrate how to use KnockoutJS in your ASP.NET MVC apps. KnockoutJS is an open source JavaScript library developed by Steven Sanderson. I am a big admirer of Steven Sanderson so I decided to first evaluate KnockoutJS and really excited about the framework so far. You can download the source code of the demo app from here
-
Speaking at Kerala Microsoft User Group on JavaScript MVVM and KnockoutJS
I will be speaking about JavaScript MVVM and KnockoutJS at Kerala Microsoft User Group, Kochi on August 20. In this session, I will provide an overview of KnockoutJS, a MVVM framework for creating rich, interactive user interfaces with JavaScript and HTML. Finally, I will demonstrate how to use KnockoutJS in your ASP.NET/ASP.NET MVC applications. The event details available from here.
-
EF Code First Migrations August 2011 CTP Released
EF Code First is a great ORM tool which lets you to develop applications in a Domain Driven approach. One of the pain point of EF Code First was the data migrations when your domain model is changing. Finally the ADO.NET team is providing a data migration solution for EF Code First that will incrementally evolve the database schema as you model changes over time. The ADO.NET team has released the CTP version of Code First migration solution named EF Code First Migrations August 2011 CTP. EF Code First Migrations is available as NuGet package named EntityFramework.SqlMigrations. The following command in the NuGet console will install the the EF Code First Migrations