Пример #1
0
        /// <summary>
        /// Logic to handle the mapping
        /// </summary>
        /// <param name="newStudentDriverMappingViewModel"></param>
        /// <returns></returns>
        public async Task <bool> MapStudentToDriver(NewStudentDriverMappingViewModel newStudentDriverMappingViewModel)
        {
            var driver = await _driverLogic.Get(newStudentDriverMappingViewModel.DriverId);

            // Save changes to driver
            return(await _studentLogic.Update(newStudentDriverMappingViewModel.StudentId, x =>
            {
                // Add map
                x.Driver = driver;
                x.DriverRefId = driver.Id;
            }) != null);
        }
        public async Task <IActionResult> EditView(int id)
        {
            var driver = await _driverLogic.Get(id);

            return(View("Edit", driver));
        }