// GET: api/Area/5 public dynamic Get(string code) { try { return(AreaMdl.get_area(code)); } catch (Exception e) { return(new { state = false, message = "Server Error", exception = e }); } }
public object Check(string code) { try { var result = AreaMdl.get_area(code); return(result != null ? (object)new { state = true, name = result.ARE_NAME } : new { state = false }); } catch (Exception e) { return(new { state = false, message = "Server Error", exception = e }); } }