public void LoadDeviceConfiguration(IDeviceRegistry deviceRegistry) { var config = new IniDataParser().Parse(File.ReadAllText(kDeviceConfigurationFileName)); foreach (var section in config.Sections) { var type = section.Keys["type"]; var device = deviceLoadersByType[type](section); deviceRegistry.AddDevice(section.SectionName, device); } }
public void LoadDeviceConfiguration(IDeviceRegistry deviceRegistry) { var config = new IniDataParser().Parse(File.ReadAllText(kDeviceConfigurationFileName)); foreach (var section in config.Sections) { var type = section.Keys["type"]; var device = deviceLoadersByType[type](section); deviceRegistry.AddDevice(section.SectionName, device); } }
public async Task Post([FromBody] Models.Device device) { var newDevice = new DeviceRegistry.Interfaces.Device() { Id = device.Id, RegisteredDate = device.RegisteredDate, Status = device.Status, Type = device.Type }; await _deviceRegistryService.AddDevice(newDevice); }