From 674336442380b9ef0578d43bede393d2db4cf792 Mon Sep 17 00:00:00 2001 From: Isaac Levin Date: Fri, 31 May 2019 09:56:11 -0400 Subject: [PATCH] api updates --- .../Controllers/WeatherController.cs | 12 ----------- .../Controllers/WeatherController.fs | 20 +++---------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherController.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherController.cs index e355e67e86..f562613ea4 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherController.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherController.cs @@ -17,18 +17,6 @@ namespace Company.WebApplication1.Controllers [ApiController] public class WeatherController : ControllerBase { - [HttpGet] - public ActionResult GetWeatherResult(string location) - { - var rng = new Random(); - return new WeatherResult - { - Location = location, - Temperature = rng.Next(-20, 55), - TemperatureUnit = TemperatureUnit.Celsius - }; - } - [HttpGet] public ActionResult GetWeatherForecasts(string location, TemperatureUnit unit) { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Controllers/WeatherController.fs b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Controllers/WeatherController.fs index d82bbc47f9..38a6519d8a 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Controllers/WeatherController.fs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Controllers/WeatherController.fs @@ -1,4 +1,4 @@ -namespace WebApplication1.Controllers +namespace WebApplication1.Controllers open System open System.Collections.Generic @@ -22,25 +22,11 @@ type WeatherController () = inherit ControllerBase() [] - [] member this.Get(location:string, unit: string) = let rnd = System.Random() let result:WeatherResult = { Location = location; Temperature = rnd.Next(-20,55); - TemperatureUnit = System.Enum.Parse(typeof,unit) - :?> TemperatureUnit + TemperatureUnit = unit } - ActionResult(result) - - [] - [] - member this.Get(location:string) = - let rnd = System.Random() - let result:WeatherResult = { - Location = location; - Temperature = rnd.Next(-20,55); - TemperatureUnit = TemperatureUnit.Celsius - - } - ActionResult(result) + ActionResult(result) \ No newline at end of file