I have three simple classes
public class Asset
{
public int ID {get;set;}
public virtual Category {get;set;}
}
public class Category
{
public int ID {get;set;}
}
public class AssetCollection
{
public int ID {get;set;}
public virtual ICollection<Asset> Assets {get;set;}
??????public bool HasAssetWithCategory(int ID)
{
????????????
}
}
I want to be able select from context HasAssetWithCategory like this
var assets = context.AssetCollections.Where(m => m.HasAssetWithCategory(SomeID));
I do not have clue even where to start.