3 Date Created: 08/24/2016
4 ---------------------------------------------------
7 using System.Configuration;
9 namespace CPE.App.NotifyConsole.Models {
10 // ReSharper disable once InconsistentNaming
11 public partial class CPEWebDataContext {
12 private static CPEWebDataContext _context;
14 public static CPEWebDataContext Context() {
18 public static CPEWebDataContext GetContext() {
19 var connectionString = ConfigurationManager.ConnectionStrings["CPE.Data"].ConnectionString;
20 return GetContext(connectionString);
24 /// Returns the DataContext shared for the current request (or creates one if necessary)
26 /// <param name="connectionString">The connection string to use.</param>
27 public static CPEWebDataContext GetContext(string connectionString) {
28 if(_context == null) {
29 _context = new CPEWebDataContext(connectionString);