Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace labDAP
- {
- class Program
- {
- static void Main(string[] args)
- {
- //string[] words1 = { "a", "b", "c" };
- //string[] words2 = { "d", "e", "f" };
- //var intersect = words1.Intersect(words2);
- //List<Book> books = new List<Book>();
- //List<Author> authors = new List<Author>();
- //books.Add(new Book(0, "b1", 0));
- //books.Add(new Book(1, "b2", 0));
- //books.Add(new Book(2, "b3", 1));
- //books.Add(new Book(3, "b4", 1));
- //books.Add(new Book(4, "b5", 1));
- //authors.Add(new Author(0, "a1"));
- //authors.Add(new Author(1, "a2"));
- //var group = books.GroupBy(x => x.authorId);
- //foreach (var x in group)
- //{
- // Console.WriteLine(x.Key);
- //}
- //var groupedResult = books.GroupBy(s => s.authorId).ToList();
- //foreach (var a in groupedResult)
- //{
- // Console.WriteLine( a.Count());
- //}
- //var join = books.Join(authors, book => book.authorId, author => author.id, (book, author) => new
- //{
- // ID = book.id,
- // BName = book.title,
- // AID = book.authorId,
- // AN = author.name
- //}
- // ).OrderBy(x => Guid.NewGuid()
- // ) ;
- //foreach (var b in join)
- //{
- // Console.WriteLine(b.ToString());
- //}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement