Пример #1
0
        private async Task <Registration> GetRegistrationById(IRegistrationRepository repository, Guid id)
        {
            var registration = (await repository.FindAsync(x => x.Id == id,
                                                           includes: new List <Expression <Func <Registration, object> > > {
                x => x.PrivateData, x => x.CompanyData
            }))
                               .FirstOrDefault();

            if (registration == null)
            {
                throw new ResourceNotFoundException($"Registration with id {id} was not found.");
            }

            return(registration);
        }