• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Method Init

Init(IDictionary<String, String>, String)

Perform tasks like allocating resources or acquiring connections etc.

Declaration
void Init(IDictionary<string, string> parameters, string cacheName)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.String> parameters

Startup parameters defined in the configuration. Through these parameters, user can specify runtime parameters to the deployed provider like connection string etc.

System.String cacheName

Cache name for which loader is called.

Examples

Following example takes parameters as input and assigns values against them.

public void Init(IDictionary <string, string> parameters, string cacheName)
{
    cache = CacheManager.GetCache(cacheName);
    connectionString = parameters.ContainsKey("ConnectionString") ? parameters["ConnectionString"] : null;
    if (connectionString != null)
    {
        connection = new SqlConnection(connectionString);
    }
}
Back to top Copyright © 2017 Alachisoft