Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. [Authorize("Admin")]
  2. public async Task<IActionResult> DeleteDItem(int? id)
  3.  
  4. "dependencies": {
  5. "BundlerMinifier.Core": "2.1.258",
  6. "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
  7. "Microsoft.AspNet.Authentication.Google": "1.0.0-rc1-final",
  8. "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
  9. "Microsoft.AspNetCore.Authentication.Facebook": "1.0.0",
  10. "Microsoft.AspNetCore.Authentication.Google": "1.0.0",
  11. "Microsoft.AspNetCore.Authorization": "1.0.0",
  12. "Microsoft.AspNetCore.Diagnostics": "1.0.0",
  13. "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
  14. "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
  15. ...
  16. "Npgsql.EntityFrameworkCore.PostgreSQL": "1.0.0"
  17.  
  18. public void ConfigureServices(IServiceCollection services)
  19. {
  20. services.AddAuthorization(options =>
  21. {
  22. options.AddPolicy("Admin", policy =>
  23. policy.RequireAuthenticatedUser());
  24. });
  25. services.AddIdentity<ApplicationUser, IdentityRole>()
  26. .AddEntityFrameworkStores<ApplicationDbContext>()
  27. .AddDefaultTokenProviders();
  28. }
  29.  
  30. public void Configure(IApplicationBuilder app, IHostingEnvironment env,
  31. ILoggerFactory loggerFactory)
  32. {
  33. app.UseIdentity();
  34. }
  35.  
  36. <sites>
  37. <site name="WebApplication2" id="4">
  38. <bindings>
  39. <binding protocol="http" bindingInformation="*:12619:localhost" />
  40. </bindings>
  41. </site>
  42. </sites>
  43.  
  44. <sites>
  45. <site name="WebApplication2" id="4">
  46. <bindings>
  47. <binding protocol="http" bindingInformation="*:12619:*" />
  48. </bindings>
  49. </site>
  50. </sites>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement