69
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
5
public class Program
6
{
7
public static void Main()
8
{
9
List<Sale> sales = new List<Sale>
10
{
11
new Sale { SaleID = 1, CustomerID = 1, ProductID = "ProductA", Date = new DateTime(2023, 1, 1), Amount = 100m },
12
new Sale { SaleID = 2, CustomerID = 2, ProductID = "ProductB", Date = new DateTime(2023, 1, 2), Amount = 150m },
13
new Sale { SaleID = 3, CustomerID = 1, ProductID = "ProductA", Date = new DateTime(2023, 1, 3), Amount = 200m },
14
new Sale { SaleID = 4, CustomerID = 3, ProductID = "ProductC", Date = new DateTime(2023, 1, 4), Amount = 300m },
15
new Sale { SaleID = 5, CustomerID = 2, ProductID = "ProductA", Date = new DateTime(2023, 1, 5), Amount = 250m }
16
};
17
18
List<Customer> customers = new List<Customer>
19
{
20
new Customer { CustomerID = 1, Age = 25, Gender = "Male", Location = "City A" },
21
new Customer { CustomerID = 2, Age = 30, Gender = "Female", Location = "City B" },
22
new Customer { CustomerID = 3, Age = 22, Gender = "Male", Location = "City A" }
23
};
24
Cached Result
r3.Rank = 2
0 1 2 3 4 7
0 1 2 3 4 7