Esempio n. 1
0
 public virtual void LastOrDefault_without_order_by_issues_client_eval_warning()
 {
     using (var context = CreateContext())
     {
         Assert.Equal(
             CoreStrings.WarningAsErrorTemplate(
                 RelationalEventId.QueryClientEvaluationWarning,
                 RelationalResources.LogClientEvalWarning(new TestLogger <RelationalLoggingDefinitions>()).GenerateMessage("LastOrDefault()"),
                 "RelationalEventId.QueryClientEvaluationWarning"),
             Assert.Throws <InvalidOperationException>(
                 () => context.Customers.LastOrDefault()).Message);
     }
 }
Esempio n. 2
0
 public virtual void Throws_when_warning_as_error()
 {
     using (var context = CreateContext())
     {
         Assert.Equal(
             CoreStrings.WarningAsErrorTemplate(
                 RelationalEventId.QueryClientEvaluationWarning,
                 RelationalResources.LogClientEvalWarning(new TestLogger <RelationalLoggingDefinitions>()).GenerateMessage("where [c].IsLondon"),
                 "RelationalEventId.QueryClientEvaluationWarning"),
             Assert.Throws <InvalidOperationException>(
                 () => context.Customers.Where(c => c.IsLondon).ToList()).Message);
     }
 }
Esempio n. 3
0
 public virtual void Last_with_order_by_issues_client_eval_warning_in_subquery()
 {
     using (var context = CreateContext())
     {
         Assert.Equal(
             CoreStrings.WarningAsErrorTemplate(
                 RelationalEventId.QueryClientEvaluationWarning,
                 RelationalResources.LogClientEvalWarning(new TestLogger <RelationalLoggingDefinitions>()).GenerateMessage("Last()"),
                 "RelationalEventId.QueryClientEvaluationWarning"),
             Assert.Throws <InvalidOperationException>(
                 () => context.Customers
                 .Where(
                     c => c.CustomerID == "ALFKI" &&
                     c.Orders.OrderBy(o => o.OrderID).Last().OrderID > 1000).ToList()).Message);
     }
 }