public IEnumerable <dynamic> Get([FromUri] long[] kanbanIds, [FromUri] object[] resourceIds) { try { var repository = new KanbanRepository(this.MetaUser.Tenant, this.MetaUser.LoginId, this.MetaUser.UserId); return(repository.Get(kanbanIds, resourceIds)); } 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 }
public async Task <IEnumerable <dynamic> > GetAsync([FromUri] long[] kanbanIds, [FromUri] object[] resourceIds) { if (kanbanIds == null || resourceIds == null) { return(null); } try { var repository = new KanbanRepository(this.AppUser.Tenant, this.AppUser.LoginId, this.AppUser.UserId); return(await repository.GetAsync(kanbanIds, resourceIds).ConfigureAwait(false)); } 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 }