forked from zzzprojects/System.Linq.Dynamic.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.cs
More file actions
70 lines (53 loc) · 1.74 KB
/
User.cs
File metadata and controls
70 lines (53 loc) · 1.74 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.Collections.Generic;
namespace System.Linq.Dynamic.Core.Tests.Helpers.Models
{
public class User
{
public Guid Id { get; set; }
public SnowflakeId SnowflakeId { get; set; }
public string UserName { get; set; }
public int? NullableInt { get; set; }
public int Income { get; set; }
public UserProfile Profile { get; set; }
public UserState State { get; set; }
public List<Role> Roles { get; set; }
public bool TestMethod1()
{
return true;
}
public bool TestMethod2(User other)
{
return true;
}
public bool TestMethod3(User other)
{
return Id == other.Id;
}
public static IList<User> GenerateSampleModels(int total, bool allowNullableProfiles = false)
{
var list = new List<User>();
for (int i = 0; i < total; i++)
{
var user = new User
{
Id = Guid.NewGuid(),
SnowflakeId = new SnowflakeId(((ulong)long.MaxValue + (ulong)i + 2UL)),
UserName = "User" + i,
Income = 1 + (i % 15) * 100
};
if (!allowNullableProfiles || (i % 8) != 5)
{
user.Profile = new UserProfile
{
FirstName = "FirstName" + i,
LastName = "LastName" + i,
Age = (i % 50) + 18
};
}
user.Roles = new List<Role>(Role.StandardRoles);
list.Add(user);
}
return list.ToArray();
}
}
}