PIAPS_CW/DatabaseImplement/Database.cs

25 lines
677 B
C#
Raw Normal View History

2024-06-04 21:16:50 +04:00
using DatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement
{
public class Database : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
2024-06-05 13:39:08 +04:00
optionsBuilder.UseNpgsql("Server=192.168.191.42:32768;Database=gun_market;Username=postgres;Password=7355608;");
2024-06-04 21:16:50 +04:00
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Role> Roles { get; set; } = null!;
public virtual DbSet<User> Users { get; set; } = null!;
}
}