Exemplo n.º 1
0
        public int Save(WeaponEditModel model)
        {
            var id = MappingSave(_weaponRepository, model);

            var bonuses = model.Bonuses?.Select(x => new WeaponBonus
            {
                WeaponId = id,
                BonusId  = x
            }).AsQueryable();

            _bonusService.BatchSave(bonuses, id, BonusType.Weapon);
            return(id);
        }
Exemplo n.º 2
0
        public int Save(BranchEditModel model)
        {
            var id = MappingSave(_branchRepository, model);

            var bonuses = model.Bonuses?.Select(x => new BranchBonus
            {
                BranchId = model.Id,
                BonusId  = x
            }).AsQueryable();

            _bonusService.BatchSave(bonuses, id, BonusType.Branch);

            return(id);
        }
Exemplo n.º 3
0
        public int Save(RaceEditModel model)
        {
            var id = MappingSave(_raceRepository, model);

            var bonuses = model.Bonuses?.Select(x => new RaceBonus
            {
                RaceId  = model.Id,
                BonusId = x
            }).AsQueryable();

            _bonusService.BatchSave(bonuses, id, BonusType.Race);

            var abilities = model.Abilities?.Select(x => new RaceAbility()
            {
                RaceId    = model.Id,
                AbilityId = x.Id,
                Value     = x.Value
            }).AsQueryable();

            _abilityService.BatchSave(abilities, id);

            return(id);
        }