Ejemplo n.º 1
0
        public async Task <IActionResult> PostEmployeeTemperatureAsync([FromBody] EmployeeTemperature request)
        {
            Random random = new Random();

            request.Temperature = random.Next(36, 39);
            var response = await HealthService.CreateEmployeeTemperatureAsync(request);

            return(response.ToHttpResponse());
        }
Ejemplo n.º 2
0
        // POST
        public async Task <SingleResponse <EmployeeTemperature> > CreateEmployeeTemperatureAsync(EmployeeTemperature temperature)
        {
            var response = new SingleResponse <EmployeeTemperature>();

            // Add entity to repository
            DbContext.Add(temperature, UserInfo);
            // Save entity in database
            await DbContext.SaveChangesAsync();

            response.Model = temperature;

            return(response);
        }