Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EAV tables are generally a messy business, and Joe Celko (in <a href="http://www.simple-talk.com/sql/t-sql-programming/avoiding-the-eav-of-destruction/" rel="nofollow noreferrer">Avoiding the EAV of Destruction</a>) and a lot of other industry experts (e.g. <a href="http://www.simple-talk.com/sql/database-administration/five-simple--database-design-errors-you-should-avoid/" rel="nofollow noreferrer">Five Simple Database Design Errors You Should Avoid</a>) rightfully warn against using EAV constructs too much.</p> <p>All database critics aside: how would an object in .NET based on such an EAV even look like?? It could have any number of properties of any type, so basically, it would have to be a "universal" object that can take on any shape, pretty much.</p> <p>This thought makes my skin crawl and goes against the most basic concepts of a strongly typed language - yes, you can do stuff like that in a dynamic language like Ruby and Python, but in C#? </p> <p>The only viable option you have might come with the new "dynamic" type in .NET 4.0 and the ExpandoObject - an object that can take on any shape, have any properties of any type, and basically be whatever you want it to be. </p> <p>You could imagine a mapping between an EAV structure in SQL Server and an ExpandoObject in C# 4.0 - but I highly doubt the EF team has done anything in this respect, and quite honestly, I don't think they will any time soon. But this might be a possibility for you to explore.</p> <p>For the ExpandoObject, see:</p> <ul> <li>its <a href="http://msdn.microsoft.com/de-de/library/system.dynamic.expandoobject.aspx" rel="nofollow noreferrer">MSDN documentation</a></li> <li><a href="http://www.c-sharpcorner.com/News/NewsDetail.aspx?NewsID=553" rel="nofollow noreferrer">C# 4.0: Introducing the Expando Object</a></li> <li>here on SO: <a href="https://stackoverflow.com/questions/1653046/what-are-the-true-benefits-of-expandoobject">What are the true benefits of ExpandoObject?</a></li> <li><a href="http://blogs.msdn.com/csharpfaq/archive/2009/10/01/dynamic-in-c-4-0-introducing-the-expandoobject.aspx" rel="nofollow noreferrer">Dynamic in C# 4.0 - Introducing the ExpandoObject</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload