public async Task <EmployerProfile> GetAsync(string employerAccountId, long legalEntityId)
        {
            var builder = Builders <EmployerProfile> .Filter;
            var filter  = builder.Eq(x => x.Id, EmployerProfile.GetId(employerAccountId, legalEntityId));

            var collection = GetCollection <EmployerProfile>();

            var result = await RetryPolicy.ExecuteAsync(context => collection.FindAsync(filter), new Context(nameof(GetAsync)));

            return(result.SingleOrDefault());
        }
Beispiel #2
0
        public async Task <EmployerProfile> GetAsync(string employerAccountId, string accountLegalEntityPublicHashedId)
        {
            var builder = Builders <EmployerProfile> .Filter;
            var filter  = builder.Eq(x => x.Id, EmployerProfile.GetId(employerAccountId, accountLegalEntityPublicHashedId));

            var collection = GetCollection <EmployerProfile>();

            var result = await RetryPolicy.Execute(_ =>
                                                   collection.Find(filter).SingleOrDefaultAsync(),
                                                   new Context(nameof(GetAsync)));

            return(result);
        }