Entity Framework (EF) handles Many to Many relationships rather elegantly. However, if you need more control, wish to use something other than the default table name, or need to store additional properties in a Many to Many join, there is a little more work than what comes out of the box. Today I am sharing an example of one solution […]
Author: Ben Taylor
ORM Generation Complications
When using any ORM generator, they tend to be quite useful, until… As you may know, an ORM generator is a software tool used to generate repeatable code patterns used to convert software object into relational structures, primarily pointing to SQL relational data stores. When you write your own ORM you quickly find you are writing the same code over […]
EF Without Decorations
Returning to my topic of Entity Framework, today I want to compare the Decoration technique of defining classes as discussed yesterday with the fluent syntax technique. Classes used to communicate with tables through Entity Framework may be more fully defined using fluent syntax in a Model Builder than with decorations. Using fluid syntax you can define all of the options […]
Entity Framework Code First
Recently I have been working with Entity Framework V6 using the Code First Implementation. Code first has been the increasing in popularity, where you define your classes first, and then Entity Framework generates a database with tables modeled after your classes. Code first continues to grow in popularity, and appears to be the primary, or only, technique moving forward into […]
Perfect Code Day 2
When it comes to writing perfect code, it seems Aaron and I have the same opinion. Aaron writes: If have two options; I can write an easily readable and understandable test over a longer piece of code. I cannot write an easy, readable test but the actual code would be shorter and more concise. Under most circumstance I will choose […]
Writing Perfect Code
I recently read a blog about coding style. The premise was that simpler code is better. For example, if you could write a line of code using a lambda expression, it would be better than writing three lines of code using traditional coding techniques. If I were to use that same reasoning, I would be able to say, writing a […]
Decision Support Systems
Is separation of responsibilities always the best solution? Why would I even ask that question? Of course the answer is yes. Except for the fact that separation comes with a cost. Separation takes more time to implement. It makes the application more complicated. And it expects there is going to be a need to modify something in the future…a major […]
Continuous Integration – The Results are In
Continuous integration servers have been around for a long time. It consists of build engines integrated with a source tree, and in a perfect world, has hooks to execute unit tests once a successful build is achieved. With Extreme Programming, tools such as Cruise Control was released in 2001, were adapted to implement this process. Since that time the value […]
Tips to Optimize SQL Server Statistics
While I was doing research into statistics for yesterday’s editorial, I came across some characteristics of how SQL Server works with non-materialized objects and query plans, I felt useful to impart. Many of you probably already know these tips. Some you may have experienced them through trial and error; this may confirm your experience. First of all, objects that are […]
SQL Server Statistics
Statistics, in SQL Server, are very powerful. The query optimizer utilizes statistics to determine the most efficient sequence to process a query. This is pretty common knowledge. Maybe you are not aware of some of the cool capabilities Microsoft has built into statistics. Statistics maintain the distribution of data in a table. They maintain multiple ranges or bands of data […]