Fixes ContentTypeBaseRepository - there were several hack in place to query by GUID but this is totally irrelavent because we are caching them all so the result should be from the GetAll(), so this removes all of those hacks which greatly simplifies things. This fixes the MapContentTypes and MapMediaTypes methods - before this was looking up a collection and then recursing back to Get(int) (but we already have all of the data we need), then it was storing a lot of arrays in memory to build up an Entity when it's much faster to just iterate forward only and build up the entity. This saves 5 SQL calls on startup.

This commit is contained in:
Shannon
2016-01-27 18:55:10 +01:00
parent 02b74a5059
commit 0cefdcbc20
6 changed files with 265 additions and 324 deletions

View File

@@ -53,6 +53,9 @@ namespace Umbraco.Core.Models
/// <summary>
/// Gets or sets the alias of the default Template.
/// TODO: This should be ignored from cloning!!!!!!!!!!!!!!
/// - but to do that we have to implement callback hacks, this needs to be fixed in v8,
/// we should not store direct entity
/// </summary>
[IgnoreDataMember]
public ITemplate DefaultTemplate
@@ -79,6 +82,9 @@ namespace Umbraco.Core.Models
/// <summary>
/// Gets or Sets a list of Templates which are allowed for the ContentType
/// TODO: This should be ignored from cloning!!!!!!!!!!!!!!
/// - but to do that we have to implement callback hacks, this needs to be fixed in v8,
/// we should not store direct entity
/// </summary>
[DataMember]
public IEnumerable<ITemplate> AllowedTemplates