-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrdersDetails.cs
More file actions
50 lines (47 loc) · 1.62 KB
/
Copy pathOrdersDetails.cs
File metadata and controls
50 lines (47 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using System.Linq;
namespace GraphQLAdaptor.Models
{
public class OrdersDetails
{
public static List<OrdersDetails> order = new List<OrdersDetails>();
public OrdersDetails()
{
}
public OrdersDetails(
int OrderID, string CustomerId, int EmployeeId, double Freight)
{
this.OrderID = OrderID;
this.CustomerID = CustomerId;
this.EmployeeID = EmployeeId;
this.Freight = Freight;
}
public static List<OrdersDetails> GetAllRecords()
{
if (order.Count() == 0)
{
int code = 10000;
for (int i = 1; i < 10; i++)
{
order.Add(new OrdersDetails(code + 1, "ALFKI", i + 0, 3.3 * i));
order.Add(new OrdersDetails(code + 2, "ANATR", i + 2, 4.3 * i));
order.Add(new OrdersDetails(code + 3, "ANTON", i + 1, 5.3 * i));
order.Add(new OrdersDetails(code + 4, "BLONP", i + 3, 6.3 * i));
order.Add(new OrdersDetails(code + 5, "BOLID", i + 4, 7.3 * i));
code += 5;
}
}
return order;
}
[Key]
[GraphQLName("OrderID")]
public int? OrderID { get; set; }
[GraphQLName("CustomerID")]
public string? CustomerID { get; set; }
[GraphQLName("EmployeeID")]
public int? EmployeeID { get; set; }
[GraphQLName("Freight")]
public double? Freight { get; set; }
}
}