public async Task <IActionResult> StartSync(int id) { var instance = await _instanceRepository.GetByIdAsync(id); var previousSync = await _syncRepository.GetLastSuccessfulSync(id); var newSync = _syncModelFactory.CreateModel(id, instance.Name, previousSync); await _syncRepository.InsertAsync(newSync); return(RedirectToAction("Index", "Sync")); }