using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using Tango.Core;
namespace Tango.MachineService.Gateway.DB
{
public class GatewayDbContext : DbContext
{
public GatewayDbContext(DataSource dataSource) : base(dataSource.ToConnection(), true)
{
}
public static GatewayDbContext CreateDefault()
{
return new GatewayDbContext(new DataSource()
{
Address = GatewayConfig.DB_ADDRESS,
IntegratedSecurity = false,
Catalog = GatewayConfig.DB_CATALOG,
Type = DataSourceType.SQLServer,
UserName = GatewayConfig.DB_USER_NAME,
Password = GatewayConfig.DB_PASSWORD
});
}
///
/// Gets or sets the environments.
///
public DbSet Environments
{
get; set;
}
}
}