Prefixing ID columns with the table name in Entity Framework

Posted by: Imar Spaanjaars at Wednesday, January 08, 2014 9:22:48 AM in: .NET General
I recently got a question about the database configuration part of my article series on N-Layer design in ASP.NET. In my model, all classes inherit DomainEntity<T> that defines a primary key called Id. This in turn means all primary key columns in the database are called Id as well. The reader wanted to know if it was possible to prefix that column with the entity / table name. So, the Id column in the People table would be called PersonId, the Id in EmailAddress would be called EmailAddressId and so on. This has always been possible (and easy to do) for separate entities, but EF 6's custom conventions makes it a lot easier to do it for the entire model.
Read on ...

ASP.NET N-Layered Applications - Extensions, Tools and Wrapping Up (Part 10)

Posted by: Imar Spaanjaars at Wednesday, December 18, 2013 4:02:31 PM in: ASP.NET 4.5

Note: this is part ten in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 10 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part I’ll discuss a few miscellaneous topics that I haven’t touched in previous articles in the series.

Read on ...

ASP.NET N-Layered Applications - Importing Data Using the API (Part 9)

Posted by: Imar Spaanjaars at Wednesday, December 04, 2013 9:02:14 PM in: ASP.NET 4.5

Note: this is part nine in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 9 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part you’ll see how to build a command line application to import data from an external source (a CSV file in this case), using the application’s repository and model classes. Although this article is not related to ASP.NET directly, many ASP.NET developers may still benefit from it as importing data from an external resource is a common activity for ASP.NET developers.

Read on ...

ASP.NET N-Layered Applications - Implementing a WCF 4.5 Frontend (Part 8)

Posted by: Imar Spaanjaars at Wednesday, November 13, 2013 9:01:55 PM in: ASP.NET 4.5

Note: this is part eight in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 8 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part you’ll see how to build a WCF service that makes use of the model and repository projects I have shown in the first five articles in this series. The WCF service can be used by different types of applications to access contact people and their related data.

Read on ...

ASP.NET N-Layered Applications - Implementing a Web Forms 4.5 Frontend (Part 7)

Posted by: Imar Spaanjaars at Tuesday, October 22, 2013 6:01:36 PM in: ASP.NET 4.5

Note: this is part seven in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 7 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part you’ll see how to build a Web UI using ASP.NET Web Forms and make use of the model and repository projects I have shown in the first five articles in this series.

Read on ...

ASP.NET N-Layered Applications - Implementing an ASP.NET MVC 4 Frontend (Part 6)

Posted by: Imar Spaanjaars at Saturday, September 28, 2013 2:52:15 PM in: ASP.NET 4.5

Note: this is part six in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 6 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part you’ll see how to build a Web UI using ASP.NET MVC 4 and make use of the model and repository projects I have shown in the past five articles.

Read on ...

ASP.NET N-Layered Applications - Implementing a Repository using EF Code First (Part 5)

Posted by: Imar Spaanjaars at Thursday, September 05, 2013 2:00:52 PM in: ASP.NET 4.5

Note: this is part five in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 5 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part you’ll see how to build a concrete implementation of the repository that was introduced in the preceding article. I’ll show you how to create a data access layer that targets the Entity Framework (EF) and implements the repository interface in a clean and maintainable way.

Read on ...

ASP.NET N-Layered Applications - Implementing a Model (Part 4)

Posted by: Imar Spaanjaars at Wednesday, August 14, 2013 9:52:34 AM in: ASP.NET 4.5

Note: this is part four in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 4 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part you’ll see how to build a model using POCO classes – Plain Old CLR Objects – that have no dependencies to external frameworks (such as a requirement to inherit from an Entity Framework base class). In addition, you will see how to create unit tests for your POCO classes as well as lay a foundation for validation of these classes.

Read on ...

ASP.NET N-Layered Applications - Making your Projects Unit Testable (Part 3)

Posted by: Imar Spaanjaars at Tuesday, July 30, 2013 6:44:14 PM in: ASP.NET 4.5

Note: this is part three in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 3 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. In this part you’ll see how to make your solution unit testable. In addition, you’ll see how to setup a project for Integration tests which work similar to unit tests but that target the database directly.

Read on ...

ASP.NET N-Layered Applications - Setting up the Solution in Visual Studio (Part 2)

Posted by: Imar Spaanjaars at Friday, July 12, 2013 7:59:33 PM in: ASP.NET 4.5

Note: this is part two in a series of ten. If you rather read this entire series off-line, you can buy the full series as a convenient PDF document that comes with the full source. Besides the convenience, buying the PDF will also make you feel good as it shows your appreciation for the articles and helps me pay the bills for my server and hosting so I can keep running imar.spaanjaars.com and continue to provide you with great content. For more details, check out this post that shows you how you can buy the entire series right now.

This is Part 2 in a series of 10 that show you how to build N-Layered applications using ASP.NET 4.5 and Entity Framework 5 Code First. The previous article provided some history of the architecture of the Contact Manager application and gave a broad overview of the new architecture. In this installment, things get a bit more concrete when you see how to setup a solution in Visual Studio 2012. The VS solution is going to contain three class libraries: one for the Infrastructure, one for the application’s Model and one to hold the Entity Framework (EF) Repository implementation. I’ll also add four frontend projects (an ASP.NET MVC 4, a Web Forms project, a WCF service project, and a windows command line application) which are discussed in detail in Part 6, 7, 8 and 9 of this series respectively. In the next article in this series I’ll extend the solution with four more projects for unit, integration, UI and service tests.

Read on ... 12345678910111213141516171819202122232425262728293031