Address warnings and (some) nullables (#2013)

This commit is contained in:
Cheena Malhotra
2023-04-18 20:57:13 -07:00
committed by GitHub
parent d56f2309da
commit 648d7dbd3c
83 changed files with 674 additions and 588 deletions

View File

@@ -18,11 +18,11 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
/// <summary>
/// Representation of a cell that should have a value inserted or updated
/// </summary>
public sealed class CellUpdate
public sealed partial class CellUpdate
{
private const string NullString = @"NULL";
private const string TextNullString = @"'NULL'";
private static readonly Regex HexRegex = new Regex("0x[0-9A-F]+", RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly Regex HexRegex = GetCharacterRegex();
private static readonly TimeSpan MaxTimespan = TimeSpan.FromHours(24);
/// <summary>
@@ -231,7 +231,7 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
private void ProcessTimespanColumn(string valueAsString)
{
TimeSpan ts = TimeSpan.Parse(valueAsString, CultureInfo.CurrentCulture);
var ts = TimeSpan.Parse(valueAsString, CultureInfo.CurrentCulture);
if (ts >= MaxTimespan)
{
throw new InvalidOperationException(SR.EditDataTimeOver24Hrs);
@@ -270,6 +270,9 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData.UpdateManagement
ValueAsString = valueAsString;
}
[GeneratedRegex("0x[0-9A-F]+", RegexOptions.IgnoreCase | RegexOptions.Compiled)]
private static partial Regex GetCharacterRegex();
#endregion
}
}