A useful extension method that c# .NET provides is Distinct(). Sometimes you need to get distinct objects by a property of those objects, however, and there is no overload of Distinct() that accepts a lambda expression. Luckily, it’s easy enough to create our own.
The exception message is: This collection already contains an address with scheme http
If you’re like me, when deploying a WCF service to a production site and seeing this error… you’re thinking WTF? Especially knowing it worked in your testing environment.
Every web application requires data validation to ensure that the data remains correct and useful. If you’re working with ASP.NET MVC, the good news is that the framework greatly simplifies this task. In this article, I’ll go over how to handle data validation when using the database first approach.
There are several great articles online on how to add data validation to an MVC project(including one over at the official ASP.NET site), but in general they all focus on the code first approach, which differs from the database first approach.