Exemplo n.º 1
0
        /// <summary>
        /// Maps a CustomEntityDefinitionSummary into a CustomEntityDefinitionMicroSummary object.
        /// </summary>
        /// <param name="summary">Instance to map.</param>
        public CustomEntityDefinitionMicroSummary Map(CustomEntityDefinitionSummary summary)
        {
            if (summary == null)
            {
                throw new ArgumentNullException(nameof(summary));
            }

            var result = new CustomEntityDefinitionMicroSummary()
            {
                CustomEntityDefinitionCode = summary.CustomEntityDefinitionCode,
                Description            = summary.Description,
                ForceUrlSlugUniqueness = summary.ForceUrlSlugUniqueness,
                Name       = summary.Name,
                NamePlural = summary.NamePlural
            };

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Maps a code base custom entity definition into a CustomEntityDefinitionMicroSummary object.
        /// </summary>
        /// <param name="codeDefinition">Code based definition to map.</param>
        public CustomEntityDefinitionMicroSummary Map(ICustomEntityDefinition codeDefinition)
        {
            if (codeDefinition == null)
            {
                throw new ArgumentNullException(nameof(codeDefinition));
            }

            var result = new CustomEntityDefinitionMicroSummary()
            {
                CustomEntityDefinitionCode = codeDefinition.CustomEntityDefinitionCode,
                Description            = codeDefinition.Description,
                ForceUrlSlugUniqueness = codeDefinition.ForceUrlSlugUniqueness,
                Name       = codeDefinition.Name,
                NamePlural = codeDefinition.NamePlural
            };

            return(result);
        }