public async Task <IHttpActionResult> Samples(long labId, string query = null) { var(_, isLabManager) = await GetLab(labId); return(JsonWithPermissions(new { Results = await LabsDao.ListSamples(this, labId, query) }, isLabManager, isLabManager, isLabManager)); }
public async Task <ActionResult> Samples(Lab lab, string query = null) { var userId = HttpContext.User.Identity.GetUserId(); var model = new LabsSamplesViewModel { Lab = lab, Query = query, LabSamples = await LabsDao.ListSamples(this, lab.LabId, query), IsLabManager = lab.UserIsLabManager(userId) }; return(View(model)); }