public ActionResult <Dictionary <string, EmulatorResponse> > ListEmulators() { var emulators = emulatorService.GetEmulators(); return(emulators.ToDictionary(e => e.Emulator.ToString(), e => new EmulatorResponse { Installed = e.Installed, SupportedDeviceTypes = e.SupportedDeviceTypes.Select(x => x.ToString()).ToList() })); }
public void Handle(HttpListenerContext context) { var listEmulatorResponse = emulatorService.GetEmulators().ToDictionary(e => e.Name, e => new EmulatorResponse { Installed = e.Installed, SupportedDeviceTypes = e.SupportedDeviceTypes.Select(t => t.ToString()).ToList(), } ); context.Response.OutputStream.WriteJson(listEmulatorResponse); }