public SeedController(
     ISeedManager <User> userManager,
     ISeedManager <Room> roomManager)
 {
     _userManager = userManager;
     _roomManager = roomManager;
 }
 public IotaFhirRepository(
     IIotaRepository repository,
     IFhirTryteSerializer serializer,
     IResourceTracker resourceTracker,
     ISeedManager seedManager)
 {
     this.Serializer          = serializer;
     this.ResourceTracker     = resourceTracker;
     this.SeedManager         = seedManager;
     this.ChannelFactory      = new MamChannelFactory(CurlMamFactory.Default, CurlMerkleTreeFactory.Default, repository);
     this.SubscriptionFactory = new MamChannelSubscriptionFactory(repository, CurlMamParser.Default, CurlMask.Default);
 }
Beispiel #3
0
        public void Configure(
            IApplicationBuilder app,
            IDatabaseManager databaseManager,
            ISeedManager seedManager,
            ILoggerFactory loggerFactory,
            IRethinkDbManager rethinkDbManager,
            ISocketOptions socketOptions,
            ISocketMiddleware socketMiddleware)
        {
            if (Env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
                {
                    HotModuleReplacement = true
                });

                app.UseCors("CorsPolicy");
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            loggerFactory.AddFile("Logs/logs-{Date}.txt", LogLevel.Error);

            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseWebSockets(socketOptions.GetOptions());
            app.Use(async(context, next) => await socketMiddleware.Invoke(context, next));

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");

                routes.MapSpaFallbackRoute(
                    name: "spa-fallback",
                    defaults: new { controller = "Home", action = "Index" });
            });

            rethinkDbManager.EnsureDatabaseCreated();
            databaseManager.EnsureDatabaseCreated();

            seedManager.Seed();

            app.UseMvcWithDefaultRoute();
        }
Beispiel #4
0
 public IotaController(ResourceImporter resourceImporter, ISeedManager seedManager)
 {
     this.ResourceImporter = resourceImporter;
     this.SeedManager      = seedManager;
 }
Beispiel #5
0
 public SeedController(ISeedManager manager)
 {
     this.manager = manager;
 }
Beispiel #6
0
        static void Main(string[] args)
        {
            ApplicationSettings.ConnectionString =
                "Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=12345";
            SspBootstrapper sspBootstrapper = new SspBootstrapper();

            sspBootstrapper.Start();

            ITableCreator tableCreator = DependencyService.GetService <ITableCreator>();

            tableCreator.CreateAllTable <EntityBase>();

            ISeedManager seedManager = DependencyService.GetService <ISeedManager>();

            seedManager.SeedType = SeedType.Dev;
            seedManager.ExecuteAll();

//            IRepository<SampleEntity> sRepository = DependencyService.GetService<IRepository<SampleEntity>>();
//
//            var sample = new SampleEntity();
//            sample.Emrah = "emrah1";
//            sample.IsDeleted = true;
//            sRepository.Create(sample);
//
//            var samle = new SampleEntity();
//            samle.Emrah = "emrah2";
//            samle.IsDeleted = false;
//            sRepository.Create(samle);
//
//            var list = sRepository.Query().ToList();

            //dynamic repository = DependencyService.GetService(typeof(IRepository));

            string temp = "";

            //IMembershipManager membershipManager = DependencyService.GetService<IMembershipManager>();


            //ISeedManager seedManager = DependencyService.GetService<ISeedManager>();
            //seedManager.SeedType = SeedType.Dev;
            //seedManager.ExecuteAll();

            ////RelationalDatabaseCreator databaseCreator =
            ////    (RelationalDatabaseCreator)_context.Database.GetService<IDatabaseCreator>();
            ////  databaseCreator.CreateTables();

            ////DbContextFactory<NebulaNpgEntityContext>.Instance.CurrentContext.Database.Migrate();
            ////string script = DbContextFactory<NebulaNpgEntityContext>.Instance.CurrentContext.Database.GenerateCreateScript();

            //var role = new Role();
            //role.Key = "UserManagement";

            //UserGroup userGroup = new UserGroup();
            //userGroup.Name = "Administrator";

            //Company company = new Company();
            //company.Name = "Medyanet";



            //IMembershipManager membershipManager = DependencyService.GetService<IMembershipManager>();

            //var users = membershipManager.UserQuery().Include(v => v.UserGroup).Include(v => v.Company).Include(v => v.Manager).ToList();
            //string str = "";
            //membershipManager.CreateRole(role);

            //UserGroupRole ugr = new UserGroupRole();
            //ICollection<UserGroupRole> ugrlist = new List<UserGroupRole>();
            //ugrlist.Add(ugr);
            //ugr.RoleId = role.Id;
            //userGroup.UserGroupRoles = ugrlist;
            //membershipManager.CreateUserGroup(userGroup);
            //membershipManager.CreateCompany(company);


            //var user = new Users()
            //{
            //    Email = "*****@*****.**",
            //    Name = "Fatih",
            //    Lastname = "Mert",
            //    Password = "******",
            //    UserGroupId = userGroup.Id,
            //    Username = "******",
            //    CompanyId = company.Id
            //};

            //membershipManager.CreateUser(user);

            //var users = membershipManager.GetAllUsers().Include(v => v.UserGroup).Include(v => v.Company).Include(v => v.Manager).ToList();



            ////var logss = sampleBusiness.Sample("abc");

            ////var logs2 = sampleBusiness.Sample("abc");

            ////var logs3 = sampleBusiness.Sample("abcd");

            ////var logs4 = sampleBusiness.Sample("abc");

            //LogEntity logEntity = new LogEntity()
            //{
            //    JsonMessage = "mesage",
            //    LogType = "error",
            //    Message = "error message",
            //    CreateDate = DateTime.Now,
            //    UpdateDate = DateTime.Now
            //};



            //Console.ReadKey();
        }
        public ResourceImporter(ISearchRepository searchRepository, IFhirRepository fhirRepository, ISeedManager seedManager)
        {
            this.SearchRepository = searchRepository;
            this.FhirRepository   = fhirRepository;
            this.SeedManager      = seedManager;

            DeterministicSeedManager.SubscriptionAdded += this.SubscriptionAddedInManager;
        }