Localization in ASP.Net MVC Projects



Hello all,

As I am new to .Net Framework & ASP.Net MVC, I was looking in to various articles that would give clear step by step instructions as to how to add localization to ASP.Net MVC Projects. Especially, localization of string resources.

Here is a fantastic article on Localization in ASP.Net MVC projects.

Thanks to the author.



Linq – Distinct by a particular column



I had a list of tags for a particular user. I wanted to show only unique tags. I initially thought there would be something an inbuilt ‘distinct’ operator in Linq. Unfortunately not. I then discovered the Distinct() function. But it doesn’t support filtering the results by a particular column.

Thanks to this StackOverflow question that set my direction. It says that I must use the ‘group by’ operator, which I did.

Following is the code that I ended up with:

1
2
3
4
5
//distinct tags for a particular user
var tags = from t in _db.Tags 
               where t.UserId == userId
               group t by t.Name into g
               select g.FirstOrDefault();

Since the query returns a group, we must select the first item in the group. Hence FirstOrDefault().

Thanks.



Why I upgraded to Entity Framework 4?



I was happily working with Entity Framework 1 until I read at several places about its lack of important features that are normally expected from an ORM framework. I started thinking seriously about upgrading to Entity Framework 4 (yes, the next version after Entity Framework 1) after I read this No Confidence letter. It lists all the issues that EF1 has and also suggests improvements. Several architects signed it.

So I upgraded to Entity Framework 4. This required me to upgrade my projects to Visual Studio 2010 & .Net Framework 4. Along with this, I also upgrade my MVC 2 project to MVC 3 with the help of this article.

Although POCO & Persistence Ignorance are the two most-liked features, they did not interest me because I had already generated the Entity classes from the database in EF1 and mapped them to my own model. What interested me was Lazy Loading and Foreign key association.

Entity Framework 4 addresses several issues and it has undergone a major rework. Worth upgrading.

Thanks.



HTTP Test Client



When developing a RESTful Web service in ASP.Net MVC I was looking for a HTTP Test client that I can be used to test the RESTful API that I had created. It is easy to test HTTP GET with a browser. What I was looking for in the tool was the ability to HTTP POST/PUT/DELETE to any Url. Thanks to Stackoverflow where chris recommended a fantastic freeware tool called Fiddler

Definition from Fiddler’s website: Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and “fiddle” with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Thanks.



RESTful Web Service Using ASP.Net MVC



Piers Lawson wrote excellent series of articles to guide you to write RESTful web service using ASP.Net MVC framework.

There are several parts (24 at the time of writing this post). But I think the first 12 parts are good for beginners to start with.

Part 1Part 2Part 3Part 4Part 5aPart 5bPart 6Part 7Part 8Part 9Part 10Part 11Part 12

Thanks.



Tools to compare & sync Sql Server databases



One of my projects wanted me to look for a good software to compare and synchronize Microsoft Sql Server databases. Here is a list of free and commercial tools. I have not installed and tried all of them so I cannot tell which is the best. Thanks to my colleagues who had given me links to some tools.

RedGate – SQL Compare seemed to be the leader. If you are looking for a free tool then you can try Open DBDiff. We wanted a tool that can help use copy diff data between the databases being compared. This is what “Scripting” means in the below table. We couldn’t find any free tool that can compare data and also generate script for migration. Thanks.

Software Name Price Primary Features
MSSQL.SchemaDiff Free Schema Only/No scripting
RedGate – SQL Compare $395/$595 Data & schema/Scripting
ApexSQLDiff $399.00 Schema Only/Scripting
Innovartis – DB Ghost Schema Compare $350 Schema Only/Scripting
Sofotex – DB Synchro Compare $499 Schema Only/Scripting
SQL Accessories – SQL Examiner $300 Schema Only/Scripting
SQLDelta $330 Data & schema/Scripting
Tetratrax – Database Compare $195 Data & schema/Scripting
AdeptSQL Diff $320 Data & schema/Scripting
Open DBDiff FREE Schema Only/Scripting
DatabaseCompare $199 Data & schema/Scripting
SQL DB Tools – SQLDBDiff $60 Data & schema/Scripting
SQL Effects – SQL Accord $139/FREE Advanced schema compare/Basic schema compare
DBComparer Free Schema Only/Scripting
StarInix Database Compare Free Schema Only/No scripting
Yessoft Sql Server Compare Free Schema Only/No scripting
BucketsoftData Comparisons Express Free Data & Schema/No Scripting/One table at a time
SCT $99 Data & Schema/No Scripting


Check website in different browsers using Adobe BrowserLab



I have been using a very interesting cross-browser testing tool called Adobe BrowserLab

Adobe Browserlab

Adobe Browserlab is a web hosted service that lets designers view and test web site designs on multiple browsers and operating systems for compatibility before publishing.

It supports following Internet browsers: Firefox, Internet Explorer, Chrome & Safari.

Thanks.



Source control your website for better SEO



When multiple developers work on a single website project it is obvious to use a source control software such as SVN, CVS etc. But you should do it even if you are the only developer working on the project.

Why? Source controlling helps an SEO expert to analyze the impact of a change on website traffic.

Imagine that you have modified some pages of your website (page title etc). After few days you wonder why the sales have dropped. You have totally forgotten the last changes you made to the website. Your source controlled website will help you to track every change made to it. You can easily recover back your sales.

Thanks



ASP chooses a sensible name



The Association of Shareware Professionals has renamed itself to the Association of Software Professionals (ASP).


Association of Software Professionals

Details of the name change can be found here.

I have been a member of ASP for many years now. If you are running a software company then I strongly suggest that you join the ASP. The members’ discussion group (newsgroup) will give you valuable tips for marketing your software, SEO, software registration, protection, new product development, product ideas, website feedback, product review etc.

Moreover, members of the ASP offer their products at discount price to other co-members. I take this benefit each year and save hundreds of dollars.
Thanks.

The Association of Shareware Professionals has renamed itself today to the Association of Software Professionals.