qol: simplify calls

This commit is contained in:
Gary Sharp
2025-07-20 15:20:22 +10:00
parent 1add4ee0f5
commit 9656c15c4b
61 changed files with 214 additions and 214 deletions
@@ -70,7 +70,7 @@ namespace Disco.Services.Devices.Enrolment
}
private static void Log(EventTypeIds EventTypeId, params object[] Args)
{
EnrolmentLog.Current.Log((int)EventTypeId, Args);
Current.Log((int)EventTypeId, Args);
}
public static void LogSessionStarting(string SessionId, string HostId, EnrolmentTypes EnrolmentType)
{
@@ -147,11 +147,11 @@ namespace Disco.Services.Devices.Enrolment
}
public static void LogSessionDeviceInfo(string SessionId, MacEnrol Request)
{
EnrolmentLog.LogSessionDeviceInfo(SessionId, Request.DeviceSerialNumber, Request.DeviceUUID, Request.DeviceComputerName, Request.DeviceLanMacAddress, Request.DeviceWlanMacAddress, Request.DeviceManufacturer, Request.DeviceModel, Request.DeviceModelType);
LogSessionDeviceInfo(SessionId, Request.DeviceSerialNumber, Request.DeviceUUID, Request.DeviceComputerName, Request.DeviceLanMacAddress, Request.DeviceWlanMacAddress, Request.DeviceManufacturer, Request.DeviceModel, Request.DeviceModelType);
}
public static void LogSessionDeviceInfo(string SessionId, Enrol Request)
{
EnrolmentLog.LogSessionDeviceInfo(
LogSessionDeviceInfo(
SessionId,
Request.SerialNumber,
Request.Hardware.UUID,
@@ -53,7 +53,7 @@ namespace Disco.Services.Devices.Importing
public string GetString(int ColumnIndex)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(CsvDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
var value = currentRow[ColumnIndex];
@@ -71,7 +71,7 @@ namespace Disco.Services.Devices.Importing
public bool TryGetNullableInt(int ColumnIndex, out int? value)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(CsvDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
return TryGetNullableInt(currentRow[ColumnIndex], out value);
}
@@ -79,7 +79,7 @@ namespace Disco.Services.Devices.Importing
public bool TryGetNullableBool(int ColumnIndex, out bool? value)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(CsvDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
return TryGetNullableBool(currentRow[ColumnIndex], out value);
}
@@ -87,7 +87,7 @@ namespace Disco.Services.Devices.Importing
public bool TryGetNullableDateTime(int ColumnIndex, out DateTime? value)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(CsvDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
return TryGetNullableDateTime(currentRow[ColumnIndex], out value);
}
@@ -53,7 +53,7 @@ namespace Disco.Services.Devices.Importing
public string GetString(int ColumnIndex)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(XlsxDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
var cell = currentRow[ColumnIndex];
@@ -71,7 +71,7 @@ namespace Disco.Services.Devices.Importing
public bool TryGetNullableInt(int ColumnIndex, out int? value)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(XlsxDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
return TryGetNullableInt(currentRow[ColumnIndex], out value);
}
@@ -79,7 +79,7 @@ namespace Disco.Services.Devices.Importing
public bool TryGetNullableBool(int ColumnIndex, out bool? value)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(XlsxDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
return TryGetNullableBool(currentRow[ColumnIndex], out value);
}
@@ -87,7 +87,7 @@ namespace Disco.Services.Devices.Importing
public bool TryGetNullableDateTime(int ColumnIndex, out DateTime? value)
{
if (currentRow == null)
throw new InvalidOperationException($"{nameof(XlsxDeviceImportDataReader.Read)} must be called before retrieving values");
throw new InvalidOperationException($"{nameof(Read)} must be called before retrieving values");
return TryGetNullableDateTime(currentRow[ColumnIndex], out value);
}
@@ -98,7 +98,7 @@ namespace Disco.Services.Devices.ManagedGroups
if (!string.IsNullOrEmpty(DeviceBatch.AssignedUsersLinkedGroup))
{
var config = ADManagedGroup.ConfigurationFromJson(DeviceBatch.AssignedUsersLinkedGroup);
var config = ConfigurationFromJson(DeviceBatch.AssignedUsersLinkedGroup);
if (config != null && !string.IsNullOrWhiteSpace(config.GroupId))
{
@@ -96,7 +96,7 @@ namespace Disco.Services.Devices.ManagedGroups
if (!string.IsNullOrEmpty(DeviceBatch.DevicesLinkedGroup))
{
var config = ADManagedGroup.ConfigurationFromJson(DeviceBatch.DevicesLinkedGroup);
var config = ConfigurationFromJson(DeviceBatch.DevicesLinkedGroup);
if (config != null && !string.IsNullOrWhiteSpace(config.GroupId))
{
@@ -98,7 +98,7 @@ namespace Disco.Services.Devices.ManagedGroups
if (!string.IsNullOrEmpty(DeviceProfile.AssignedUsersLinkedGroup))
{
var config = ADManagedGroup.ConfigurationFromJson(DeviceProfile.AssignedUsersLinkedGroup);
var config = ConfigurationFromJson(DeviceProfile.AssignedUsersLinkedGroup);
if (config != null && !string.IsNullOrWhiteSpace(config.GroupId))
{
@@ -97,7 +97,7 @@ namespace Disco.Services.Devices.ManagedGroups
if (!string.IsNullOrEmpty(DeviceProfile.DevicesLinkedGroup))
{
var config = ADManagedGroup.ConfigurationFromJson(DeviceProfile.DevicesLinkedGroup);
var config = ConfigurationFromJson(DeviceProfile.DevicesLinkedGroup);
if (config != null && !string.IsNullOrWhiteSpace(config.GroupId))
{