ProjectResourceExtensions Methods
ClassMethods4 members
Provides extension methods for
DistributedApplicationModel to work with ProjectResource instances. GetProjectMetadata(ProjectResource) Section titled GetProjectMetadata(ProjectResource)extensionI Gets the project metadata for the specified project resource.
public static class ProjectResourceExtensions{ public static IProjectMetadata GetProjectMetadata( this ProjectResource projectResource) { // ... }}Parameters
projectResource ProjectReturns
IProjectMetadata The project metadata.Exceptions
InvalidOperationExceptionThrown when the project resource doesn't have exactly one project metadata annotation.Remarks
A project resource must carry exactly one
IProjectMetadata annotation. Project metadata cannot be replaced after project defaults have been applied because launch settings, endpoints, and rebuild behavior are derived from that annotation. GetProjectMetadata(IDotnetProgramResource) Section titled GetProjectMetadata(IDotnetProgramResource)extensionI Gets the project metadata for the specified .NET program resource.
public static class ProjectResourceExtensions{ public static IProjectMetadata GetProjectMetadata( this IDotnetProgramResource programResource) { // ... }}Parameters
programResource IReturns
IProjectMetadata The project metadata.Exceptions
InvalidOperationException The resource does not carry exactly one stable IProjectMetadata annotation. GetProjectResources(DistributedApplicationModel) Section titled GetProjectResources(DistributedApplicationModel)extensionI Returns all project resources in the distributed application model.
public static class ProjectResourceExtensions{ public static IEnumerable<ProjectResource> GetProjectResources( this DistributedApplicationModel model) { // ... }}Parameters
modelDistributedReturns
IEnumerable<ProjectResource> An enumerable collection of project resources.SupportsDotnetProgramPublishing(IResource) Section titled SupportsDotnetProgramPublishing(IResource)extensionbool Gets a value indicating whether the resource is configured for .NET SDK container publishing.
public static class ProjectResourceExtensions{ public static bool SupportsDotnetProgramPublishing( this IResource resource) { // ... }}Parameters
resourceIReturns
booltrue when the resource is a .NET program configured for SDK container publishing; otherwise, false.