/// <summary>
 /// Constructor for the Handlebars entity types generator.
 /// </summary>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="cSharpHelper">CSharp helper.</param>
 public HbsCSharpEntityTypeGenerator(
     IEntityTypeTemplateService entityTypeTemplateService,
     IEntityTypeTransformationService entityTypeTransformationService,
     ICSharpHelper cSharpHelper)
 {
     CSharpHelper = cSharpHelper ?? throw new ArgumentNullException(nameof(cSharpHelper));
     EntityTypeTemplateService       = entityTypeTemplateService ?? throw new ArgumentNullException(nameof(entityTypeTemplateService));
     EntityTypeTransformationService = entityTypeTransformationService ?? throw new ArgumentNullException(nameof(entityTypeTransformationService));
 }
 public MyHbsCSharpEntityTypeGenerator(
     ICSharpHelper cSharpHelper,
     IEntityTypeTemplateService entityTypeTemplateService,
     IEntityTypeTransformationService entityTypeTransformationService,
     IOptions <HandlebarsScaffoldingOptions> options)
     : base(cSharpHelper, entityTypeTemplateService, entityTypeTransformationService, options)
 {
     _options = options;
 }
 /// <summary>
 /// Constructor for the Handlebars entity types generator.
 /// </summary>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="cSharpHelper">CSharp helper.</param>
 public HbsCSharpEntityTypeConfigurationGenerator(
     IAnnotationCodeGenerator annotationCodeGenerator,
     IEntityTypeConfigurationTemplateService entityTypeConfigurationTemplateService,
     IEntityTypeTransformationService entityTypeTransformationService,
     ICSharpHelper cSharpHelper)
 {
     CSharpHelper  = cSharpHelper ?? throw new ArgumentNullException(nameof(cSharpHelper));
     CodeGenerator = annotationCodeGenerator ?? throw new ArgumentNullException(nameof(annotationCodeGenerator));
     EntityTypeConfigurationTemplateService = entityTypeConfigurationTemplateService ?? throw new ArgumentNullException(nameof(entityTypeConfigurationTemplateService));
     EntityTypeTransformationService        = entityTypeTransformationService ?? throw new ArgumentNullException(nameof(entityTypeTransformationService));
 }
 /// <summary>
 /// Constructor for the Handlebars entity types generator.
 /// </summary>
 /// <param name="cSharpHelper">CSharp helper.</param>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="options">Handlebar scaffolding options.</param>
 public HbsCSharpEntityTypeGenerator(
     [NotNull] ICSharpHelper cSharpHelper,
     [NotNull] IEntityTypeTemplateService entityTypeTemplateService,
     [NotNull] IEntityTypeTransformationService entityTypeTransformationService,
     [NotNull] IOptions <HandlebarsScaffoldingOptions> options)
     : base(cSharpHelper)
 {
     CSharpHelper = cSharpHelper;
     EntityTypeTemplateService       = entityTypeTemplateService;
     EntityTypeTransformationService = entityTypeTransformationService;
     _options = options;
 }
Example #5
0
 /// <summary>
 /// Constructor for the Handlebars entity types generator.
 /// </summary>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="cSharpHelper">CSharp helper.</param>
 /// <param name="typeScriptHelper">TypeScript helper.</param>
 public HbsTypeScriptEntityTypeGenerator(
     [NotNull] IEntityTypeTemplateService entityTypeTemplateService,
     [NotNull] IEntityTypeTransformationService entityTypeTransformationService,
     [NotNull] ICSharpHelper cSharpHelper,
     [NotNull] ITypeScriptHelper typeScriptHelper)
     : base(cSharpHelper)
 {
     EntityTypeTemplateService       = entityTypeTemplateService;
     EntityTypeTransformationService = entityTypeTransformationService;
     CSharpHelper     = cSharpHelper;
     TypeScriptHelper = typeScriptHelper;
 }
