39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using System.Data.Entity;
|
|
using System.Data.Entity.ModelConfiguration.Conventions;
|
|
using System.Data.Entity.SqlServer;
|
|
using LeafWeb.Core.Entities;
|
|
using NLog;
|
|
|
|
namespace LeafWeb.Core.DAL
|
|
{
|
|
public class LeafWebContext : DbContext
|
|
{
|
|
public DbSet<LeafInput> LeafInputs { get; set; }
|
|
public DbSet<LeafInputFile> LeafInputFiles { get; set; }
|
|
public DbSet<LeafInputStatus> LeafInputStatus { get; set; }
|
|
public DbSet<FluxnetSite> FluxnetSites { get; set; }
|
|
public DbSet<PhotosynthesisType> PhotosynthesisTypes { get; set; }
|
|
public DbSet<LeafOutputFile> LeafOutputFiles { get; set; }
|
|
public DbSet<LeafInputData> LeafInputData { get; set; }
|
|
public DbSet<LeafInputDataCurve> LeafInputDataCurves { get; set; }
|
|
public DbSet<LeafInputDataPhotosynthetic> LeafInputDataPhotosynthetic { get; set; }
|
|
public DbSet<LeafInputDataSite> LeafInputDataSite { get; set; }
|
|
|
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
|
{
|
|
LogManager.GetCurrentClassLogger().Debug("OnModelCreating");
|
|
|
|
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
|
|
base.OnModelCreating(modelBuilder);
|
|
}
|
|
}
|
|
|
|
public class LeafWebDbConfiguration : DbConfiguration
|
|
{
|
|
public LeafWebDbConfiguration()
|
|
{
|
|
SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy());
|
|
}
|
|
}
|
|
}
|