Accept Interface into Collection (Covariance) troubles with nHibernate
I am using Fluent nHibernate for my persistence layer in an ASP.NET MVC application, and I have come across a bit of a quandry. I have a situation where I need to use an abstraction to store objects into a collection, in this situation, an interface is the most logical choice if you are looking at a pure C# perspective. Basically, an object ( Item ) can have Requirements . A requirement can be many things. In a native C# situation, I would merely accomplish this with the following code. interface IRequirement { // methods and properties neccessary for evaluation } class Item { virtual int Id {