working on U4-5927 - this extends the base event class to have EventMessages which event consumers can add to, the trick is that there is a factory for these EventMessages, in a web context, the factory is a request based factory so that during a request all instances of the EventMessages are the same instance. All services then accept an instance of IEventMessagesFactory which they can then use when raising events. We'll then use this to send messages to the UI. Not sure if i should make this a resolver yet or not. Still a WIP!!

This commit is contained in:
Shannon
2015-07-23 20:04:40 +02:00
parent 445dff7c5e
commit a6a2b02cd8
45 changed files with 361 additions and 356 deletions

View File

@@ -35,29 +35,9 @@ namespace Umbraco.Core.Services
private readonly EntityXmlSerializer _entitySerializer = new EntityXmlSerializer();
private readonly IDataTypeService _dataTypeService;
private readonly IUserService _userService;
[Obsolete("Use the constructors that specify all dependencies instead")]
public MediaService(RepositoryFactory repositoryFactory)
: this(new PetaPocoUnitOfWorkProvider(), repositoryFactory)
{
}
[Obsolete("Use the constructors that specify all dependencies instead")]
public MediaService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory)
: base(provider, repositoryFactory, LoggerResolver.Current.Logger)
{
_dataTypeService = new DataTypeService(provider, repositoryFactory);
_userService = new UserService(provider, repositoryFactory);
}
[Obsolete("Use the constructors that specify all dependencies instead")]
public MediaService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IDataTypeService dataTypeService, IUserService userService)
: this(provider, repositoryFactory, LoggerResolver.Current.Logger, dataTypeService, userService)
{
}
public MediaService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IDataTypeService dataTypeService, IUserService userService)
: base(provider, repositoryFactory, logger)
public MediaService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory, IDataTypeService dataTypeService, IUserService userService)
: base(provider, repositoryFactory, logger, eventMessagesFactory)
{
if (dataTypeService == null) throw new ArgumentNullException("dataTypeService");
if (userService == null) throw new ArgumentNullException("userService");