public ActionResult GetVersion() { try { AppVersion appVersion; using (var ctx=new DriverDBContext()) { appVersion = ctx.AppVersions.OrderByDescending(x => x.VersionCode).FirstOrDefault(); } var result = new GetVersionResponse() { VersionName = appVersion.VersionName, VersionCode = appVersion.VersionCode, DownloadUrl = Request.Url.Authority+"/apk/" + appVersion.FileName }; return ApiResponse.OK(JsonConvert.SerializeObject(result)); } catch (Exception) { return ApiResponse.UnknownError; } }