This repository was archived by the owner on Feb 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathCustomer.cs
More file actions
70 lines (53 loc) · 1.38 KB
/
Customer.cs
File metadata and controls
70 lines (53 loc) · 1.38 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
namespace MongoRepositoryTests.Entities
{
/// <summary>
/// Business Entity for Customer
/// </summary>
[CollectionName("CustomersTest")]
public class Customer : Entity
{
public Customer()
{
}
[BsonElement("fname")]
public string FirstName { get; set; }
[BsonElement("lname")]
public string LastName { get; set; }
public string Email { get; set; }
public string Phone { get; set; }
public Address HomeAddress { get; set; }
public IList<Order> Orders { get; set; }
}
public class Order
{
public DateTime PurchaseDate { get; set; }
public IList<OrderItem> Items;
}
public class OrderItem
{
public Product Product
{
get;
set;
}
public int Quantity { get; set; }
}
public class Address
{
public string Address1 { get; set; }
public string Address2 { get; set; }
public string City { get; set; }
public string PostCode { get; set; }
[BsonIgnoreIfNull]
public string Country { get; set; }
}
public class IntCustomer : IEntity<int>
{
public int Id { get; set; }
public string Name { get; set; }
}
}