Skip to content

Commit ead50e1

Browse files
committed
chore: Add SQLite database context and configuration
1 parent e4d6e3a commit ead50e1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Microsoft.EntityFrameworkCore;
2+
3+
namespace TelegramBot.ConsoleTest.Database
4+
{
5+
public class AppDbContext : DbContext
6+
{
7+
8+
}
9+
}

Sources/TelegramBot.ConsoleTest/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using TelegramBot.Builders;
1+
using Microsoft.EntityFrameworkCore;
2+
using Microsoft.Extensions.DependencyInjection;
3+
using TelegramBot.Builders;
4+
using TelegramBot.ConsoleTest.Database;
25

36
namespace TelegramBot.ConsoleTest
47
{
@@ -9,6 +12,7 @@ static void Main(string[] args)
912
BotBuilder builder = new BotBuilder(args)
1013
.UseApiKey(x => x.FromConfiguration());
1114

15+
builder.Services.AddDbContext<AppDbContext>(x => x.UseSqlite("Data Source=app.db"));
1216
var app = builder.Build();
1317
app.MapControllers();
1418
app.Run();

0 commit comments

Comments
 (0)