public static async Task <UpdatePackageResult> UpdatePackageAsync( this IEnumerable <Project> projects, string packageId, string packageVersion, DependencyBehavior dependencyBehaviour, bool allowPrerelease, VersionConstraints versionConstraints, FileConflictAction?conflictAction, IEnumerable <SourceRepository> sources, CancellationToken token) { var message = new UpdatePackageParams { ProjectFileNames = projects.Select(project => project.FileName).ToArray(), PackageId = packageId, PackageVersion = packageVersion, DependencyBehavior = dependencyBehaviour.ToString(), FileConflictAction = conflictAction?.ToString(), VersionConstraints = versionConstraints.ToString(), AllowPrerelease = allowPrerelease, PackageSources = GetPackageSourceInfo(sources).ToArray() }; return(await JsonRpcProvider.Rpc.InvokeWithParameterObjectAsync <UpdatePackageResult> ( Methods.ProjectUpdatePackage, message, token)); }
public static async Task UpdateAllPackagesAsync( this IEnumerable <Project> projects, DependencyBehavior dependencyBehaviour, bool allowPrerelease, VersionConstraints versionConstraints, FileConflictAction?conflictAction, IEnumerable <SourceRepository> sources, CancellationToken token) { var message = new UpdatePackageParams { ProjectFileNames = projects.Select(project => project.FileName).ToArray(), DependencyBehavior = dependencyBehaviour.ToString(), FileConflictAction = conflictAction?.ToString(), VersionConstraints = versionConstraints.ToString(), AllowPrerelease = allowPrerelease, PackageSources = GetPackageSourceInfo(sources).ToArray() }; await JsonRpcProvider.Rpc.InvokeWithCancellationAsync( Methods.ProjectUpdateAllPackages, new [] { message }, token); }
public UpdatePackageMessageHandler(IEnumerable <DotNetProject> projects, UpdatePackageParams message) { this.projects = projects.ToList(); this.message = message; }