Add DbContext, Models
This commit is contained in:
40
Model/DatabaseContext.cs
Normal file
40
Model/DatabaseContext.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @overview Life of German Reallife - DatabaseContext.cs
|
||||
* @author VegaZ
|
||||
* @copyright (c) 2008 - 2018 Life of German
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
|
||||
namespace reallife_gamemode.Model
|
||||
{
|
||||
public partial class DatabaseContext : DbContext
|
||||
{
|
||||
public DatabaseContext(DbContextOptions<DatabaseContext> options) :base (options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DatabaseContext()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
optionsBuilder.UseMySql("Host=localhost;Port=3306;Database=gtav-devdb;Username=gtav-dev;Password=Test123");
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
|
||||
public DbSet<Server.Entities.User> Users { get; set; }
|
||||
public DbSet<Server.Entities.Character> Characters { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user