Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to solve code analysis warning CA1506 : "Avoid excessive class coupling"
    primarykey
    data
    text
    <p>I am facing CA1506 code analysis warning for following code</p> <pre><code>private void ShowProductStatistics(object obj) { this.currentProduct = obj as Products; Task.Factory.StartNew(() =&gt; { var topOrderQuery = (from orderDetail in new XPQuery&lt;OrderDetails&gt;(new Session()) where orderDetail.ProductID.ProductID == currentProduct.ProductID orderby (orderDetail.UnitPrice * orderDetail.Quantity) descending select new TopOrder { OrderId = orderDetail.OrderID.OrderID, TotalSales = orderDetail.UnitPrice * orderDetail.Quantity }).ToList().Take(10); DispatcherExt.CurrentDispatcher.BeginInvoke(new Action(() =&gt; { this.TopProduct = topOrderQuery; })); var orderPerYearQuery = (from order in new XPQuery&lt;OrderDetails&gt;(new Session()) where order.ProductID.ProductID == currentProduct.ProductID group order by new { order.OrderID.OrderDate.Year } into g select new OrderPYear { TotalOrder = g.Count(), OrderYear = g.Key.Year }).ToList(); DispatcherExt.CurrentDispatcher.BeginInvoke(new Action(() =&gt; { this.OrderPerYear = orderPerYearQuery; })); var salesPerYearQuery = (from order in new XPQuery&lt;OrderDetails&gt;(new Session()) where order.ProductID.ProductID == currentProduct.ProductID group order by new { order.OrderID.OrderDate.Year } into g select new SalesPYear { Sales = g.Sum(p =&gt; p.UnitPrice * p.Quantity), Year = g.Key.Year }).ToList(); DispatcherExt.CurrentDispatcher.BeginInvoke(new Action(() =&gt; { this.SalesPerYear = salesPerYearQuery; })); }); } </code></pre> <p>I tried to solve this warning by following suggestions given in the msdn but not succeeded. Can anybody help me to solve this warning ??</p> <p>Thanks &amp; regards, Rudresh </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload