Example #1
0
        private static void Monitor_EndpointChecked(EndpointCheckedEventArgs args)
        {
            var newStatus = new EndpointStatus()
            {
                Timestamp  = args.Timestamp,
                StatusCode = args.StatusCode
            };
            var endpoint = endpointRepo.Get(args.Url);

            if (StatusShouldBeReported(endpoint.LastStatus, newStatus))
            {
                ReportStatus(endpoint, newStatus);
            }

            endpoint.Statuses.Add(newStatus);
            endpointRepo.SaveChanges();
        }
Example #2
0
        private static void Monitor_EndpointChecked( EndpointCheckedEventArgs args )
        {
            var newStatus = new EndpointStatus()
            {
                Timestamp = args.Timestamp,
                StatusCode = args.StatusCode
            };
            var endpoint = endpointRepo.Get( args.Url );

            if ( StatusShouldBeReported( endpoint.LastStatus, newStatus ) )
            {
                ReportStatus( endpoint, newStatus );
            }

            endpoint.Statuses.Add( newStatus );
            endpointRepo.SaveChanges();
        }