consolidate Clone logic for Resource objects
This commit is contained in:
@ -71,7 +71,7 @@
|
||||
if (ModuleType != null)
|
||||
{
|
||||
// repopulate the SiteState service based on the values passed in the SiteState parameter (this is how state is marshalled across the render mode boundary)
|
||||
ComponentSiteState.Clone(SiteState);
|
||||
ComponentSiteState.Hydrate(SiteState);
|
||||
|
||||
DynamicComponent = builder =>
|
||||
{
|
||||
|
@ -569,21 +569,22 @@
|
||||
// ensure resource does not exist already
|
||||
if (!pageresources.Exists(item => item.Url.ToLower() == resource.Url.ToLower()))
|
||||
{
|
||||
pageresources.Add(new Resource
|
||||
{
|
||||
ResourceType = resource.ResourceType,
|
||||
Url = resource.Url,
|
||||
Integrity = resource.Integrity,
|
||||
CrossOrigin = resource.CrossOrigin,
|
||||
Bundle = resource.Bundle,
|
||||
Location = resource.Location,
|
||||
ES6Module = resource.ES6Module,
|
||||
Content = resource.Content,
|
||||
RenderMode = resource.RenderMode,
|
||||
Reload = resource.Reload,
|
||||
Level = level,
|
||||
Namespace = name
|
||||
});
|
||||
pageresources.Add(resource.Clone(level, name));
|
||||
// pageresources.Add(new Resource
|
||||
// {
|
||||
// ResourceType = resource.ResourceType,
|
||||
// Url = resource.Url,
|
||||
// Integrity = resource.Integrity,
|
||||
// CrossOrigin = resource.CrossOrigin,
|
||||
// Bundle = resource.Bundle,
|
||||
// Location = resource.Location,
|
||||
// ES6Module = resource.ES6Module,
|
||||
// Content = resource.Content,
|
||||
// RenderMode = resource.RenderMode,
|
||||
// Reload = resource.Reload,
|
||||
// Level = level,
|
||||
// Namespace = name
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user