Please find source code of inner service which ABP team ask for UnitOfWork.
Public class TWAppService: ITWAppService { private readonly ObjectPool<ApiDC> _objectPool; private readonly IConfigurationRoot _configuration; private readonly FFConfig _fFConfig; private readonly IDSRepository _dsRepository; private readonly ILogger _logger;
public TWAppService ( IAppConfigurationAccessor appConfigurationAccessor, IDSRepository dsRepository, ObjectPool<ApiDC> objectPool, ILogger logger) { _configuration = appConfigurationAccessor.Configuration; _fFConfig = new FFConfig(); _configuration.GetSection(FFConfig.FFConfig).Bind(_FFConfig); _dsRepository = dsRepository; _objectPool = objectPool; _logger = logger; }
public async Task<WKObject> GetViewWk() { var apiContext = _objectPool.Get(); var ds = _dsRepository.GetDataSource(DefaultSource.Ff.GetHashCode()); var ViewUrl = ds.BaseUrl + _FFConfig.ViewWiki; var data = await apiContext.GetData(ViewUrl, ds); var obj = JsonConvert.DeserializeObject<WKObject>(data); return obj; } }
Support team. Please suggest.
This issue is intermittent and is occurring on some pages. Below the code snippet from one of the page where issue is found.
[AbpAuthorize(AppPermissions.Services_CS_TW)]
public class TWAppService: DashboardAppServiceBase, ITWAppService
{
private readonly IFFOrgRepository _ffOrgRepository;
public TWAppService(IFFOrgRepository FFOrgRepository)
{
_ffOrgRepository = FFOrgRepository;
}
[HttpGet]
public async Task<WkObject> GetViewWk()
{
return await _ffOrgRepository.GetViewWk();
}