Пример #1
0
        public async Task <LootTemplateCurrency> Update(LootTemplateCurrency item)
        {
            var LootTemplateCurrency = await _repo.Get((int)item.LootTemplateCurrencyId);

            if (LootTemplateCurrency == null)
            {
                return(LootTemplateCurrency);
            }

            LootTemplateCurrency.Amount  = item.Amount;
            LootTemplateCurrency.Command = item.Command;

            //LootTemplateCurrency.Name = item.Name;
            //LootTemplateCurrency.BaseUnit = item.BaseUnit;
            //LootTemplateCurrency.WeightValue = item.WeightValue;
            //LootTemplateCurrency.SortOrder = item.SortOrder;
            //LootTemplateCurrency.CurrencyTypeId = item.CurrencyTypeId;
            //LootTemplateCurrency.CharacterId = item.CharacterId;
            try
            {
                await _repo.Update(LootTemplateCurrency);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(LootTemplateCurrency);
        }
Пример #2
0
        public async Task <LootTemplateCurrency> Create(LootTemplateCurrency item)
        {
            var LootTemplateCurrency = new LootTemplateCurrency
            {
                Name           = item.Name,
                Amount         = item.Amount,
                Command        = item.Command,
                BaseUnit       = item.BaseUnit,
                WeightValue    = item.WeightValue,
                SortOrder      = item.SortOrder,
                IsDeleted      = false,
                CurrencyTypeId = item.CurrencyTypeId,
                LootTemplateId = item.LootTemplateId,
            };

            return(await _repo.Add(LootTemplateCurrency));
        }