Beispiel #1
0
 protected override void OnModelCreated(ControllerScaffolderModel model)
 {
     base.OnModelCreated(model);
     model.ControllerName         = null;
     model.IsModelClassSupported  = true;
     model.IsDataContextSupported = true;
 }
        protected sealed override ControllerScaffolderModel CreateModel()
        {
            ControllerScaffolderModel model = new ControllerScaffolderModel(Context);

            model.ControllerName = model.GetGeneratedName(MvcProjectUtil.ControllerName, model.CodeFileExtension);
            OnModelCreated(model);
            return(model);
        }
Beispiel #3
0
        protected override void OnModelCreated(ControllerScaffolderModel model)
        {
            base.OnModelCreated(model);
            model.ControllerName = null;

            // Async is always supported because ODataControllerWithActions does not depend on Entity framework.
            model.IsAsyncSupported      = true;
            model.IsModelClassSupported = true;
        }
Beispiel #4
0
        protected override void OnModelCreated(ControllerScaffolderModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            base.OnModelCreated(model);
            model.ControllerName         = null;
            model.IsModelClassSupported  = true;
            model.IsDataContextSupported = true;
        }
        public void RecordControllerTelemetryOptions(CodeGenerationContext context, ControllerScaffolderModel model)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            WebApiControllerScaffolderOptions options = WebApiControllerScaffolderOptions.CreatedController;

            if (model.IsAsyncSelected)
            {
                options |= WebApiControllerScaffolderOptions.IsAsyncSelected;
            }

            context.AddTelemetryData(TelemetrySharedKeys.WebApiControllerScaffolderOptions, (uint)options);
        }
 protected virtual void OnModelCreated(ControllerScaffolderModel model)
 {
     // intentionally empty
 }
 protected override object CreateViewModel(ControllerScaffolderModel model)
 {
     return(new ControllerScaffolderViewModel(model));
 }
Beispiel #8
0
        public void RecordControllerTelemetryOptions(CodeGenerationContext context, ControllerScaffolderModel model)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            WebApiControllerScaffolderOptions options = WebApiControllerScaffolderOptions.CreatedController;

            if (model.IsAsyncSelected)
            {
                options |= WebApiControllerScaffolderOptions.IsAsyncSelected;
            }

            context.AddTelemetryData(TelemetrySharedKeys.WebApiControllerScaffolderOptions, (uint)options);
        }