Beispiel #1
0
        /// <summary>
        /// The actual Work to be done.
        /// </summary>
        protected override void Execute()
        {
            repository repository = null;

            switch (Request.WellKnownModificationType)
            {
            case Core.Enums.WellKnownModificationType.Add:

                repository = Util.ConvertToRepository(Request.RepositoryModel);

                RepositoryRepository.Add(repository);
                RepositoryRepository.Save();

                break;

            case Core.Enums.WellKnownModificationType.Edit:

                repository = RepositoryRepository.GetRepositoryToEdit(Request.RepositoryModel.Id);

                repository = Util.ConvertToRepository(repository, Request.RepositoryModel);

                RepositoryRepository.Edit(repository);
                RepositoryRepository.Save();

                break;

            default:
                break;
            }

            Response = new ResponseModel()
            {
                IsOperationSuccess = true
            };
        }