The last few years in the .NET ecosystem have been confusing, with the launch of .NET Core and ASP.NET Core. I’m clearing up the confusion by keeping it simple and just hitting the key points, rather than going into exhaustive depth on every little detail.
The last few years in the .NET ecosystem has been a confusing one. With the release of .NET Core and ASP.NET Core, a lot of people aren’t sure what these are and how they relate to the already existing .NET and ASP.NET platforms.
Have you ever acquired or written code that has classes that do several jobs? Do the classes have multiple responsibilities? If so, stop…..and refactor ASAP! Please remove the dependencies and break these classes into smaller single purpose classes.
The Entity Framework is a fantastic tool that reduces development time on new projects. While it used to take a significant amount of time to write a data access layer, the Entity Framework now handles much of this for you. There are many good reasons to use the Entity Framework, but it requires some care to use properly; poor use can result in substantial performance degradation. I’ve been able to distil the majority of what a developer needs to know about EF performance down to three concepts.
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.
This blog will show you String Concatenation and .NET’s StringBuilder Class. The differences between the two and in what situation one is more appropriate than the other.
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.