Creates a new DataConnection instance inheriting the PublicationScope and locale set on the call stack. When outside an existing scope this default to PublicationScope,Published and the default language on the website. You should use this constructure unless you need to force data to come from an alternative scope. DataConnection can be used to access the C1 CMS storage.

Namespace: Composite.Data
Assembly: Composite (in Composite.dll) Version: 6.1.6325.31818

Syntax

C#
public DataConnection()
Visual Basic
Public Sub New
Visual C++
public:
DataConnection()

Examples

Here is an example of how to use it
CopyC#
using (DataConnection connection = new DataConnection())
{
   var q = 
      from d in connection.Get<IMyDataType>()
      where d.Name == "Foo"
      select d;
}

See Also