query by interface

Posts   
 
    
mdissel
User
Posts: 92
Joined: 16-Sep-2003
# Posted on: 24-Mar-2014 11:10:39   

Is the following design/query possible with the LLBGEN Framework?


public interface IFoo
{
    string Name {get; set;}
}

public class Foo : IFoo
{
    public string Name {get; set;}
}

public class Foo2 : IFoo
{
    public string Name {get; set;}
}

Context.Query<IFoo>().Where(x => x.Name == "test")

The code should return instances of Foo/Foo2 having a name equal to "test".

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 25-Mar-2014 11:03:17   

No, that's not supported, as your system isn't code oriented. Querying by interface means an interface has to be a core citizen of the mapping system which is not something we do as code is (like it's counter part the table) following the definition of the entity, not the other way around.

Frans Bouma | Lead developer LLBLGen Pro