Skip to content

Commit

Permalink
Remove unnecessary usings
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Oct 12, 2021
1 parent db909e5 commit 26b8414
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 62 deletions.
4 changes: 1 addition & 3 deletions samples/Mvc.Server/Controllers/AccountController.cs
@@ -1,6 +1,4 @@
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using System.Security.Claims;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
Expand Down
5 changes: 0 additions & 5 deletions samples/Mvc.Server/Controllers/AuthorizationController.cs
Expand Up @@ -4,15 +4,10 @@
* the license and the contributors participating to this project.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
Expand Down
5 changes: 1 addition & 4 deletions samples/Mvc.Server/Controllers/ManageController.cs
@@ -1,9 +1,6 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Mvc.Server.Models;
using Mvc.Server.Services;
using Mvc.Server.ViewModels.Manage;
Expand Down
4 changes: 1 addition & 3 deletions samples/Mvc.Server/Controllers/ResourceController.cs
@@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
Expand Down
5 changes: 1 addition & 4 deletions samples/Mvc.Server/Controllers/UserinfoController.cs
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
Expand Down
6 changes: 1 addition & 5 deletions samples/Mvc.Server/Helpers/AsyncEnumerableExtensions.cs
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Mvc.Server.Helpers;
namespace Mvc.Server.Helpers;

public static class AsyncEnumerableExtensions
{
Expand Down
4 changes: 1 addition & 3 deletions samples/Mvc.Server/Helpers/FormValueRequiredAttribute.cs
@@ -1,7 +1,5 @@
using System;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Routing;

namespace Mvc.Server.Helpers;

Expand Down
5 changes: 1 addition & 4 deletions samples/Mvc.Server/Program.cs
@@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

namespace Mvc.Server;
namespace Mvc.Server;

public static class Program
{
Expand Down
4 changes: 1 addition & 3 deletions samples/Mvc.Server/Services/IEmailSender.cs
@@ -1,6 +1,4 @@
using System.Threading.Tasks;

namespace Mvc.Server.Services;
namespace Mvc.Server.Services;

public interface IEmailSender
{
Expand Down
4 changes: 1 addition & 3 deletions samples/Mvc.Server/Services/ISmsSender.cs
@@ -1,6 +1,4 @@
using System.Threading.Tasks;

namespace Mvc.Server.Services;
namespace Mvc.Server.Services;

public interface ISmsSender
{
Expand Down
4 changes: 1 addition & 3 deletions samples/Mvc.Server/Services/MessageServices.cs
@@ -1,6 +1,4 @@
using System.Threading.Tasks;

namespace Mvc.Server.Services;
namespace Mvc.Server.Services;

// This class is used by the application to send Email and SMS
// when you turn on two-factor authentication in ASP.NET Identity.
Expand Down
3 changes: 0 additions & 3 deletions samples/Mvc.Server/Startup.cs
@@ -1,8 +1,5 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Mvc.Server.Models;
using Mvc.Server.Services;
using Quartz;
Expand Down
3 changes: 1 addition & 2 deletions samples/Mvc.Server/ViewModels/Account/SendCodeViewModel.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Rendering;

namespace Mvc.Server.ViewModels.Account;

Expand Down
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Rendering;

namespace Mvc.Server.ViewModels.Manage;

Expand Down
3 changes: 1 addition & 2 deletions samples/Mvc.Server/ViewModels/Manage/IndexViewModel.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity;

namespace Mvc.Server.ViewModels.Manage;

Expand Down
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;

namespace Mvc.Server.ViewModels.Manage;
Expand Down
7 changes: 1 addition & 6 deletions samples/Mvc.Server/Worker.cs
@@ -1,9 +1,4 @@
using System;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Globalization;
using Mvc.Server.Models;
using OpenIddict.Abstractions;
using static OpenIddict.Abstractions.OpenIddictConstants;
Expand Down
7 changes: 2 additions & 5 deletions src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs
Expand Up @@ -1175,7 +1175,7 @@ public ValueTask HandleAsync(GenerateTokenContext context)
return default;
}

if (context.Principal is null or { Identity: not ClaimsIdentity })
if (context.Principal is not { Identity: ClaimsIdentity })
{
throw new InvalidOperationException(SR.GetResourceString(SR.ID0022));
}
Expand All @@ -1193,10 +1193,7 @@ public ValueTask HandleAsync(GenerateTokenContext context)
_ => true
});

if (principal is null or { Identity: not ClaimsIdentity })
{
throw new InvalidOperationException(SR.GetResourceString(SR.ID0020));
}
Debug.Assert(principal is { Identity: ClaimsIdentity }, SR.GetResourceString(SR.ID4006));

var claims = new Dictionary<string, object>(StringComparer.Ordinal);

Expand Down

0 comments on commit 26b8414

Please sign in to comment.