aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'PollutometerWebApi/Controllers/ReadingsController.cs')
-rw-r--r--PollutometerWebApi/Controllers/ReadingsController.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/PollutometerWebApi/Controllers/ReadingsController.cs b/PollutometerWebApi/Controllers/ReadingsController.cs
index cb91c71..9767645 100644
--- a/PollutometerWebApi/Controllers/ReadingsController.cs
+++ b/PollutometerWebApi/Controllers/ReadingsController.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading.Tasks;
using System.Web.Http;
using PollutometerWebApi.Models;
using PollutometerWebApi.Singletons;
@@ -7,13 +8,12 @@ namespace PollutometerWebApi.Controllers
{
public class ReadingsController : ApiController
{
- public ReadingsController()
- {
- EmailSender.SendEmail();
- }
+ public ReadingsController() {}
public IHttpActionResult GetAllReadings()
- {
+ {
+ Task.Run(() => EmailService.Start());
+
var command = "SELECT * FROM Readings";
var readings = SqlOperator.GetReadings(command);