Browse Source

Remove unnecessary usings

pull/1342/head
Kévin Chalet 5 years ago
parent
commit
26b8414114
  1. 4
      samples/Mvc.Server/Controllers/AccountController.cs
  2. 5
      samples/Mvc.Server/Controllers/AuthorizationController.cs
  3. 5
      samples/Mvc.Server/Controllers/ManageController.cs
  4. 4
      samples/Mvc.Server/Controllers/ResourceController.cs
  5. 5
      samples/Mvc.Server/Controllers/UserinfoController.cs
  6. 6
      samples/Mvc.Server/Helpers/AsyncEnumerableExtensions.cs
  7. 4
      samples/Mvc.Server/Helpers/FormValueRequiredAttribute.cs
  8. 5
      samples/Mvc.Server/Program.cs
  9. 4
      samples/Mvc.Server/Services/IEmailSender.cs
  10. 4
      samples/Mvc.Server/Services/ISmsSender.cs
  11. 4
      samples/Mvc.Server/Services/MessageServices.cs
  12. 3
      samples/Mvc.Server/Startup.cs
  13. 3
      samples/Mvc.Server/ViewModels/Account/SendCodeViewModel.cs
  14. 3
      samples/Mvc.Server/ViewModels/Manage/ConfigureTwoFactorViewModel.cs
  15. 3
      samples/Mvc.Server/ViewModels/Manage/IndexViewModel.cs
  16. 3
      samples/Mvc.Server/ViewModels/Manage/ManageLoginsViewModel.cs
  17. 7
      samples/Mvc.Server/Worker.cs
  18. 7
      src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs

4
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;

5
samples/Mvc.Server/Controllers/AuthorizationController.cs

@ -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;

5
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;

4
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;

5
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;

6
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
{

4
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;

5
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
{

4
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
{

4
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
{

4
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.

3
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;

3
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;

3
samples/Mvc.Server/ViewModels/Manage/ConfigureTwoFactorViewModel.cs

@ -1,5 +1,4 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace Mvc.Server.ViewModels.Manage;

3
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;

3
samples/Mvc.Server/ViewModels/Manage/ManageLoginsViewModel.cs

@ -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;

7
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;

7
src/OpenIddict.Server/OpenIddictServerHandlers.Protection.cs

@ -1175,7 +1175,7 @@ public static partial class OpenIddictServerHandlers
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));
}
@ -1193,10 +1193,7 @@ public static partial class OpenIddictServerHandlers
_ => 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);

Loading…
Cancel
Save