public User GetUserOrNull(UserId userId, KnownTenantId tenantId) { if (userId.Value == Guid.Parse("10000000-0000-0000-0000-000000000000") && tenantId.Value == Guid.Parse("20000000-0000-0000-0000-000000000000")) { return(new User(userId, tenantId, Name.From("Chester"))); } return(null); }
public User(UserId userId, KnownTenantId tenantId, Name name) { UserId = userId; TenantId = tenantId; if (string.IsNullOrEmpty(name)) { throw new ArgumentException("name is null or empty"); } Name = name; }
public KnownTenantId Execute(TenantIdExistsQuery query) { if (query == null) { throw new ArgumentException("query is null."); } if (query.TenantId.Value == Guid.Parse("20000000-0000-0000-0000-000000000000")) { return(KnownTenantId.From(query.TenantId.Value)); } else { throw new Exception($"TenantId '{query.TenantId}' is unknown"); } }
public UserQuery(UserId id, KnownTenantId tenantId) { Id = id; TenantId = tenantId; }