public ActionResult Index(Guid clientId)
        {
            IList <Agreement> agreements;

            using (var transactionScope = new TransactionScope())
            {
                agreements = _agreementRepository.GetByClientId(clientId);
                transactionScope.Complete();
            }

            var viewModel = new IndexAgreementsViewModel
            {
                ClientId = clientId,
                Records  = agreements.Select(agreement => new IndexAgreementsRecordViewModel
                {
                    Id           = agreement.Id.Value,
                    Commencement = agreement.Commencement,
                    Expiry       = agreement.Expiry,
                    Status       = agreement.Status
                }).ToList()
            };

            return(View(viewModel));
        }
示例#2
0
 public Task <IEnumerable <AgreementResponse> > GetByClientId(Guid clientId) => _agreementRepository.GetByClientId(clientId);