示例#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();
        }
示例#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();
        }