using Microsoft.EntityFrameworkCore;
using Strela.Models;

namespace Strela.Services
{
    public class SQLiteService: DbContext
    {
        public SQLiteService() => Database.EnsureCreated();
        public virtual DbSet<User> Users { get; set; }
        public virtual DbSet<DeviceItem> Devices { get; set; }
        public virtual DbSet<DeviceType> DeviceTypes { get; set; }
        public virtual DbSet<ObjectItem> ObjectItems { get; set; }


        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseNpgsql("Host=172.22.10.39;Port=5432;Database=strela;Username=postgres;Password=4NUDZhJ7");
            //optionsBuilder.UseSqlite("Data Source=Services/DataBase.db");
        }

        //protected override void OnModelCreating(ModelBuilder modelBuilder)
        //{
        //    OnModelCreatingPartial(modelBuilder);
        //}

        //partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}

