Git Repository Public Repository

CPE_learningsite

URLs

Copy to Clipboard

This repository has no backups
This repository's network speed is throttled to 100KB/sec

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
28
29
30
31
32
33
34
/*
Developer: Tyler Allen
Date Created: 08/24/2016
---------------------------------------------------
*/

using System.Configuration;

namespace CPE.App.NotifyConsole.Models {
    // ReSharper disable once InconsistentNaming
    public partial class CPEWebDataContext {
        private static CPEWebDataContext _context;

        public static CPEWebDataContext Context() {
            return GetContext();
        }

        public static CPEWebDataContext GetContext() {
            var connectionString = ConfigurationManager.ConnectionStrings["CPE.Data"].ConnectionString;
            return GetContext(connectionString);
        }

        /// <summary>
        ///     Returns the DataContext shared for the current request (or creates one if necessary)
        /// </summary>
        /// <param name="connectionString">The connection string to use.</param>
        public static CPEWebDataContext GetContext(string connectionString) {
            if(_context == null) {
                _context = new CPEWebDataContext(connectionString);
            }
            return _context;
        }
    }
}

Commits for CPE_learningsiteCPE/CPE.App/CPE.App.NotifyConsole/Models/CPEDataContext.cs

Diff revisions: vs.
Revision Author Commited Message
4cd176 ... v.shishlov Fri 27 Aug, 2021 14:33:17 +0000

initial commit