Exemplo n.º 1
0
 public void AddDataPoint(double value, DateTime createdAt, StatusDataContext context = null)
 {
     if (DataPoints != null)
     {
         DataPoints.Add(new DataPoint
         {
             Value     = value,
             MetricId  = Id,
             CreatedAt = createdAt
         });
     }
     else if (context == null)
     {
         throw new ArgumentNullException(nameof(context), "You must provide a context if the DataPoints collection isn't valid.");
     }
     else if (context.Entry(this).IsKeySet)
     {
         context.Add(new DataPoint
         {
             Value     = value,
             MetricId  = Id,
             CreatedAt = createdAt
         });
     }
     else
     {
         throw new InvalidOperationException("Could not add a new DataPoint");
     }
 }
Exemplo n.º 2
0
        public void AddUpdate(IncidentStatus status, string message, StatusDataContext context = null)
        {
            UpdatedAt = DateTime.UtcNow;

            if (Updates != null)
            {
                Updates.Add(new IncidentUpdate
                {
                    IncidentId = Id,
                    Status     = status,
                    Message    = message
                });
            }
            else if (context == null)
            {
                throw new ArgumentNullException(nameof(context), "You must provide a context if the Updates collection isn't valid.");
            }
            else if (context.Entry(this).IsKeySet)
            {
                context.Add(new IncidentUpdate
                {
                    IncidentId = Id,
                    Status     = status,
                    Message    = message
                });
            }
            else
            {
                throw new InvalidOperationException("Could not add a new Incident");
            }
        }
Exemplo n.º 3
0
 public GetComponentGroupByIdQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 4
0
 public UpdateIncidentUpdateCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 5
0
 public AuthenticationService(StatusDataContext dataContext, PasswordHasher passwordHasher)
 {
     _dataContext    = dataContext;
     _passwordHasher = passwordHasher;
 }
 public GetIncidentUpdateByIdQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public DeleteMetricCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 8
0
 public AddIncidentCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 9
0
 public GetUserByIdQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 10
0
 public GetAllIncidentsQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public AddUserCommandHandler(StatusDataContext userService, PasswordHasher passwordHasher)
 {
     _dataContext    = userService;
     _passwordHasher = passwordHasher;
 }
Exemplo n.º 12
0
 public DeleteComponentCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 13
0
 public AddDataPointCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 14
0
 public GetAllComponentsQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public GetMetricByIdQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public GetAllUsersQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public GetAllMetricsQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public StatusDayGenerationService(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public AddComponentGroupCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
 public UpdateComponentStatusCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 21
0
 public DeleteUserCommandHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 22
0
 public UpdateUserCommandHandler(StatusDataContext dataContext, PasswordHasher passwordHasher)
 {
     _dataContext    = dataContext;
     _passwordHasher = passwordHasher;
 }
Exemplo n.º 23
0
 public GetDataPointsForDayIntervalQueryHandler(StatusDataContext dataContext)
 {
     _dataContext = dataContext;
 }
Exemplo n.º 24
0
 public StatusController(StatusDataContext dataContext, SiteStatusCalculationService siteStatusCalculation, StatusDayGenerationService statusDayGeneration)
 {
     _dataContext           = dataContext;
     _siteStatusCalculation = siteStatusCalculation;
     _statusDayGeneration   = statusDayGeneration;
 }