Click here to Skip to main content
15,888,297 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written a code to store the data in the system memory . I have a requirement to filter the data on the basis of the domain that I have specified while I have created the cache other than the key value.

Sample code is as below :-

public TaskDetails GetUpdateXML(int OrgLevelRecID)
        {
            DataTable dtResult = new DataTable();
            TaskDetails lstTaskDetails = new TaskDetails();
            try
            {
                dtSystemTime = DateTime.Now;
                lstTaskDetails = CacheUtil.Get<taskdetails>(OrgLevelRecID, "InstanceID");
                if (lstTaskDetails == null)
                {
                    lstTaskDetails = new TaskDetails();
                    dtResult = FeederClass.GetUpdateXML(OrgLevelRecID);
                    foreach (DataRow reader in dtResult.Rows)
                    {
                        lstTaskDetails.JobType = reader["typeOfJob"].ToString();
                        lstTaskDetails.JobDetails = reader["jobdetails"].ToString();
                    }
                    CacheUtil.SetSliding(OrgLevelRecID, lstTaskDetails, 5, "InstanceID");
                }             
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return lstTaskDetails;
        }


Here : "InstanceID" is the domain for the cache to classify and store the items. Need to get the Data back when I use this Domain as a filer. Any Help ??
Posted
Updated 23-Feb-14 19:43pm
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900