public async Task <string> AddNewDevice(DeviceDTO device) { device.DeviceTagName = UniqueIdGenerator.GetUniqueId(); await _devicerepo.AddDevice(device); return(device.DeviceTagName); }
public async Task <string> AddNewDevice(DeviceDTO[] devices) { string deviceTagName = string.Empty; for (int i = 0; i < devices.Length; i++) { devices[i].DeviceTagName = UniqueIdGenerator.GetUniqueId(); deviceTagName = deviceTagName + devices[i].DeviceTagName + ","; } deviceTagName = deviceTagName.TrimEnd(','); await _devicerepo.AddDevice(devices); return(deviceTagName); }