Ejemplo n.º 1
0
        /// <summary>
        /// Create new SectionTranslation.
        /// </summary>
        /// <param name="request">The SectionTranslation Request Pivot to add.</param>
        /// <returns>SectionTranslation Response Pivot created.</returns>
        public SectionTranslationResponsePivot CreateSectionTranslation(SectionTranslationRequestPivot request)
        {
            if (request?.SectionTranslationPivot == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            SectionTranslation sectionTranslation = request.SectionTranslationPivot.ToEntity();

            _unitOfWork.SectionTranslationRepository.Insert(sectionTranslation);
            _unitOfWork.Save();
            return(new SectionTranslationResponsePivot
            {
                SectionTranslationPivot = sectionTranslation.ToPivot()
            });
        }