From 0fb83fb3abb456ee6707b7f3cabc6b0c1ab2281b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 24 Dec 2018 14:46:55 +0200 Subject: Moved all common web components to Tango.Web Changed app keys names. Fixed issue with machine studio and the initialization of observables static collections. --- .../Web/Tango.MachineService/ProtoController.cs | 64 ---------------------- 1 file changed, 64 deletions(-) delete mode 100644 Software/Visual_Studio/Web/Tango.MachineService/ProtoController.cs (limited to 'Software/Visual_Studio/Web/Tango.MachineService/ProtoController.cs') diff --git a/Software/Visual_Studio/Web/Tango.MachineService/ProtoController.cs b/Software/Visual_Studio/Web/Tango.MachineService/ProtoController.cs deleted file mode 100644 index 572604d3c..000000000 --- a/Software/Visual_Studio/Web/Tango.MachineService/ProtoController.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Security.Authentication; -using System.Threading; -using System.Threading.Tasks; -using System.Web; -using System.Web.Http; -using System.Web.Http.Controllers; -using Tango.Logging; - -namespace Tango.MachineService -{ - public class ProtoController : ApiController - { - protected LogManager LogManager { get; private set; } - - public ProtoController() - { - LogManager = LogManager.Default; - } - - public override async Task ExecuteAsync(HttpControllerContext context, CancellationToken cancellationToken) - { - string controllerName = String.Empty; - string actionName = String.Empty; - - try - { - var routeData = HttpContext.Current.Request.RequestContext.RouteData; - actionName = routeData.Values["action"].ToString(); - controllerName = routeData.Values["controller"].ToString(); - } - catch { } - - try - { - LogManager.Log($"Request Received on {controllerName + "/" + actionName}."); - - var result = await base.ExecuteAsync(context, cancellationToken); - return result; - } - catch (Exception ex) - { - LogManager.Log(ex, $"An error occurred while processing the request message on {controllerName + "/" + actionName}."); - - HttpStatusCode code = HttpStatusCode.InternalServerError; - - if (ex is ArgumentException) - { - code = HttpStatusCode.BadRequest; - } - else if (ex is AuthenticationException) - { - code = HttpStatusCode.Unauthorized; - } - - throw new HttpResponseException(Request.CreateErrorResponse(code, ex.Message)); - } - } - } -} \ No newline at end of file -- cgit v1.3.1