2010-03-18 12 views
0

ici est un code:LinqToSQL _conn? LinqToSQLConnection?

using System; 
using Nemerle.Collections; 
using Nemerle.Text; 
//using Nemerle.Utility; 
using System.Linq; 
using Nemerle.Data.Linq; 
using NUnit.Framework; 
using System.Data.Linq; 

namespace LinqTestes 
{ 
    [TestFixture] 
    public class Linq2SqlTests 
    { 
    static ReadConnectionString() : string 
    { 
     def currAssm = Uri(typeof(Linq2SqlTests).Assembly.CodeBase).LocalPath; 
     def path = IO.Path.GetDirectoryName(currAssm); 
     def connStrPath = IO.Path.Combine(path, "connectionString.txt"); 
     def connStr = 
     try { IO.File.ReadAllText(connStrPath, Text.Encoding.UTF8) } 
     catch { | e is IO.FileNotFoundException => 
        throw IO.FileNotFoundException(
        $"You should define connection string to NorthWind DB in: '$connStrPath'", 
        e.FileName, e) }; 

     connStr 
    } 

    _conn  : LinqDataConnection = LinqDataConnection(ReadConnectionString()); 

et je fais la même chose, mais ce qui est le type de LinqDataConnection? et d'où vient-il?

Répondre

1

LinqDataConnection est un type spécifique au projet nemerle qu'ils ont créé. Vous pouvez voir comment cela fonctionne ici:

Nemerle SVN (Note: le site semble avoir des problèmes de passerelle pour le moment)

+0

http://nemerle.rsdn.ru/Main_Page vous sont les bienvenus:/Je peux même voir ce fichier dans mon svn. C'est DataContext. Je vous remercie – Cynede