using System; using System.Collections.Generic; using System.Linq; using System.Web; using Tango.BL; using Tango.Core; using Tango.TCC.BL.Entities; using Tango.Web; using Tango.Web.Helpers; namespace Tango.TCC.Service.DB { public class TccDbContext { public static ObservablesContext CreateTango() { return ObservablesWebContext.CreateContext(TCCServiceConfig.TANGO_DB_CATALOG); } public static TCCContext CreateTCC() { //if (System.Diagnostics.Debugger.IsAttached) //{ // return new TCCContext(new Core.DataSource() // { // Address = "localhost\\SQLEXPRESS", // Catalog = "TCC", // IntegratedSecurity = true, // Type = DataSourceType.SQLServer, // }); //} //else //{ return new TCCContext(new Core.DataSource() { Address = WebConfig.DB_ADDRESS, Catalog = WebConfig.DB_CATALOG, IntegratedSecurity = false, Type = DataSourceType.SQLServer, UserName = WebConfig.DB_USER_NAME, Password = WebConfig.DB_PASSWORD }); //} } } }