public JsonResult UpdateCategory(ContextCategoryView model) { if (ModelState.IsValid) { var newId = this.tradingContentService.AddOrUpdateContextCategory(model); return(Json(new { id = newId, name = model.Name }, JsonRequestBehavior.DenyGet)); } return(null); }
public string AddOrUpdateContextCategory(ContextCategoryView model) { var newId = tradingRepository.AddOrUpdateContextCategory( new ContextCategory { Id = model.Id, TournamentId = model.TournamentId, Name = model.Name, CreatedOn = model.CreatedOn, EndedOn = model.EndedOn }); return(newId); }