Feature #33: Enhanced Device Importing
Dynamic device importing. better input parsing and 5 additional import fields.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Disco.Services.Devices.Importing
|
||||
{
|
||||
internal class DeviceImportDatabaseCache : IDeviceImportCache
|
||||
{
|
||||
private DiscoDataContext Database;
|
||||
|
||||
public DeviceImportDatabaseCache(DiscoDataContext Database)
|
||||
{
|
||||
this.Database = Database;
|
||||
}
|
||||
|
||||
public Device FindDevice(string DeviceSerialNumber)
|
||||
{
|
||||
return Database.Devices.FirstOrDefault(d => d.SerialNumber == DeviceSerialNumber);
|
||||
}
|
||||
|
||||
public IEnumerable<Device> Devices
|
||||
{
|
||||
get { return Database.Devices; }
|
||||
}
|
||||
|
||||
public IEnumerable<DeviceModel> DeviceModels
|
||||
{
|
||||
get { return Database.DeviceModels; }
|
||||
}
|
||||
|
||||
public IEnumerable<DeviceProfile> DeviceProfiles
|
||||
{
|
||||
get { return Database.DeviceProfiles; }
|
||||
}
|
||||
|
||||
public IEnumerable<DeviceBatch> DeviceBatches
|
||||
{
|
||||
get { return Database.DeviceBatches; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user