Пример #1
0
        public async Task <List <DependentViewModel> > DependentList(int TenantId)
        {
            List <Dependent> dependent = await _dependentRepository.DependentList(TenantId);

            List <DependentViewModel> dependentVM = new List <DependentViewModel>();

            foreach (Dependent d in dependent)
            {
                DependentViewModel dVM = new DependentViewModel();
                dVM.DependentId = d.DependentId;
                dVM.TenantId    = d.TenantId;
                dVM.FirstName   = d.FirstName;
                dVM.LastName    = d.LastName;
                dVM.Gender      = d.Gender;
                dVM.Age         = d.Age;
                dVM.Email       = d.Email;
                dVM.Phone       = d.Phone;
                dVM.Notes       = d.Notes;
                dependentVM.Add(dVM);
            }

            return(dependentVM);
        }