/// <summary> /// The actual Work to be done. /// </summary> protected override void Execute() { collection collection = null; switch (Request.WellKnownModificationType) { case Core.Enums.WellKnownModificationType.Add: collection = Util.ConvertToCollection(Request.CollectionModel); CollectionRepository.Add(collection); CollectionRepository.Save(); SubseryRepository.Add(new subsery() { CollectionId = collection.Id, SubseriesName = "N/A" }); SubseryRepository.Save(); break; case Core.Enums.WellKnownModificationType.Edit: collection = CollectionRepository.GetCollecrtionToEdit(Request.CollectionModel.Id); collection = Util.ConvertToCollection(collection, Request.CollectionModel); CollectionRepository.Edit(collection); CollectionRepository.Save(); break; default: break; } Response = new ResponseModel() { IsOperationSuccess = true }; }