public ActionResult Create(Hobby hobby)
{
try
{
if (!ModelState.IsValid)
{
return Json(GetErrorList(ModelState));
}
var result = _hobbyResource.Add(hobby);
if (result.Error != null) throw new Exception(result.Error.Message);
return Json(result);
}
catch (Exception ex)
{
Response.StatusCode = 400;
_errorSignaler.SignalFromCurrentContext(ex);
return Json(hobby);
}
}