Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace labDAP
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. //string[] words1 = { "a", "b", "c" };
  12. //string[] words2 = { "d", "e", "f" };
  13. //var intersect = words1.Intersect(words2);
  14. //List<Book> books = new List<Book>();
  15. //List<Author> authors = new List<Author>();
  16. //books.Add(new Book(0, "b1", 0));
  17. //books.Add(new Book(1, "b2", 0));
  18. //books.Add(new Book(2, "b3", 1));
  19. //books.Add(new Book(3, "b4", 1));
  20. //books.Add(new Book(4, "b5", 1));
  21. //authors.Add(new Author(0, "a1"));
  22. //authors.Add(new Author(1, "a2"));
  23. //var group = books.GroupBy(x => x.authorId);
  24. //foreach (var x in group)
  25. //{
  26. // Console.WriteLine(x.Key);
  27. //}
  28.  
  29. //var groupedResult = books.GroupBy(s => s.authorId).ToList();
  30.  
  31. //foreach (var a in groupedResult)
  32. //{
  33. // Console.WriteLine( a.Count());
  34.  
  35. //}
  36. //var join = books.Join(authors, book => book.authorId, author => author.id, (book, author) => new
  37. //{
  38. // ID = book.id,
  39. // BName = book.title,
  40. // AID = book.authorId,
  41. // AN = author.name
  42. //}
  43. // ).OrderBy(x => Guid.NewGuid()
  44.  
  45. // ) ;
  46. //foreach (var b in join)
  47. //{
  48. // Console.WriteLine(b.ToString());
  49. //}
  50.  
  51.  
  52.  
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement