Skip to content

Commit 76e1bcf

Browse files
committed
Code cleaned
1 parent 884d732 commit 76e1bcf

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

src/Tigernet.Hosting/Exceptions/RouteDublicatedException.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace Tigernet.Hosting.Exceptions
1+
namespace Tigernet.Hosting.Exceptions
82
{
93
public class RouteDublicatedException : Exception
104
{

src/Tigernet.Hosting/Http/HttpContext.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace Tigernet.Hosting.Http
1+
namespace Tigernet.Hosting.Http
82
{
93
public class HttpContext
104
{

src/Tigernet.Hosting/TigernetHostBuilder.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
using System.Net;
2-
using System.Net.Http;
32
using System.Text;
43
using Tigernet.Hosting.Actions;
54
using Tigernet.Hosting.Attributes;
65
using Tigernet.Hosting.Exceptions;
7-
using Tigernet.Hosting.Http;
86

97
namespace Tigernet.Hosting
108
{
@@ -58,7 +56,7 @@ public void MapRoute(string route, Func<HttpListenerContext, Task> handler)
5856
// check for exist of route
5957
if (_routes.ContainsKey(route))
6058
throw new RouteDublicatedException();
61-
59+
6260
_routes.Add(route, handler);
6361
}
6462

@@ -147,10 +145,10 @@ private async Task HandleRequestAsync(HttpListenerContext context)
147145
// if route is null, use the route from the class name
148146
if (string.IsNullOrEmpty(route))
149147
{
150-
route = Path.Combine("/", typeName.Split(new[] { "Rester" },
148+
route = Path.Combine("/", typeName.Split(new[] { "Rester" },
151149
StringSplitOptions.None).FirstOrDefault());
152150
}
153-
151+
154152
var routeUrl = (route + attribute.route).ToLower();
155153
MapRoute(routeUrl, async context =>
156154
{

0 commit comments

Comments
 (0)