private async Task DoRecyclingStuff(IDialogContext context, Something deserializeObject) { var recyclingInfo = SimpleJson.SimpleJson.DeserializeObject <RecyclingInfo>(JsonHelper.RecyclingJson); var thing = deserializeObject.entities.First(e => e.type == "thing"); if (thing != null) { switch (thing.entity) { case "cans": var recyclingCentres = recyclingInfo.recyclingCentres.Where(c => c.canTins == "Yes"); var names = recyclingCentres.Select(c => c.name).ToList(); await context.PostAsync($"The following centres recycle cans: " + string.Join(string.Empty, names.ToArray())); break; } } }
public GetStrawsDialogs(Something deserializeObject) { _deserializeObject = deserializeObject; }