public static TecnoBlogDataContext GetContext()
        {
            TecnoBlogDataContext database = null;

            ConnectionStringSettings   settings = ConfigurationManager.ConnectionStrings["TECNOBLOGConnectionString"];
            SqlConnectionStringBuilder builder;

            if (null != settings)
            {
                string connection = settings.ConnectionString;
                builder  = new SqlConnectionStringBuilder(connection);
                database = new TecnoBlogDataContext(builder.ConnectionString);
            } // IF ENDS

            return(database);
        } // GET CONTEXT ENDS
Beispiel #2
0
 public TagQueryService()
 {
     this.database = DataContextFactory.GetContext();
 }
Beispiel #3
0
 public ImageService()
 {
     this.database = DataContextFactory.GetContext();
 }
Beispiel #4
0
 public ArticleTagService()
 {
     this.database = DataContextFactory.GetContext();
 }
Beispiel #5
0
 public ArticleCommentService()
 {
     this.database = DataContextFactory.GetContext();
 } // CONSTRUCTOR ENDS ------------------------------------------------- //
Beispiel #6
0
 public CommentService()
 {
     this.database = DataContextFactory.GetContext();
 } // ------------------------------------------------------------------ //