예제 #1
0
        public void Delete(DecisionViewModel model)
        {
            var item = _repository.FindById(model.Id);

            if (item != null)
            {
                _repository.Delete(item);
            }
        }
예제 #2
0
        public (bool condition, string message) DeleteMinutzDecision
            (string referenceId, string decisionId, AuthRestModel user)
        {
            if (string.IsNullOrEmpty(referenceId))
            {
                throw new ArgumentNullException(nameof(referenceId), "Please provide a valid reference id.");
            }

            var instanceConnectionString = _applicationSetting.CreateConnectionString(_applicationSetting.Server,
                                                                                      _applicationSetting.Catalogue, user.InstanceId,
                                                                                      _applicationSetting.GetInstancePassword(user.InstanceId));

            var masterConnectionString = _applicationSetting.CreateConnectionString(_applicationSetting.Server,
                                                                                    _applicationSetting.Catalogue, _applicationSetting.Username, _applicationSetting.Password);
            var result = _decisionRepository.Delete(Guid.Parse(decisionId), user.InstanceId, instanceConnectionString);

            return(result, result ? "Success" : "Failed");
        }