Skip to content

Commit 5350b0f

Browse files
Add explicit using statements
1 parent b797ea0 commit 5350b0f

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
namespace ApiVersioning.Examples.Controllers;
22

33
using Asp.Versioning;
4+
using System.Net.Http;
45
using System.Web.Http;
56

6-
[ApiVersion( 2.0 )]
7-
[Route( "api/values" )]
7+
[ApiVersion(2.0)]
8+
[Route("api/values")]
89
public class Values2Controller : ApiController
910
{
1011
// GET api/values?api-version=2.0
1112
public IHttpActionResult Get() =>
12-
Ok( new
13+
Ok(new
1314
{
1415
controller = GetType().Name,
1516
version = Request.GetRequestedApiVersion().ToString(),
16-
} );
17+
});
1718
}
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
namespace ApiVersioning.Examples.Controllers;
22

3+
using System.Net.Http;
34
using System.Web.Http;
45

5-
[RoutePrefix( "api/values" )]
6+
[RoutePrefix("api/values")]
67
public class Values2Controller : ApiController
78
{
89
// GET api/values?api-version=2.0
910
[Route]
1011
public IHttpActionResult Get() =>
11-
Ok( new
12+
Ok(new
1213
{
1314
controller = GetType().Name,
1415
version = Request.GetRequestedApiVersion().ToString(),
15-
} );
16+
});
1617

1718
// GET api/values/{id}?api-version=2.0
18-
[Route( "{id:int}" )]
19-
public IHttpActionResult Get( int id ) =>
20-
Ok( new
19+
[Route("{id:int}")]
20+
public IHttpActionResult Get(int id) =>
21+
Ok(new
2122
{
2223
controller = GetType().Name,
2324
id,
2425
version = Request.GetRequestedApiVersion().ToString(),
25-
} );
26+
});
2627

2728
// GET api/values?api-version=3.0
2829
[Route]
2930
public IHttpActionResult GetV3() =>
30-
Ok( new
31+
Ok(new
3132
{
3233
controller = GetType().Name,
3334
version = Request.GetRequestedApiVersion().ToString(),
34-
} );
35+
});
3536

3637
// GET api/values/{id}?api-version=3.0
37-
[Route( "{id:int}" )]
38-
public IHttpActionResult GetV3( int id ) =>
39-
Ok( new
38+
[Route("{id:int}")]
39+
public IHttpActionResult GetV3(int id) =>
40+
Ok(new
4041
{
4142
controller = GetType().Name,
4243
id,
4344
version = Request.GetRequestedApiVersion().ToString(),
44-
} );
45+
});
4546
}

0 commit comments

Comments
 (0)