다음을 통해 공유


AggregateCacheDependency 생성자

정의

AggregateCacheDependency 클래스의 새 인스턴스를 초기화합니다.

public:
 AggregateCacheDependency();
public AggregateCacheDependency ();
Public Sub New ()

예제

다음 코드 예제에서는 인수를 사용하지 않는 생성자를 사용하여 클래스의 AggregateCacheDependency 인스턴스를 만듭니다. 두 CacheDependency 개체가 만들어지고 배열myDepArrayCacheDependency 추가됩니다. 이 생성자는 메서드 CacheDependency 와 함께 Add 두 개체에 종속된 항목에 Cache 저장된 항목을 만드는 데 사용됩니다.

         ' Create two CacheDependency objects, one to a
         ' text file and the other to an XML file. 
         ' Create a CacheDependency array with these 
         ' two objects as items in the array.
          txtDep = New CacheDependency(Server.MapPath("Storage.txt"))
          xmlDep = New CacheDependency(Server.MapPath("authors.xml"))
          Dim DepArray() As CacheDependency = {txtDep, xmlDep}

          ' Create an AggregateCacheDependency object and 
          ' use the Add method to add the array to it.   
          aggDep = New AggregateCacheDependency()
          aggDep.Add(DepArray)

          ' Call the GetUniqueId method to generate
          ' an ID for each dependency in the array.
          msg1.Text = aggDep.GetUniqueId()
          
          ' Add the new data set to the cache with 
          ' dependencies on both files in the array.
          Cache.Insert("XMLDataSet", Source, aggDep)

설명

클래스에 대한 매개 변수가 없는 생성자입니다 AggregateCacheDependency .

적용 대상