Пример #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services
            .AddDevExpressControls()
            .AddControllersWithViews();

            services.AddScoped <DashboardConfigurator>((IServiceProvider serviceProvider) => {
                DashboardConfigurator configurator = new DashboardConfigurator();

                configurator.SetConnectionStringsProvider(new DashboardConnectionStringsProvider(Configuration));

                var dataBaseDashboardStorage = new DataBaseEditaleDashboardStorage(
                    Configuration.GetConnectionString("DashboardStorageConnection"));

                configurator.SetDashboardStorage(dataBaseDashboardStorage);

                DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
                DashboardObjectDataSource objDataSource     = new DashboardObjectDataSource("Object Data Source", typeof(SalesPersonData));

                objDataSource.DataMember = "GetSalesData";

                dataSourceStorage.RegisterDataSource("objectDataSource", objDataSource.SaveToXml());

                configurator.SetDataSourceStorage(dataSourceStorage);

                return(configurator);
            });
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services
            .AddMvc()
            .AddDefaultDashboardController((configurator, serviceProvider) => {
                configurator.SetConnectionStringsProvider(new DashboardConnectionStringsProvider(Configuration));

                DataBaseEditaleDashboardStorage dataBaseDashboardStorage = new DataBaseEditaleDashboardStorage(Configuration.GetConnectionString("DashboardStorageConnection"));
                configurator.SetDashboardStorage(dataBaseDashboardStorage);
            });
            services.AddDevExpressControls(settings => settings.Resources = ResourcesType.ThirdParty | ResourcesType.DevExtreme);
        }