Exemplo n.º 1
0
        public IActionResult Create([FromBody] RamMetricCreateRequest request)
        {
            repository.Create(new RamMetric
            {
                Available = request.Available
            });

            return(Ok());
        }
Exemplo n.º 2
0
 public IActionResult Create([FromBody] RamMetricCreateRequest request)
 {
     _repository.Create(new RamMetric
     {
         Time  = request.Time,
         Value = request.Value
     });
     return(Ok());
 }
Exemplo n.º 3
0
        public void GetMetricsFromAgent_ShouldCall_Create_From_Repository()
        {
            var request = new RamMetricCreateRequest()
            {
                Value = new Random().Next(0, 100), Time = DateTimeOffset.Now
            };
            var result = _controller.Create(request);

            _mock.Verify(repository => repository.GetByPeriod(It.IsAny <DateTimeOffset>(), It.IsAny <DateTimeOffset>()), Times.AtMostOnce);
        }
        public IActionResult Create([FromBody] RamMetricCreateRequest request)
        {
            _repository.Create(new RamMetric
            {
                Time  = request.Time,
                Value = request.Value
            });

            _logger.LogInformation(string.Concat("Create_Ram: ", " Time: ", request.Time.ToString(), " Value: ", request.Value.ToString()));

            return(Ok());
        }
        public IActionResult Create([FromBody] RamMetricCreateRequest request)
        {
            _repository.Create(new RamMetric
            {
                Time  = request.Time,
                Value = request.Value
            });

            _logger.LogInformation($"Create - Value: {request.Value}, Time: {request.Time} - Entry added successfully");

            return(Ok());
        }
        public IActionResult Create([FromBody] RamMetricCreateRequest request)
        {
            _logger.LogInformation($"Создается запись с данными Time:{request.Time}; Value:{request.Value}");

            _repository.Create(new RamMetric
            {
                Time  = request.Time,
                Value = request.Value
            });

            return(Ok());
        }
Exemplo n.º 7
0
 public IActionResult Create([FromBody] RamMetricCreateRequest metric)
 {
     try
     {
         _logger.Debug($"Route(api/metrics/ram): Running the Create method");
         _repository.Create(_mapper.Map <RamMetric>(metric));
         _logger.Debug($"Route(api/metrics/ram): Create method completed successfully");
         return(Ok());
     }
     catch (Exception e)
     {
         _logger.Error(e);
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 8
0
        public IActionResult Create([FromBody] RamMetricCreateRequest request)
        {
            _repository.Create(_mapper.Map <RamMetric>(request));

            return(Ok());
        }
Exemplo n.º 9
0
 public IActionResult Create([FromBody] RamMetricCreateRequest request)
 {
     _repository.Create(_mapper.Map <RamMetric>(request));
     _logger.LogInformation($"Add item. Parameters: Time = {request.Time}, Value = {request.Value}");
     return(Ok());
 }