37 lines
769 B
C#
37 lines
769 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.Entity;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using DAL.Helpers;
|
|
using Domain;
|
|
|
|
namespace DAL
|
|
{
|
|
public class AppDbContext : DbContext
|
|
{
|
|
public AppDbContext() : base(nameOrConnectionString: "name=AppDbConnectionString")
|
|
{
|
|
Database.SetInitializer(new DbInit());
|
|
|
|
|
|
Database.Log = s =>
|
|
{
|
|
if (s.Contains("SELECT"))
|
|
{
|
|
#if DEBUG
|
|
Trace.Write(s);
|
|
#else
|
|
Console.WriteLine(s);
|
|
#endif
|
|
}
|
|
};
|
|
|
|
}
|
|
public DbSet<Person> People { get; set; }
|
|
|
|
}
|
|
}
|