コード例 #1
0
        public IEnumerable <dynamic> GetAll(string schemaName, string tableName)
        {
            try
            {
                var repository = new ViewRepository(schemaName, tableName, this.MetaUser.Tenant, this.MetaUser.LoginId,
                                                    this.MetaUser.UserId);
                return(repository.Get());
            }
            catch (UnauthorizedException)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Forbidden));
            }
            catch (DataAccessException ex)
            {
                throw new HttpResponseException(new HttpResponseMessage
                {
                    Content    = new StringContent(ex.Message),
                    StatusCode = HttpStatusCode.InternalServerError
                });
            }
#if !DEBUG
            catch
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
#endif
        }
コード例 #2
0
        public void GetShouldCreateANewViewIfViewTypeDoesNotExist()
        {
            var result = _repository.Get <FakeView>();

            Assert.That(result, Is.EqualTo(_view));
        }