Skip to content

Commit 3f3eeef

Browse files
Update existing extension methods to use the extension member syntax. Where applicable, update extension methods to extension properties.
1 parent 582b79f commit 3f3eeef

File tree

260 files changed

+4712
-4743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+4712
-4743
lines changed

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ dotnet_diagnostic.ASP0023.severity = none # Route conflict detected between rout
122122

123123
# TEMP: temporary suppression for false positives
124124
# BUG: https://github.com/dotnet/sdk/issues/51681
125+
# BUG: https://github.com/dotnet/sdk/issues/51716
125126
[*Extensions.cs]
126127
dotnet_diagnostic.CA1034.severity = none
128+
dotnet_diagnostic.CA1708.severity = none
127129

128130
# test settings
129131

examples/AspNet/OData/AdvancedODataWebApiExample/Controllers/OrdersController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class OrdersController : ApiController
1010
{
1111
// GET ~/api/orders
1212
// GET ~/api/orders?api-version=1.0
13-
public IHttpActionResult Get( ApiVersion version ) =>
13+
public IHttpActionResult Get( ApiVersion version ) =>
1414
Ok( new[] { new Order() { Id = 1, Customer = $"Customer v{version}" } } );
1515

1616
// GET ~/api/orders/{id}

examples/AspNet/OData/AdvancedODataWebApiExample/Controllers/PeopleController.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,32 @@ public IHttpActionResult Get( ODataQueryOptions<Person> options, ApiVersion vers
3535
[ODataRoute( "{id}" )]
3636
public IHttpActionResult Get( int id, ODataQueryOptions<Person> options, ApiVersion version ) =>
3737
Ok( new Person()
38-
{
39-
Id = id,
40-
FirstName = "Bill",
41-
LastName = "Mei",
42-
Email = "bill.mei@somewhere.com",
38+
{
39+
Id = id,
40+
FirstName = "Bill",
41+
LastName = "Mei",
42+
Email = "bill.mei@somewhere.com",
4343
Phone = "555-555-5555",
4444
} );
4545

4646
// PATCH ~/api/people/{id}?api-version=2.0
4747
[MapToApiVersion( "2.0" )]
4848
[ODataRoute( "{id}" )]
49-
public IHttpActionResult Patch(
50-
int id,
51-
Delta<Person> delta,
52-
ODataQueryOptions<Person> options,
49+
public IHttpActionResult Patch(
50+
int id,
51+
Delta<Person> delta,
52+
ODataQueryOptions<Person> options,
5353
ApiVersion version )
5454
{
5555
if ( !ModelState.IsValid )
5656
return BadRequest( ModelState );
5757

5858
var person = new Person()
59-
{
60-
Id = id,
61-
FirstName = "Bill",
62-
LastName = "Mei",
63-
Email = "bill.mei@somewhere.com",
59+
{
60+
Id = id,
61+
FirstName = "Bill",
62+
LastName = "Mei",
63+
Email = "bill.mei@somewhere.com",
6464
Phone = "555-555-5555",
6565
};
6666

examples/AspNet/OData/BasicODataWebApiExample/Controllers/PeopleController.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public class PeopleController : ODataController
1616
[ODataRoute]
1717
public IHttpActionResult Get( ODataQueryOptions<Person> options ) =>
1818
Ok( new Person[]
19-
{
19+
{
2020
new()
21-
{
21+
{
2222
Id = 1,
2323
FirstName = "Bill",
2424
LastName = "Mei",
@@ -30,11 +30,11 @@ public IHttpActionResult Get( ODataQueryOptions<Person> options ) =>
3030
// GET ~/api/people/{id}?api-version=[1.0|2.0]
3131
[ODataRoute( "{id}" )]
3232
public IHttpActionResult Get( int id, ODataQueryOptions<Person> options ) =>
33-
Ok( new Person()
34-
{
35-
Id = id,
36-
FirstName = "Bill",
37-
LastName = "Mei",
33+
Ok( new Person()
34+
{
35+
Id = id,
36+
FirstName = "Bill",
37+
LastName = "Mei",
3838
Email = "bill.mei@somewhere.com",
3939
Phone = "555-555-5555",
4040
} );
@@ -50,11 +50,11 @@ public IHttpActionResult Patch( int id, Delta<Person> delta, ODataQueryOptions<P
5050
}
5151

5252
var person = new Person()
53-
{
54-
Id = id,
55-
FirstName = "Bill",
56-
LastName = "Mei",
57-
Email = "bill.mei@somewhere.com",
53+
{
54+
Id = id,
55+
FirstName = "Bill",
56+
LastName = "Mei",
57+
Email = "bill.mei@somewhere.com",
5858
Phone = "555-555-5555",
5959
};
6060

examples/AspNet/OData/ConventionsODataWebApiExample/Startup.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public void Configuration( IAppBuilder appBuilder )
1818
configuration.AddApiVersioning(
1919
options =>
2020
{
21-
// reporting api versions will return the headers
22-
// "api-supported-versions" and "api-deprecated-versions"
23-
options.ReportApiVersions = true;
21+
// reporting api versions will return the headers
22+
// "api-supported-versions" and "api-deprecated-versions"
23+
options.ReportApiVersions = true;
2424

25-
// apply api versions using conventions rather than attributes
26-
options.Conventions.Controller<OrdersController>()
27-
.HasApiVersion( 1, 0 );
25+
// apply api versions using conventions rather than attributes
26+
options.Conventions.Controller<OrdersController>()
27+
.HasApiVersion( 1, 0 );
2828

2929
options.Conventions.Controller<PeopleController>()
3030
.HasApiVersion( 1, 0 )

examples/AspNet/OData/OpenApiODataWebApiExample/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void Configuration( IAppBuilder builder )
107107
{
108108
// build a swagger document and endpoint for each discovered API version
109109
swagger.MultipleApiVersions(
110-
( apiDescription, version ) => apiDescription.GetGroupName() == version,
110+
( apiDescription, version ) => apiDescription.GroupName == version,
111111
info =>
112112
{
113113
foreach ( var group in apiExplorer.ApiDescriptions )

examples/AspNet/OData/OpenApiODataWebApiExample/SwaggerDefaultValues.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class SwaggerDefaultValues : IOperationFilter
1818
/// <param name="apiDescription">The API description being filtered.</param>
1919
public void Apply( Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription )
2020
{
21-
operation.deprecated |= apiDescription.IsDeprecated();
21+
operation.deprecated |= apiDescription.IsDeprecated;
2222

2323
if ( operation.parameters == null )
2424
{

examples/AspNet/OData/OpenApiODataWebApiExample/V1/OrdersController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public IHttpActionResult Post( [FromBody] Order order )
6666
[MapToApiVersion( "1.0" )]
6767
[ResponseType( typeof( Order ) )]
6868
[EnableQuery( AllowedQueryOptions = Select )]
69-
public SingleResult<Order> MostExpensive() =>
69+
public SingleResult<Order> MostExpensive() =>
7070
SingleResult.Create( new[] { new Order() { Id = 42, Customer = "Bill Mei" } }.AsQueryable() );
7171

7272
/// <summary>

examples/AspNet/OData/OpenApiODataWebApiExample/V1/PeopleController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public IHttpActionResult Get( int key, ODataQueryOptions<Person> options )
5151
[MapToApiVersion( "1.0" )]
5252
[ResponseType( typeof( Person ) )]
5353
[EnableQuery( AllowedQueryOptions = Select )]
54-
public SingleResult<Person> MostExpensive( ODataQueryOptions<Person> options, CancellationToken ct ) =>
54+
public SingleResult<Person> MostExpensive( ODataQueryOptions<Person> options, CancellationToken ct ) =>
5555
SingleResult.Create( new[] { new Person() { Id = 42, FirstName = "Elon", LastName = "Musk" } }.AsQueryable() );
5656

5757
/// <summary>

examples/AspNet/OData/OpenApiODataWebApiExample/V2/OrdersController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public IQueryable<Order> Get()
4949
[ODataRoute( "{key}" )]
5050
[ResponseType( typeof( Order ) )]
5151
[EnableQuery( AllowedQueryOptions = Select )]
52-
public SingleResult<Order> Get( int key ) =>
52+
public SingleResult<Order> Get( int key ) =>
5353
SingleResult.Create( new[] { new Order() { Id = key, Customer = "John Doe" } }.AsQueryable() );
5454

5555
/// <summary>

0 commit comments

Comments
 (0)