Ejemplo n.º 1
0
        /// <summary>
        /// Generates the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <param name="component">The component identifier.</param>
        /// <returns></returns>
        public string Generate(DatabaseEntity entity, GeneratorComponent component)
        {
            if (FormBaseTemplateConfiguration.Instance.ValidateForm())
            {
                BaseGenerator generator = new BaseGenerator(Settings, entity);

                switch (component.Id)
                {
                case (int)eBaseTemplateComponent.DOMAIN: { return(generator.GenerateCodeDomain()); }

                case (int)eBaseTemplateComponent.DATA_ACCESS: { return(generator.GenerateCodeDataAccess()); }

                case (int)eBaseTemplateComponent.DATA_ACCESS_ASYNC: { return(generator.GenerateCodeDataAccessAsync()); }
                }
            }

            return(string.Empty);
        }