Example #6
0
 /// <summary>
 /// Constructor for the HbsCSharpModelGenerator.
 /// </summary>
 /// <param name="dependencies">Service dependencies parameter class for HbsCSharpModelGenerator.</param>
 /// <param name="handlebarsHelperService">Handlebars helper service.</param>
 /// <param name="dbContextTemplateService">Template service for DbContext generator.</param>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="cSharpDbContextGenerator">DbContext generator.</param>
 /// <param name="cSharpEntityTypeGenerator">Entity type generator.</param>
 public HbsCSharpModelGenerator(ModelCodeGeneratorDependencies dependencies,
                                IHbsHelperService handlebarsHelperService,
                                IDbContextTemplateService dbContextTemplateService,
                                IEntityTypeTemplateService entityTypeTemplateService,
                                IEntityTypeTransformationService entityTypeTransformationService,
                                ICSharpDbContextGenerator cSharpDbContextGenerator,
                                ICSharpEntityTypeGenerator cSharpEntityTypeGenerator) : base(dependencies)
 {
     HandlebarsHelperService         = handlebarsHelperService ?? throw new ArgumentNullException(nameof(handlebarsHelperService));
     DbContextTemplateService        = dbContextTemplateService ?? throw new ArgumentNullException(nameof(dbContextTemplateService));
     EntityTypeTemplateService       = entityTypeTemplateService ?? throw new ArgumentNullException(nameof(entityTypeTemplateService));
     EntityTypeTransformationService = entityTypeTransformationService ?? throw new ArgumentNullException(nameof(entityTypeTransformationService));
     CSharpDbContextGenerator        = cSharpDbContextGenerator ?? throw new ArgumentNullException(nameof(cSharpDbContextGenerator));
     CSharpEntityTypeGenerator       = cSharpEntityTypeGenerator ?? throw new ArgumentNullException(nameof(cSharpEntityTypeGenerator));
 }
Example #7
0
 /// <summary>
 /// Constructor for the Handlebars entity types generator.
 /// </summary>
 /// <param name="annotationCodeGenerator">Annotation code generator.</param>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="cSharpHelper">CSharp helper.</param>
 /// <param name="typeScriptHelper">TypeScript helper.</param>
 /// <param name="options">Handlebars scaffolding options.</param>
 public HbsTypeScriptEntityTypeGenerator(
     [NotNull] IAnnotationCodeGenerator annotationCodeGenerator,
     [NotNull] IEntityTypeTemplateService entityTypeTemplateService,
     [NotNull] IEntityTypeTransformationService entityTypeTransformationService,
     [NotNull] ICSharpHelper cSharpHelper,
     [NotNull] ITypeScriptHelper typeScriptHelper,
     [NotNull] IOptions <HandlebarsScaffoldingOptions> options)
     : base(annotationCodeGenerator, cSharpHelper)
 {
     EntityTypeTemplateService       = entityTypeTemplateService;
     EntityTypeTransformationService = entityTypeTransformationService;
     CSharpHelper     = cSharpHelper;
     TypeScriptHelper = typeScriptHelper;
     _options         = options;
 }
 /// <summary>
 /// Constructor for the Handlebars DbContext generator.
 /// </summary>
 /// <param name="providerConfigurationCodeGenerator">Generator for scaffolding provider.</param>
 /// <param name="annotationCodeGenerator">Annotation code generator.</param>
 /// <param name="cSharpHelper">CSharp helper.</param>
 /// <param name="dbContextTemplateService">Template service for DbContext generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="options">Handlebars scaffolding options.</param>
 public HbsCSharpDbContextGenerator(
     [NotNull] IProviderConfigurationCodeGenerator providerConfigurationCodeGenerator,
     [NotNull] IAnnotationCodeGenerator annotationCodeGenerator,
     [NotNull] IDbContextTemplateService dbContextTemplateService,
     [NotNull] IEntityTypeTransformationService entityTypeTransformationService,
     [NotNull] ICSharpHelper cSharpHelper,
     [NotNull] IOptions <HandlebarsScaffoldingOptions> options)
     : base(providerConfigurationCodeGenerator, annotationCodeGenerator, cSharpHelper)
 {
     ProviderConfigurationCodeGenerator = providerConfigurationCodeGenerator;
     AnnotationCodeGenerator            = annotationCodeGenerator;
     CSharpHelper                    = cSharpHelper;
     DbContextTemplateService        = dbContextTemplateService;
     EntityTypeTransformationService = entityTypeTransformationService;
     _options = options;
 }
