This commit is contained in:
2026-07-20 18:41:53 +10:00
commit 95f3858755
6 changed files with 75 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace helloapp;
public partial class HelloappContext : DbContext
{
public HelloappContext()
{
}
public HelloappContext(DbContextOptions<HelloappContext> options)
: base(options)
{
}
public virtual DbSet<User> Users { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
=> optionsBuilder.UseSqlite("Data Source=./helloapp.db");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}