ProjectResourceExtensions Methods
ClassMethods2 members
Provides extension methods for
DistributedApplicationModel to work with ProjectResource instances. GetProjectMetadata(ProjectResource)Section titled GetProjectMetadata(ProjectResource)extensionIProjectMetadata Gets the project metadata for the specified project resource.
public static class ProjectResourceExtensions{ public static IProjectMetadata GetProjectMetadata( this ProjectResource projectResource) { // ... }}Parameters
projectResourceProjectResourceThe project resource.Returns
IProjectMetadataThe 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. GetProjectResources(DistributedApplicationModel)Section titled GetProjectResources(DistributedApplicationModel)extensionIEnumerable<ProjectResource> Returns all project resources in the distributed application model.
public static class ProjectResourceExtensions{ public static IEnumerable<ProjectResource> GetProjectResources( this DistributedApplicationModel model) { // ... }}Parameters
modelDistributedApplicationModelThe distributed application model.Returns
IEnumerable<ProjectResource>An enumerable collection of project resources.