private void startJob()
        {
            HttpClient httpClient = new HttpClient();
            Uri        uriResult;

            if (!Uri.TryCreate("_url", UriKind.Absolute, out uriResult))
            {
                _url = "http://" + _url;
            }
            UrlCheckList urlCheckList = new UrlCheckList();

            try
            {
                Task <HttpResponseMessage> response = httpClient.GetAsync(_url);
                urlCheckList.Id         = 0;
                urlCheckList.CreateDate = DateTime.Now;
                urlCheckList.UrlId      = Convert.ToInt32(_urlId);
                urlCheckList.StatusCode = response.Result.StatusCode.ToString();
                if (!response.Result.IsSuccessStatusCode)
                {
                    SendMail();
                }
            }
            catch (Exception)
            {
                //Custom Error Handlen Yazılacak
                urlCheckList.StatusCode = "Domain Error";
            }
            CustomDependency c = new CustomDependency(new UrlCheckListService(new EfUrlCheckListDal()));

            c.UrlCheckListSave(urlCheckList);
        }
Beispiel #2
0
 public IResult Save(UrlCheckList urlCheckList)
 {
     _urlCheckListDal.Add(urlCheckList);
     return(new SuccessResult());
 }
Beispiel #3
0
 public void UrlCheckListSave(UrlCheckList saveModel)
 {
     _urlService.Save(saveModel);
 }