mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-04 09:35:37 -05:00
Akma/login migrations (#1728)
In this PR, we make the appropriate backend service changes in order to enable the login migrations feature in the SQL migration extension. Changes include: updating the Microsoft.SqlServer.Migration.Login NuGet version to the latest version adding a new request handler for StartLoginMigrations calls, which makes the appropriate calls to the login NuGet adding ExtensionMethod helper to properly combine exception maps login migration nuget calls Co-authored-by: Akshay Mata <akma@microsoft.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.SqlServer.DataCollection.Common.Contracts.OperationsInfrastructure;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Migration.Utils
|
||||
{
|
||||
internal static class ExtensionMethods
|
||||
{
|
||||
public static void AddExceptions(this IDictionary<string, IEnumerable<ReportableException>> exceptionMap1, IDictionary<string, IEnumerable<ReportableException>> exceptionMap2)
|
||||
{
|
||||
foreach (var keyValuePair2 in exceptionMap2)
|
||||
{
|
||||
// If the dictionary already contains the key then merge them
|
||||
if (exceptionMap1.ContainsKey(keyValuePair2.Key))
|
||||
{
|
||||
foreach (var value in keyValuePair2.Value)
|
||||
{
|
||||
exceptionMap1[keyValuePair2.Key].Append(value);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
exceptionMap1.Add(keyValuePair2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Migration.Utils
|
||||
{
|
||||
internal static class MigrationServiceHelper
|
||||
{
|
||||
public static string FormatTimeSpan(TimeSpan ts)
|
||||
{
|
||||
return String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user