public void AddHarvest(Harvest harvest) { var record = new Record() { Message = $"Added new harvest: {harvest.FullString()}: ", }; _harvests.Add(harvest); _context.Harvests.Add(harvest); _context.Records.Add(record); HarvestChanged?.Invoke(); }
public void AddHarvestAsync(Harvest harvest) { Task.Factory.StartNew(() => { var record = new Record() { Message = $"Added new harvest: {harvest.FullString()}: ", }; _context.Harvests.Add(harvest); _context.Records.Add(record); _context.SaveChanges(); }); _harvests.Add(harvest); HarvestChanged?.Invoke(); }