Creating a linq query which results in only 1 query execution -
i have following 2 tables: *tablea *tableb
tablea has 1 many relationship tableb , therefore tableb has column foreign key tablea
tablea used create c# class called classa has bool property indicating wether has related records in tableb called hasrecords
i create this:
tablea.select(s => new classa { hasrecords = s.tableb.any() }
will create 1 query or multiple ones because of function? there way in line without triggering multiple query executions or have resort table valued function?
Comments
Post a Comment