public async Task <ActionResult> Get(int id) { await AuthenticateAdmin(); IEnumerable <ExamCategoryDto> examCategories = await Get <GetExamCategoriesQuery>().Execute(); ExamCategoryDto result = examCategories.Single(ec => ec.Id == id); return(Json(result)); }
public async Task <ActionResult> Update([FromBody] ExamCategoryDto examCategory) { await AuthenticateAdmin(); OperationResult result = await Get <UpdateExamCategoryCommand>().Execute(examCategory); if (result.Success) { return(Ok()); } else { return(BadRequest()); } }