コード例 #1
0
        public async Task <LiftViewModel> CreateAsync(LiftViewModel viewModel, string uid)
        {
            /*
             * Create lift and call GetAll to retrieve the updated lifts
             * - Add DaysService call to change Id (int) to String (day)
             */
            LiftName liftName = _liftNameRepository.GetByName(viewModel.LiftName);
            LiftType liftType = _liftTypeRepository.GetByName(viewModel.LiftType);
            Lift     lift     = LiftMapper.MapViewModelToLift(viewModel, uid, liftName, liftType);

            lift = await _liftRepository.CreateAsync(lift, uid);

            return(LiftMapper.MapLiftToViewModel(lift, uid));//, liftName, liftType, uid);
        }