views:

34

answers:

0

Hi, i have this code to get a ClassA from the database, and ClassA is superclass of ClassB. (ClassB : ClassA)

       var query = from classA in GetQuerySession().Linq<ClassA>()
                    where classA.Code.Equals(code) 
                    select classA;

        return query.FirstOrDefault();

ClassA and ClassB are mapped to different tables.

This query returns all ClassA and all ClassB elements that match the query criteria. How can i change this to get ClassA elements only?

thanks