Sales_by_Year() 공개 메소드

public Sales_by_Year ( Nullable beginning_Date, Nullable ending_Date ) : ObjectResult
beginning_Date Nullable
ending_Date Nullable
리턴 ObjectResult
        // Task 05.
        // Write a method that finds all the sales by specified region
        // and period (start / end dates).
        public static IEnumerable<Sales_by_Year_Result> FindSalesByRegionAndPeriod(string shipRegion, DateTime startYear, DateTime endYear)
        {
            NorthwindEntities context = new NorthwindEntities();

            var salesByRegionAndYear =
                from salesByYear in context.Sales_by_Year(startYear, endYear)
                join order in context.Orders
                .Where(o => o.ShipRegion == shipRegion)
                on salesByYear.OrderID equals order.OrderID
                select salesByYear;

            return salesByRegionAndYear;
        }