public static IBeastBuilder AddSqlite(this IBeastBuilder builder, Action <DbContextOptionsBuilder> optionsAction)
        {
            builder.Services.AddDbContext <SqliteContext>(optionsAction);
            builder.Services.AddTransient <IUserRepository, UserRepository>();
            builder.Services.AddTransient <IObjectRepository, ObjectRepository>();

            return(builder);
        }
示例#2
0
        public static IBeastBuilder AddTcpListener(this IBeastBuilder builder, Action <TcpSettings> configureOptions)
        {
            builder.Services.Configure(configureOptions);

            builder.Services.AddSingleton <IListener, TcpListener>();

            return(builder);
        }
示例#3
0
 public static IBeastBuilder Configure <TOptions>(this IBeastBuilder builder, Action <TOptions> configureOptions)
     where TOptions : class
 {
     builder.Services.Configure(configureOptions);
     return(builder);
 }
示例#4
0
 public static IBeastBuilder UseWorld <TWorld>(this IBeastBuilder builder)
     where TWorld : class, IWorld
 {
     builder.Services.AddSingleton <IWorld, TWorld>();
     return(builder);
 }
 public static IBeastBuilder AddSqlite(this IBeastBuilder builder)
 {
     return(builder.AddSqlite(options => options.UseSqlite("Data Source=beastmud.db")));
 }