protected override async Task OnInitializedAsync()
        {
            Random random = new Random();

            randomNumber = random.Next(0, BackgroundImages.Length);

            NinjaList = await NinjaViewModel.GetNinjaList();

            foreach (Ninja i in NinjaList)
            {
                i.Mystery = await MysteryViewModel.GetMystery(i.MysteryId);

                i.Attack = await AttackViewModel.GetAttack(i.AttackId);

                if (i.ChaseId1 != null)
                {
                    i.Chases[0] = await ChaseViewModel.GetChase((long)i.ChaseId1);
                }
                if (i.ChaseId2 != null)
                {
                    i.Chases[1] = await ChaseViewModel.GetChase((long)i.ChaseId2);
                }
                if (i.ChaseId3 != null)
                {
                    i.Chases[2] = await ChaseViewModel.GetChase((long)i.ChaseId3);
                }

                if (i.PassiveId1 != null)
                {
                    i.Passives[0] = await PassiveViewModel.GetPassive((long)i.PassiveId1);
                }
                if (i.PassiveId2 != null)
                {
                    i.Passives[1] = await PassiveViewModel.GetPassive((long)i.PassiveId2);
                }
                if (i.PassiveId3 != null)
                {
                    i.Passives[2] = await PassiveViewModel.GetPassive((long)i.PassiveId3);
                }
            }

            FilteredList = NinjaList;
        }
        protected override async Task OnInitializedAsync()
        {
            NinjaList = await NinjaViewModel.GetNinjaList();

            foreach (Ninja i in NinjaList)
            {
                i.Mystery = await MysteryViewModel.GetMystery(i.MysteryId);

                i.Attack = await AttackViewModel.GetAttack(i.AttackId);

                if (i.ChaseId1 != null)
                {
                    i.Chases[0] = await ChaseViewModel.GetChase((long)i.ChaseId1);
                }
                if (i.ChaseId2 != null)
                {
                    i.Chases[1] = await ChaseViewModel.GetChase((long)i.ChaseId2);
                }
                if (i.ChaseId3 != null)
                {
                    i.Chases[2] = await ChaseViewModel.GetChase((long)i.ChaseId3);
                }

                if (i.PassiveId1 != null)
                {
                    i.Passives[0] = await PassiveViewModel.GetPassive((long)i.PassiveId1);
                }
                if (i.PassiveId2 != null)
                {
                    i.Passives[1] = await PassiveViewModel.GetPassive((long)i.PassiveId2);
                }
                if (i.PassiveId3 != null)
                {
                    i.Passives[2] = await PassiveViewModel.GetPassive((long)i.PassiveId3);
                }
            }

            FilteredList = NinjaList;
        }
        protected override async Task OnInitializedAsync()
        {
            EditRoute = $"ninjas/edit/{Id}";

            NinjaModel = await NinjaViewModel.GetNinja(Id);

            NinjaModel.Mystery = await MysteryViewModel.GetMystery(NinjaModel.MysteryId);

            NinjaModel.Attack = await AttackViewModel.GetAttack(NinjaModel.AttackId);

            if (NinjaModel.ChaseId1 != null)
            {
                NinjaModel.Chases[0] = await ChaseViewModel.GetChase((long)NinjaModel.ChaseId1);
            }
            if (NinjaModel.ChaseId2 != null)
            {
                NinjaModel.Chases[1] = await ChaseViewModel.GetChase((long)NinjaModel.ChaseId2);
            }
            if (NinjaModel.ChaseId3 != null)
            {
                NinjaModel.Chases[2] = await ChaseViewModel.GetChase((long)NinjaModel.ChaseId3);
            }

            if (NinjaModel.PassiveId1 != null)
            {
                NinjaModel.Passives[0] = await PassiveViewModel.GetPassive((long)NinjaModel.PassiveId1);
            }
            if (NinjaModel.PassiveId2 != null)
            {
                NinjaModel.Passives[1] = await PassiveViewModel.GetPassive((long)NinjaModel.PassiveId2);
            }
            if (NinjaModel.PassiveId3 != null)
            {
                NinjaModel.Passives[2] = await PassiveViewModel.GetPassive((long)NinjaModel.PassiveId3);
            }
        }
Exemple #4
0
        protected override async Task OnInitializedAsync()
        {
            EditRoute = $"chases/edit/{Id}";

            ChaseModel = await ChaseViewModel.GetChase(long.Parse(Id));
        }