Files
LeafWeb/Core/DAL/LeafWebContext.cs
T
2016-12-06 11:53:30 -05:00

40 lines
1.4 KiB
C#

using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.Entity.SqlServer;
using log4net;
using LeafWeb.Core.Entities;
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<LeafOutputFileContents> LeafOutputFileContents { 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.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType).Debug("OnModelCreating");
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
base.OnModelCreating(modelBuilder);
}
}
public class LeafWebDbConfiguration : DbConfiguration
{
public LeafWebDbConfiguration()
{
SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy());
}
}
}