using System.Collections.Generic;
public static void Main()
List<string> allDates = new List<string> { "2021-01-02", "2021-01-03", "2021-01-04" };
List<Balance> balances = new List<Balance>
new Balance { Id = 1, Amount = 233, Date = new DateTime (2021, 01, 02) },
new Balance { Id = 2, Amount = 442, Date = new DateTime (2021, 01, 03) }
var lookup = balances.ToLookup(x => x.Date.ToString("yyyy-MM-dd"));
var result = (from a in allDates
Amount = lookup[a] != null && lookup[a].Count() > 0 ? lookup[a].First().Amount : 0
foreach (var item in result)
Console.WriteLine(String.Format("Date: {0}, Amount: {1}", item.Date, item.Amount));
public decimal Amount {get;set;}
public DateTime Date {get;set;}