public async Task <IActionResult> Index()
        {
            List <InformationViewModel> information = new List <InformationViewModel>();

            //get all the certificates
            var certificates = await context.GetAsync <tblInfo>();

            foreach (var certificate in certificates)
            {
                //get branch
                var branch = await Task.Run(() => context.Get <tblBranch>((x) => x.Id == certificate.Branch_FK));

                //get user
                var user = await userManager.FindByIdAsync(certificate.User_FK);

                InformationViewModel _information = new InformationViewModel()
                {
                    Branch      = branch?.Name,
                    Code        = branch.Code,
                    Branch_FK   = branch.Id,
                    Id          = certificate.Id,
                    Certificate = certificate.Certificate,
                    Created     = certificate.Created,
                    Username    = user?.Email,
                    User_FK     = user?.Id,
                };

                information.Add(_information);
            }

            return(View(information));
        }
        public async Task Handle(AddCharacterType command)
        {
            var context = await _repo.Get(command.ContextId);

            context.AddCharacterType(command.Name, command.Traits);
        }
 public async Task <Context> Handle(ReadContext command)
 {
     return(await _repo.Get(command.ContextId));
 }
Beispiel #4
0
        public async Task Handle(AddUnitType command)
        {
            var context = await _repo.Get(command.ContextId);

            context.AddUnitType(command.Name, command.Description);
        }