Example #9
0
        /// <summary>
        /// Constructor for the Handlebars entity types generator.
        /// </summary>
        /// <param name="annotationCodeGenerator">Annotation code generator.</param>
        /// <param name="cSharpHelper">CSharp helper.</param>
        /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
        /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
        /// <param name="options">Handlebar scaffolding options.</param>
        public HbsCSharpEntityTypeGenerator(
            [NotNull] IAnnotationCodeGenerator annotationCodeGenerator,
            [NotNull] ICSharpHelper cSharpHelper,
            [NotNull] IEntityTypeTemplateService entityTypeTemplateService,
            [NotNull] IEntityTypeTransformationService entityTypeTransformationService,
            [NotNull] IOptions <HandlebarsScaffoldingOptions> options)
            : base(annotationCodeGenerator, cSharpHelper)
        {
            Check.NotNull(annotationCodeGenerator, nameof(annotationCodeGenerator));
            Check.NotNull(cSharpHelper, nameof(cSharpHelper));

            AnnotationCodeGenerator         = annotationCodeGenerator;
            CSharpHelper                    = cSharpHelper;
            EntityTypeTemplateService       = entityTypeTemplateService;
            EntityTypeTransformationService = entityTypeTransformationService;
            _options = options;
        }
 /// <summary>
 /// Constructor for the HbsTypeScriptModelGenerator.
 /// </summary>
 /// <param name="dependencies">Service dependencies parameter class for HbsCSharpModelGenerator.</param>
 /// <param name="cSharpDbContextGenerator">DbContext generator.</param>
 /// <param name="cSharpEntityTypeGenerator">Entity type generator.</param>
 /// <param name="handlebarsHelperService"></param>
 /// <param name="handlebarsBlockHelperService"></param>
 /// <param name="dbContextTemplateService"></param>
 /// <param name="entityTypeTemplateService"></param>
 /// <param name="entityTypeTransformationService"></param>
 public HbsTypeScriptModelGenerator(
     [NotNull] ModelCodeGeneratorDependencies dependencies,
     [NotNull] ICSharpDbContextGenerator cSharpDbContextGenerator,
     [NotNull] ICSharpEntityTypeGenerator cSharpEntityTypeGenerator,
     [NotNull] IHbsHelperService handlebarsHelperService,
     [NotNull] IHbsBlockHelperService handlebarsBlockHelperService,
     [NotNull] IDbContextTemplateService dbContextTemplateService,
     [NotNull] IEntityTypeTemplateService entityTypeTemplateService,
     [NotNull] IEntityTypeTransformationService entityTypeTransformationService)
     : base(dependencies, cSharpDbContextGenerator, cSharpEntityTypeGenerator)
 {
     HandlebarsHelperService         = handlebarsHelperService;
     HandlebarsBlockHelperService    = handlebarsBlockHelperService;
     DbContextTemplateService        = dbContextTemplateService;
     EntityTypeTemplateService       = entityTypeTemplateService;
     EntityTypeTransformationService = entityTypeTransformationService;
 }
