Ejemplo n.º 1
0
/// <summary>
/// Create new StepParagraph.
/// </summary>
/// <param name="stepParagraphRequestPivot">The StepParagraph Request Pivot to add.</param>
/// <returns>StepParagraph Response Pivot created.</returns>
        public StepParagraphResponsePivot CreateStepParagraph(StepParagraphRequestPivot stepParagraphRequestPivot)
        {
            if (stepParagraphRequestPivot == null)
            {
                throw new Exception("The request pivot is null.");
            }
            StepParagraph stepParagraph = stepParagraphRequestPivot.StepParagraphPivot.ToStepParagraph();

            UnitOfWork.StepParagraphRepository.Insert(stepParagraph);
            UnitOfWork.Save();
            return(new StepParagraphResponsePivot()
            {
                StepParagraphPivot = stepParagraph.ToPivot()
            });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create new StepParagraph.
        /// </summary>
        /// <param name="request">The StepParagraph Request Pivot to add.</param>
        /// <returns>StepParagraph Response Pivot created.</returns>
        public StepParagraphResponsePivot CreateStepParagraph(StepParagraphRequestPivot request)
        {
            if (request?.StepParagraphPivot == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            StepParagraph stepParagraph = request.StepParagraphPivot.ToEntity();

            _unitOfWork.StepParagraphRepository.Insert(stepParagraph);
            _unitOfWork.Save();
            return(new StepParagraphResponsePivot
            {
                StepParagraphPivot = stepParagraph.ToPivot()
            });
        }