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); }
public void Insert(TModel entity) { _repository.Upsert(entity); _changeQueue.QueueCreate(entity); }