iScraper/Services/ServiceWrapper.cs

31 lines
792 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ViraScraper.Repositories.Contracts;
using ViraScraper.Services.Contracts;
namespace ViraScraper.Services
{
public class ServiceWrapper : IServiceWrapper
{
private readonly IRepositoryWrapper _repositoryWrapper;
public ServiceWrapper(IRepositoryWrapper repository)
{
_repositoryWrapper = repository;
}
private IHashtagService _hashtagService;
public IHashtagService HashtagService
{
get
{
if (_hashtagService == null)
_hashtagService = new HashtagService(_repositoryWrapper);
return _hashtagService;
}
}
}
}