Addressing code review feedback

This commit is contained in:
Mitchell Sternke
2016-08-16 15:27:26 -07:00
parent a6cc14d31f
commit 6ffdf644ba
14 changed files with 203 additions and 137 deletions

View File

@@ -0,0 +1,30 @@
//
// 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.Connection.Contracts
{
/// <summary>
/// Extension methods to ConnectParams
/// </summary>
public static class ConnectParamsExtensions
{
/// <summary>
/// Check that the fields in ConnectParams are all valid
/// </summary>
public static bool IsValid(this ConnectParams parameters)
{
return !(
String.IsNullOrEmpty(parameters.OwnerUri) ||
parameters.Connection == null ||
String.IsNullOrEmpty(parameters.Connection.DatabaseName) ||
String.IsNullOrEmpty(parameters.Connection.Password) ||
String.IsNullOrEmpty(parameters.Connection.ServerName) ||
String.IsNullOrEmpty(parameters.Connection.UserName)
);
}
}
}