aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Web/Tango.Portal/Utils/DbUtils.cs
blob: 521c01f4e75b600698fd1b811a28f66a4a62ce08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using Tango.BL;
using Tango.Core;
using Tango.Portal.Enumerations;

namespace Tango.Portal.Utils
{
    public class DbUtils
    {
        public static ObservablesContext CreateContext(PortalEnvironment environment)
        {
            return new ObservablesContext(new DataSource()
            {
                Type = DataSourceType.SQLServer,
                IntegratedSecurity = false,
                Address = PortalConfig.DB_ADDRESS,
                Catalog = environment != PortalEnvironment.Production ? $"Tango_{environment}" : "Tango",
                UserName = PortalConfig.DB_USER_NAME,
                Password = PortalConfig.DB_PASSWORD
            });
        }
    }
}