Exemple #1
0
        public XOFFOperationResult <TModel> Insert(TModel entity, string queueJson = null, bool putOnQueue = true)
        {
            var repositoryResult = _repository.Upsert(entity);

            if (!repositoryResult.Success)
            {
                return(repositoryResult);
            }
            if (putOnQueue)
            {
                var queueResult = _changeQueue.QueueCreate(entity, queueJson);
                if (!queueResult.Success)
                {
                    return(XOFFOperationResult <TModel> .CreateFailure(queueResult.Exception));
                }
            }
            return(repositoryResult);
        }
Exemple #2
0
 public void Insert(TModel entity)
 {
     _repository.Upsert(entity);
     _changeQueue.QueueCreate(entity);
 }