Пример #1
0
        async Task <ActionResult> UpdateCodeFeatureState(EnableCodeFeatureViewModel model, CancellationToken cancellationToken, bool enabled)
        {
            if (ModelState.IsValid)
            {
                var codeFeatureId = new Uri(model.CodeFeatureId);
                var timestamp     = DateTime.UtcNow;

                var command = new UpdateApplicationCodeFeatureState(model.ApplicationId, codeFeatureId, enabled, timestamp);

                await _updateApplicationCodeFeatureState.Execute(command, cancellationToken);

                return(RedirectToAction("Details", new { id = model.ApplicationId }));
            }

            return(RedirectToAction("Index"));
        }
Пример #2
0
        async Task<ActionResult> UpdateCodeFeatureState(EnableCodeFeatureViewModel model, CancellationToken cancellationToken, bool enabled)
        {
            if (ModelState.IsValid)
            {
                var codeFeatureId = new Uri(model.CodeFeatureId);
                var timestamp = DateTime.UtcNow;

                var command = new UpdateApplicationCodeFeatureState(model.ApplicationId, codeFeatureId, enabled, timestamp);

                await _updateApplicationCodeFeatureState.Execute(command, cancellationToken);

                return RedirectToAction("Details", new {id = model.ApplicationId});
            }

            return RedirectToAction("Index");
        }
Пример #3
0
 public async Task<ActionResult> Disable(EnableCodeFeatureViewModel model, CancellationToken cancellationToken)
 {
     return await UpdateCodeFeatureState(model, cancellationToken, false);
 }
Пример #4
0
 public async Task <ActionResult> Disable(EnableCodeFeatureViewModel model, CancellationToken cancellationToken)
 {
     return(await UpdateCodeFeatureState(model, cancellationToken, false));
 }