File: ListPackage\ListPackageReportModel.cs
Web Access
Project: src\src\nuget-client\src\NuGet.Core\NuGet.CommandLine.XPlat\NuGet.CommandLine.XPlat.csproj (NuGet.CommandLine.XPlat)
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#nullable disable

using System.Collections.Generic;
using NuGet.Configuration;

namespace NuGet.CommandLine.XPlat.ListPackage
{
    /// <summary>
    /// Calculated solution/projects data model for list report
    /// </summary>
    internal class ListPackageReportModel
    {
        internal ListPackageArgs ListPackageArgs { get; }
        internal List<ListPackageProjectModel> Projects { get; } = new();
        internal HashSet<PackageSource> AuditSourcesUsed { get; set; } = new HashSet<PackageSource>();

        private ListPackageReportModel()
        { }

        internal ListPackageReportModel(ListPackageArgs listPackageArgs)
        {
            ListPackageArgs = listPackageArgs;
        }

        internal ListPackageProjectModel CreateProjectReportData(string projectPath, string projectName)
        {
            var projectModel = new ListPackageProjectModel(projectPath, projectName);
            Projects.Add(projectModel);
            return projectModel;
        }
    }
}