/// <summary> /// Formats all the supported service objectives in <paramref name="edition"/> as strings prefixed with <paramref name="prefix"/> /// and appends them to the <paramref name="builder"/> /// </summary> /// <param name="builder">The string building to add the formatted string to</param> /// <param name="edition">The edition containing the supported service objectives</param> /// <param name="prefix">The prefix for the formatted string</param> private void ExpandServiceObjective(StringBuilder builder, EditionCapabilityModel edition, string prefix) { foreach (var slo in edition.SupportedServiceObjectives) { string serviceObjectiveInfo = GetServiceObjectiveInformation(prefix, slo); builder.AppendLine(serviceObjectiveInfo); } }
/// <summary> /// Converts from an API object to a PowerShell object /// </summary> /// <param name="e">The object to transform</param> /// <returns>The converted database edition capability model</returns> private EditionCapabilityModel CreateSupportedEditionModel(Management.Sql.Models.EditionCapability e) { EditionCapabilityModel edition = new EditionCapabilityModel(); edition.EditionName = e.Name; edition.Status = e.Status; edition.SupportedServiceObjectives = e.SupportedServiceObjectives.Select(slo => { return(CreateSupportedSLOModel(slo)); }).ToList(); return(edition); }
/// <summary> /// Gets the string formatting of the edition object /// </summary> /// <param name="baseString">The prefix before the edition information</param> /// <param name="edition">The edition information to format and append to the end of the baseString</param> /// <returns>The formatted string containing the edition information</returns> private string GetEditionInformation(string baseString, EditionCapabilityModel edition) { return(string.Format("{0} -> Edition: {1} ({2})", baseString, edition.EditionName, edition.Status)); }