public int AddDrink(int machineId, int drinkId, int count) { var machine = _wendingMachineRepository.GetMachineById(machineId); var new1 = machine.Drinks.FirstOrDefault(x => x.Id == drinkId).Count += count; _wendingMachineRepository.Update(machine); return(machine.Drinks.FirstOrDefault(x => x.Id == drinkId).Count); }
public WendingMachineDto GetMachineById(int machineId) { WendingMachine machine = _wendingMachineRepository.GetMachineById(machineId); return(Mapper.Map <WendingMachineDto>(machine)); }