예제 #1
0
        public bool Sell(int itemId, int quantity)
        {
            equipmentDal.Get(myHero);
            if (!CanSell(itemId, quantity))
            {
                return(false);
            }

            var item = itemDal.Read(itemId);

            heroService.AddMoney((int)((double)item.Price * 0.8), myHero);
            heroDal.Update(myHero);
            eqService.RemoveItem(itemId, myHero, quantity);
            return(true);
        }
 public async Task <IDataResult <Equipment> > GetById(int equipmentId)
 {
     return(new SuccessDataResult <Equipment>(await _equipmentDal.Get(e => e.EquipmentId == equipmentId)));
 }
 public IDataResult <Equipment> GetById(int Id)
 {
     return(new SuccessDataResult <Equipment>(_equipmentDal.Get(c => c.Id == Id), Messages.EquipmentListed));
 }