Guest User

Untitled

a guest
Mar 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
  2. .AddCookie(options => //CookieAuthenticationOptions
  3. {
  4. options.LoginPath = new Microsoft.AspNetCore.Http.PathString("/Account/Login");
  5. });
  6.  
  7. public static void ForEach(int[] array, Action<int> action)
  8. {
  9. for (int i = 0; i < array.Length; ++i)
  10. action(array[i]);
  11. }
  12.  
  13. static void Method(int x)
  14. {
  15. Console.WriteLine("Элемент: " + x);
  16. }
  17.  
  18. int[] myarray = { 1, 3, 5, 7 };
  19. ForEach(myarray, Method);
  20.  
  21. ForEach(myarray, (int x) => { Console.WriteLine("Элемент: " + x); });
  22.  
  23. ForEach(myarray, (x) => { Console.WriteLine("Элемент: " + x); });
  24.  
  25. ForEach(myarray, x => { Console.WriteLine("Элемент: " + x); });
  26.  
  27. ForEach(myarray, x => Console.WriteLine("Элемент: " + x));
Add Comment
Please, Sign In to add comment