public override void OnException(ExceptionContext context) { if (context.Exception is EntityNotExistException) { EntityNotExistException ex = (EntityNotExistException)context.Exception; context.Result = new NotFoundObjectResult(ex.message); } }
private static CommonResponse MakeCommonResponse(EntityNotExistException e) { return(new CommonResponse(e.EntityType.NotExistErrorCode, MakeMessage(e))); }
private static string MakeMessage(EntityNotExistException e) { return(string.Format(Resource.MessageEntityNotExist, e.EntityType.Name, e.GenerateConstraintString())); }