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); }
public static IBeastBuilder AddTcpListener(this IBeastBuilder builder, Action <TcpSettings> configureOptions) { builder.Services.Configure(configureOptions); builder.Services.AddSingleton <IListener, TcpListener>(); return(builder); }
public static IBeastBuilder Configure <TOptions>(this IBeastBuilder builder, Action <TOptions> configureOptions) where TOptions : class { builder.Services.Configure(configureOptions); return(builder); }
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"))); }