Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
LINQ - Inner Join
using System; using System.Collections.Generic; using System.Linq; namespace Rextester { public class Order { public int Id { get; set; } public string Name { get; set; } } public class OrderAddress { public int Id { get; set; } public int OrderId { get; set; } public string Name { get; set; } } public class Program { public static void Main(string[] args) { var orders = new List<Order> { new Order { Id = 1, Name = "Large T Shirt" }}; var orderAddresses = new List<OrderAddress> { new OrderAddress { Id = 1, Name = "40 New York Street", OrderId = 1 }}; var ordersWithAddresses = orders.Join(orderAddresses, order => order.Id, address => address.OrderId, (order,address) => new { Order = order, Address = address}); foreach(var o in ordersWithAddresses) { Console.WriteLine("{0} {1}", o.Order.Name, o.Address.Name); } } } }
run
|
edit
|
history
|
help
0
Test
asdxasxasdf
regex
D13
ew
Count the number of capital letters, small letters, digits, spaces and special characters.
Min max elements swap of the array
tesyyyyy
6. Parallelism: threads
saxasd