U4-4847 Refactor ContentService (#1266)
* U4-4748 - refactor Content-, Media- and MemberTypeRepository * Cleanup Attempt * Cleanup OperationStatus * U4-4748 - refactor Content-, Media- and MemberTypeService * U4-4748 - cleanup locking * U4-4748 - refactor Content-, Media- and MemberRepository * U4-4748 - refactor ContentService (in progress) * U4-4748 - all unit of work must be completed * U4-4748 - refactor locks, fix tests * U4-4748 - deal with fixmes * U4-4748 - lock table migration * Update UmbracoVersion * Fix AuthorizeUpgrade * U4-4748 - cleanup+bugfix lock objects * U4-4748 - bugfix * updates a string interpolation
This commit is contained in:
committed by
Shannon Deminick
parent
12f4873c90
commit
ddf38407d8
@@ -67,10 +67,10 @@ namespace Umbraco.Web.Cache
|
||||
|
||||
//Bind to content type events
|
||||
|
||||
ContentTypeService.SavedContentType += ContentTypeServiceSavedContentType;
|
||||
ContentTypeService.SavedMediaType += ContentTypeServiceSavedMediaType;
|
||||
ContentTypeService.DeletedContentType += ContentTypeServiceDeletedContentType;
|
||||
ContentTypeService.DeletedMediaType += ContentTypeServiceDeletedMediaType;
|
||||
ContentTypeService.Saved += ContentTypeServiceSavedContentType;
|
||||
MediaTypeService.Saved += ContentTypeServiceSavedMediaType;
|
||||
ContentTypeService.Deleted += ContentTypeServiceDeletedContentType;
|
||||
MediaTypeService.Deleted += ContentTypeServiceDeletedMediaType;
|
||||
MemberTypeService.Saved += MemberTypeServiceSaved;
|
||||
MemberTypeService.Deleted += MemberTypeServiceDeleted;
|
||||
|
||||
@@ -113,8 +113,8 @@ namespace Umbraco.Web.Cache
|
||||
ContentService.Trashed += ContentServiceTrashed;
|
||||
ContentService.EmptiedRecycleBin += ContentServiceEmptiedRecycleBin;
|
||||
|
||||
PublishingStrategy.Published += PublishingStrategy_Published;
|
||||
PublishingStrategy.UnPublished += PublishingStrategy_UnPublished;
|
||||
ContentService.Published += ContentService_Published;
|
||||
ContentService.UnPublished += ContentService_UnPublished;
|
||||
|
||||
//public access events
|
||||
PublicAccessService.Saved += PublicAccessService_Saved;
|
||||
@@ -123,7 +123,7 @@ namespace Umbraco.Web.Cache
|
||||
|
||||
#region Publishing
|
||||
|
||||
void PublishingStrategy_UnPublished(IPublishingStrategy sender, PublishEventArgs<IContent> e)
|
||||
void ContentService_UnPublished(IContentService sender, PublishEventArgs<IContent> e)
|
||||
{
|
||||
if (e.PublishedEntities.Any())
|
||||
{
|
||||
@@ -150,7 +150,7 @@ namespace Umbraco.Web.Cache
|
||||
DistributedCache.Instance.RemovePageCache(content);
|
||||
}
|
||||
|
||||
void PublishingStrategy_Published(IPublishingStrategy sender, PublishEventArgs<IContent> e)
|
||||
void ContentService_Published(IContentService sender, PublishEventArgs<IContent> e)
|
||||
{
|
||||
if (e.PublishedEntities.Any())
|
||||
{
|
||||
@@ -439,7 +439,7 @@ namespace Umbraco.Web.Cache
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
static void ContentTypeServiceDeletedMediaType(IContentTypeService sender, DeleteEventArgs<IMediaType> e)
|
||||
static void ContentTypeServiceDeletedMediaType(IMediaTypeService sender, DeleteEventArgs<IMediaType> e)
|
||||
{
|
||||
e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveMediaTypeCache(x));
|
||||
}
|
||||
@@ -469,7 +469,7 @@ namespace Umbraco.Web.Cache
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
static void ContentTypeServiceSavedMediaType(IContentTypeService sender, SaveEventArgs<IMediaType> e)
|
||||
static void ContentTypeServiceSavedMediaType(IMediaTypeService sender, SaveEventArgs<IMediaType> e)
|
||||
{
|
||||
e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshMediaTypeCache(x));
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ namespace Umbraco.Web.Cache
|
||||
ClearContentTypeCache(
|
||||
ids.Select(
|
||||
x =>
|
||||
ApplicationContext.Current.Services.ContentTypeService.GetContentType(x) as IContentTypeBase)
|
||||
ApplicationContext.Current.Services.ContentTypeService.Get(x) as IContentTypeBase)
|
||||
.WhereNotNull()
|
||||
.Select(x => FromContentType(x, isDeleted))
|
||||
.ToArray());
|
||||
|
||||
Reference in New Issue
Block a user