public ExitCode FullExport(FullExportOptions opts) { return(FetchData(opts.Username, opts.Password, opts.DateRange) .Map(foods => foods .Select(x => new { Date = x.Date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), x.Meal, Food = x.Name, x.Energy.Calories, Protein = x.Protein.Grams, Carbs = x.Carbohydrates.Grams, Fat = x.Fat.Grams, Cholesterol = x.Cholesterol.Milligrams, Sodium = x.Sodium.Milligrams, Sugars = x.Sugars.Grams, Fiber = x.Fiber.Grams, }) .Then(opts.OutputWriter(_output).Write)) .Match( Left: _ => _, Right: _ => ExitCode.Success)); }
public ExitCode FullExport(FullExportOptions opts) => TrackEvent(opts, () => _other.FullExport(opts));