Reputation: 5943
If I implement this interface:
public interface IProductsRepository
{
IQueryable<Product> Products { get; }
}
... using Linq to SQL
Will this produce real database queries?
var x = from p in repositoryInstance.Products where price > 100;
If so how can I avoid callers from executing complex and slow sql statements?
Upvotes: 0
Views: 54
Reputation: 456777
LINQ to SQL (and other LINQ providers) will not allow invalid SQL statements. If possible, a compile-time error will prevent the code from compiling. If that's not possible, an error will be thrown at runtime.
Upvotes: 3