示例#1
0
        public ActionResult <User> Get(Guid tenantId, Guid userId)
        {
            var unverifiedTenantId = UnverifiedTenantId.From(tenantId);
            var userIdVal          = UserId.From(userId);

            try
            {
                var knownTenantId = TenantIdExistsQueryHandler.Execute(new TenantIdExistsQuery(unverifiedTenantId));

                try
                {
                    var user = UserQueryHandler.Execute(new UserQuery(userIdVal, knownTenantId));

                    return(new JsonResult(user));
                }
                catch (Exception)
                {
                    return(NotFound());
                }
            }
            catch (Exception)
            {
                return(UnprocessableEntity());
            }
        }
        public ActionResult <User> Get(Guid tenantId, Guid userId)
        {
            try
            {
                TenantIdExistsQueryHandler.Execute(new TenantIdExistsQuery(tenantId));

                try
                {
                    var user = UserQueryHandler.Execute(new UserQuery(tenantId, userId));
                    return(new JsonResult(user));
                }
                catch (Exception)
                {
                    return(NotFound());
                }
            }
            catch (Exception)
            {
                return(UnprocessableEntity());
            }
        }