示例#1
0
 /// <summary>Creates a <see cref="UserReference"/> model.</summary>
 public static UserReference CreateUserReference(OpenAirClient.User user) =>
 user == null ?
 null :
 new UserReference
 {
     OpenAirUserId = user.Id.Value,
     Email         = user.Address.FirstOrDefault()?.Email
 };
示例#2
0
 /// <summary>Creates a <see cref="User"/> model.</summary>
 public static User CreateUser(string id, string partitionKey, OpenAirClient.User user, UserReference manager, Department department, Customer[] customers) =>
 new User
 {
     Id            = id,
     PartitionKey  = partitionKey,
     OpenAirUserId = user.Id.Value,
     Name          = user.Name,
     Email         = user.Address.FirstOrDefault()?.Email,
     Active        = user.Active ?? false,
     Department    = department,
     Manager       = manager,
     Customers     = customers
 };
示例#3
0
 /// <summary>Creates a <see cref="User"/> model.</summary>
 public static User CreateUser(
     string id,
     OpenAirClient.User user,
     UserReference manager,
     Department department,
     Customer[] customers,
     User storedUser) =>
 new User
 {
     Id            = id,
     OpenAirUserId = user.Id.Value,
     Name          = user.Name,
     Email         = user.Address.FirstOrDefault()?.Email,
     Active        = user.Active ?? false,
     StartDate     = user.StartDate,
     Department    = department,
     Manager       = manager,
     Customers     = customers,
     Role          = storedUser?.Role ?? 0,
     GoogleUserId  = storedUser?.GoogleUserId,
     Properties    = storedUser?.Properties,
 };