Browse Source

Resolved #32: Created ApplicationService, DomainService and AbpServiceBase classes.

pull/96/head
Halil İbrahim Kalkan 9 years ago
parent
commit
fa6d989a0c
  1. 27
      src/Volo.Abp/Volo/Abp/AbpServiceBase.cs
  2. 14
      src/Volo.Abp/Volo/Abp/Application/Services/ApplicationService.cs
  3. 7
      src/Volo.Abp/Volo/Abp/Domain/Services/DomainService.cs

27
src/Volo.Abp/Volo/Abp/AbpServiceBase.cs

@ -0,0 +1,27 @@
using System;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
namespace Volo.Abp
{
public abstract class AbpServiceBase
{
public IUnitOfWorkManager UnitOfWorkManager { get; set; }
public IObjectMapper ObjectMapper { get; set; }
protected IUnitOfWork CurrentUnitOfWork => UnitOfWorkManager?.Current;
public ILoggerFactory LoggerFactory { get; set; }
protected ILogger Logger => _lazyLogger.Value;
private Lazy<ILogger> _lazyLogger => new Lazy<ILogger>(() => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance, true);
/* Will be added when developed
- Setting manager
- Localization manager and helper methods
*/
}
}

14
src/Volo.Abp/Volo/Abp/Application/Services/ApplicationService.cs

@ -1,14 +1,10 @@
using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
namespace Volo.Abp.Application.Services
{
public abstract class ApplicationService : IApplicationService
public abstract class ApplicationService : AbpServiceBase, IApplicationService
{
public IUnitOfWorkManager UnitOfWorkManager { get; set; }
public IObjectMapper ObjectMapper { get; set; }
protected IUnitOfWork CurrentUnitOfWork => UnitOfWorkManager.Current;
/* Will be added when implemented
- AbpSession
- ...
*/
}
}

7
src/Volo.Abp/Volo/Abp/Domain/Services/DomainService.cs

@ -0,0 +1,7 @@
namespace Volo.Abp.Domain.Services
{
public abstract class DomainService : AbpServiceBase, IDomainService
{
}
}
Loading…
Cancel
Save