Example #11
0
 /// <summary>
 /// Constructor for the HbsCSharpModelGenerator.
 /// </summary>
 /// <param name="dependencies">Service dependencies parameter class for HbsCSharpModelGenerator.</param>
 /// <param name="cSharpDbContextGenerator">DbContext generator.</param>
 /// <param name="cSharpEntityTypeGenerator">Entity type generator.</param>
 /// <param name="handlebarsHelperService">Handlebars helper service.</param>
 /// <param name="handlebarsBlockHelperService">Handlebars block helper service.</param>
 /// <param name="dbContextTemplateService">Template service for DbContext generator.</param>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="options">Handlebar scaffolding options</param>
 public HbsCSharpModelGenerator(
     [NotNull] ModelCodeGeneratorDependencies dependencies,
     [NotNull] ICSharpDbContextGenerator cSharpDbContextGenerator,
     [NotNull] ICSharpEntityTypeGenerator cSharpEntityTypeGenerator,
     [NotNull] IHbsHelperService handlebarsHelperService,
     [NotNull] IHbsBlockHelperService handlebarsBlockHelperService,
     [NotNull] IDbContextTemplateService dbContextTemplateService,
     [NotNull] IEntityTypeTemplateService entityTypeTemplateService,
     [NotNull] IEntityTypeTransformationService entityTypeTransformationService,
     [NotNull] IOptions <HandlebarsScaffoldingOptions> options)
     : base(dependencies, cSharpDbContextGenerator, cSharpEntityTypeGenerator)
 {
     HandlebarsHelperService         = handlebarsHelperService;
     HandlebarsBlockHelperService    = handlebarsBlockHelperService;
     DbContextTemplateService        = dbContextTemplateService;
     EntityTypeTemplateService       = entityTypeTemplateService;
     EntityTypeTransformationService = entityTypeTransformationService;
     _options = options;
 }
 /// <summary>
 /// Constructor for the HbsCSharpModelGenerator.
 /// </summary>
 /// <param name="dependencies">Service dependencies parameter class for HbsCSharpModelGenerator.</param>
 /// <param name="handlebarsHelperService">Handlebars helper service.</param>
 /// <param name="dbContextTemplateService">Template service for DbContext generator.</param>
 /// <param name="entityTypeTemplateService">Template service for the entity types generator.</param>
 /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
 /// <param name="cSharpDbContextGenerator">DbContext generator.</param>
 /// <param name="cSharpEntityTypeGenerator">Entity type generator.</param>
 public HbsCSharpModelGeneratorEnhance(ModelCodeGeneratorDependencies dependencies,
                                       IHbsHelperService handlebarsHelperService,
                                       IDbContextTemplateService dbContextTemplateService,
                                       IEntityTypeTemplateService entityTypeTemplateService,
                                       IEntityTypeConfigurationTemplateService entityTypeConfigurationTemplateService,
                                       IEntityTypeTransformationService entityTypeTransformationService,
                                       ICSharpDbContextGenerator cSharpDbContextGenerator,
                                       ICSharpEntityTypeGenerator cSharpEntityTypeGenerator,
                                       ICSharpEntityTypeConfigurationGenerator cSharpEntityTypeConfigurationGenerator,
                                       HandlebarsScaffoldingOptions handlebarsScaffoldingOptions) : base(dependencies,
                                                                                                         handlebarsHelperService,
                                                                                                         dbContextTemplateService,
                                                                                                         entityTypeTemplateService,
                                                                                                         entityTypeTransformationService,
                                                                                                         cSharpDbContextGenerator,
                                                                                                         cSharpEntityTypeGenerator)
 {
     EntityTypeConfigurationTemplateService = entityTypeConfigurationTemplateService;
     CSharpEntityTypeConfigurationGenerator = cSharpEntityTypeConfigurationGenerator;
     HandlebarsScaffoldingOptions           = handlebarsScaffoldingOptions ?? HandlebarsScaffoldingOptions.Default;
 }
        /// <summary>
        /// Constructor for the Handlebars DbContext generator.
        /// </summary>
        /// <param name="legacyProviderCodeGenerators">Legacy provider code generators.</param>
        /// <param name="providerCodeGenerators">Generator for scaffolding provider.</param>
        /// <param name="annotationCodeGenerator">Annotation code generator.</param>
        /// <param name="dbContextTemplateService">Template service for DbContext generator.</param>
        /// <param name="entityTypeTransformationService">Service for transforming entity definitions.</param>
        /// <param name="cSharpHelper">CSharp helper.</param>
        public HbsCSharpDbContextGenerator(
#pragma warning disable CS0618 // Type or member is obsolete
            IEnumerable <IScaffoldingProviderCodeGenerator> legacyProviderCodeGenerators,
#pragma warning restore CS0618 // Type or member is obsolete
            IEnumerable <IProviderConfigurationCodeGenerator> providerCodeGenerators,
            IAnnotationCodeGenerator annotationCodeGenerator,
            IDbContextTemplateService dbContextTemplateService,
            IEntityTypeTransformationService entityTypeTransformationService,
            ICSharpHelper cSharpHelper)
        {
            if (!legacyProviderCodeGenerators.Any() && !providerCodeGenerators.Any())
            {
                throw new ArgumentException(AbstractionsStrings.CollectionArgumentIsEmpty(nameof(providerCodeGenerators)));
            }

            LegacyProviderCodeGenerator        = legacyProviderCodeGenerators.LastOrDefault();
            ProviderConfigurationCodeGenerator = providerCodeGenerators.LastOrDefault();
            CodeGenerator                   = annotationCodeGenerator ?? throw new ArgumentNullException(nameof(annotationCodeGenerator));
            DbContextTemplateService        = dbContextTemplateService ?? throw new ArgumentNullException(nameof(dbContextTemplateService));
            EntityTypeTransformationService = entityTypeTransformationService ?? throw new ArgumentNullException(nameof(entityTypeTransformationService));
            CSharpHelper = cSharpHelper ?? throw new ArgumentNullException(nameof(cSharpHelper));
        }
Example #14
0
 public static string TransformEntityTypeConfigurationName(this IEntityTypeTransformationService service, string entityName, string mapSuffix)
 {
     return(service.TransformEntityName(entityName) + mapSuffix);
 }