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 result = (from a in allDates
join b in balances on a equals b.Date.ToString("yyyy-MM-dd") into ab
from b in ab.DefaultIfEmpty()
select new { Date = a, Amount = b != null ? b.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;}