If I implement this interface:
public int开发者_JAVA百科erface 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?
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.
精彩评论