Upgrade solution to .NET 6.0.9 (Build with .NET SDK v6.0.401) (#1692)

This commit is contained in:
Cheena Malhotra
2022-09-16 11:27:52 -07:00
committed by GitHub
parent 676819f669
commit 006ac60923
74 changed files with 143 additions and 414 deletions

View File

@@ -51,10 +51,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
{
get
{
if (connectionService == null)
{
connectionService = ConnectionService.Instance;
}
connectionService ??= ConnectionService.Instance;
return connectionService;
}

View File

@@ -8,6 +8,7 @@ using System.Data;
using System.Collections.Generic;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
using System.Linq;
namespace Microsoft.SqlTools.ServiceLayer.Agent
{
@@ -261,7 +262,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
// Add steps to the job if any
var jobSteps = new List<AgentJobStep>();
foreach (LogSourceJobHistory.LogEntryJobHistory subEntry in entry.SubEntries)
foreach (LogSourceJobHistory.LogEntryJobHistory subEntry in entry.SubEntries.Cast<LogSourceJobHistory.LogEntryJobHistory>())
{
if (steps.Contains(subEntry.StepName))
{
@@ -303,7 +304,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
// Add steps to the job if any
var jobSteps = new List<AgentJobStep>();
foreach (LogSourceJobHistory.LogEntryJobHistory subEntry in entry.SubEntries)
foreach (LogSourceJobHistory.LogEntryJobHistory subEntry in entry.SubEntries.Cast<LogSourceJobHistory.LogEntryJobHistory>())
{
if (steps.Contains(subEntry.StepName))
{

View File

@@ -416,10 +416,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
{
e.Source = sourceName;
if (m_exceptionList == null)
{
m_exceptionList = new List<Exception>();
}
m_exceptionList ??= new List<Exception>();
m_exceptionList.Add(e);
}

View File

@@ -8,6 +8,7 @@ using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.SqlServer.Management.Common;
@@ -677,7 +678,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
{
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this);
foreach (Match match in matches)
foreach (Match match in matches.Cast<Match>())
{
string propertyName = match.Groups["property"].Value;
PropertyDescriptor property = properties[propertyName];