public IActionResult Create([FromBody] DotNetMetricCreateRequest request)
 {
     _repository.Create(new DotNetMetric
     {
         Time  = request.Time,
         Value = request.Value
     });
     return(Ok());
 }
Esempio n. 2
0
        public void GetMetricsFromAgent_ShouldCall_Create_From_Repository()
        {
            var request = new DotNetMetricCreateRequest()
            {
                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] DotNetMetricCreateRequest request)
        {
            repository.Create(new DotNetMetric
            {
                FromTime = request.FromTime,
                ToTime   = request.ToTime,
                Count    = request.Count
            });

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

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

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

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

            return(Ok());
        }
Esempio n. 6
0
        public IActionResult Create([FromBody] DotNetMetricCreateRequest request)
        {
            _repository.Create(new DotNetMetric
            {
                Time  = request.Time,
                Value = request.Value
            });

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

            return(Ok());
        }
 public IActionResult Create([FromBody] DotNetMetricCreateRequest metric)
 {
     try
     {
         _logger.Debug($"Route(api/metrics/dotnet): Running the Create method");
         _repository.Create(_mapper.Map <DotNetMetric>(metric));
         _logger.Debug($"Route(api/metrics/dotnet): Create method completed successfully");
         return(Ok());
     }
     catch (Exception e)
     {
         _logger.Error(e);
         return(BadRequest(e.Message));
     }
 }
 public IActionResult Create([FromBody] DotNetMetricCreateRequest request)
 {
     _repository.Create(_mapper.Map <DotNetMetric>(request));
     return(Ok());
 }
Esempio n. 9
0
 public IActionResult Create([FromBody] DotNetMetricCreateRequest request)
 {
     _repository.Create(_mapper.Map <DotNetMetric>(request));
     _logger.LogInformation($"Add item. Parameters: Time = {request.Time}, Value = {request.Value}");
     return(Ok());
 }