예제 #1
0
        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);
        }
예제 #2
0
        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;
        }
예제 #3
0
 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");
     }
 }
예제 #4
0
 public UserQuery(UserId id, KnownTenantId tenantId)
 {
     Id       = id;
     TenantId = tenantId;
 }