Example #1
0
        public async Task <Organization[]> GetByInnAsync(string inn, PartyBranchType?branchType)
        {
            var cachedOrgs = await CacheRepository.FindByInn(inn, branchType);

            if (cachedOrgs.Any())
            {
                return(cachedOrgs);
            }

            await UpsertAsync(inn, findById : true, branchType : branchType);

            return(await CacheRepository.FindByInn(inn, branchType));
        }