public static Service.Models.TodoItemDTO Map(this Service.Models.TodoItemDTO todoItem, webui.Models.TodoItemDetailsViewModel item)
 {
     todoItem.Id         = item.TodoItem.Id; // > 0 ? item.TodoItem.Id : (long?)null;
     todoItem.Name       = item.TodoItem.Name;
     todoItem.IsComplete = item.TodoItem.IsComplete;
     if (item.FeatureFlags.FeatureFlagIsActive("ta-10-notes-web-ui"))
     {
         todoItem.Notes = item.TodoItem.Notes;
     }
     return(todoItem);
 }
Example #2
0
        public async Task <IActionResult> EditAsync(int id, IFormCollection collection)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }

                Service.Models.TodoItemDTO editItem = new Service.Models.TodoItemDTO().Map(collection, _featureFlagsInUse);
                await _serviceAgent.Update(editItem);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception ex)
            {
                return(View(new TodoItemDetailsViewModel(_featureFlagsInUse).Map(collection, ex)));
            }
        }
Example #3
0
        public static Models.TodoItemDetailsViewModel Map(this Models.TodoItemDetailsViewModel todoItemDetailsVm, Service.Models.TodoItemDTO serviceItem)
        {
            todoItemDetailsVm.TodoItem = new Models.TodoItemViewModel().Map(serviceItem);
            if (todoItemDetailsVm.FeatureFlags.FeatureFlagIsActive("ta-10-notes-web-ui"))
            {
                todoItemDetailsVm.TodoItem.MapTodoExtraInfo(serviceItem);
            }

            return(todoItemDetailsVm);
        }
Example #4
0
 public static Models.TodoItemViewModel MapTodoExtraInfo(this Models.TodoItemViewModel todoItemVm, Service.Models.TodoItemDTO serviceItem)
 {
     todoItemVm.Notes = serviceItem.Notes;
     return(todoItemVm);
 }
Example #5
0
 public static Models.TodoItemViewModel Map(this Models.TodoItemViewModel todoItemVm, Service.Models.TodoItemDTO serviceItem)
 {
     todoItemVm.Id         = serviceItem.Id;
     todoItemVm.Name       = serviceItem.Name;
     todoItemVm.IsComplete = serviceItem.IsComplete;
     return(todoItemVm);
 }
 public static Service.Models.TodoItemDTO Map(this Service.Models.TodoItemDTO todoItem, IFormCollection collection, IFeatureFlags featureFlags)
 {
     Models.TodoItemDetailsViewModel viewModel = new Models.TodoItemDetailsViewModel(featureFlags).Map(collection);
     return(todoItem.Map(viewModel));
 }