This is a migrated thread and some comments may be shown as answers.

User based recources?

2 Answers 38 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Li Zhou
Top achievements
Rank 1
Li Zhou asked on 06 Jul 2010, 07:29 PM
I am following http://www.telerik.com/help/aspnet-ajax/schedule_databindingimplementingaproviderthatsupportsmultivaluedresources.html to create a custom provider and I have some questions:

I want to create user based resources, i.g. each user can create their own resources, or "tag".  Each appointment can have one or multiple "tags".  User can sort appointment based on the custom "tags".

In the article, it states that
"Implement the GetResourcesByType method to supply the scheduler with a list of possible values given a resource type. This requires a query to the database to obtain the list of values. Once retrieved, the resources are cached. "

Is it possible to cache the resources based on a userID (a guid) ?  Do you provide any interface to override the Cache key?  What is the build-in Cache invalidation machenism?  If one user modifed his custom resources, how to make it not effect other users resourcs?

Thanks!

2 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 14 Jul 2010, 09:44 AM
Hi Li,

Apologies for the late reply.

The provider implementation in the help article caches the resources in lists (_teachers, _students) to improve performance. There's no cache invalidation for the sake of simplicity.

You can turn off the caching to ensure that you're always getting up-to-date information.

private IDictionary<int, Resource> Teachers
{
    get
    {
        var teachers = new Dictionary<int, Resource>();
        foreach (Resource teacher in LoadTeachers())
        {
            _teachers.Add((int)teacher.Key, teacher);
        }
 
        return _teachers;
    }
}

If you intend to implement caching we recommend you to use the standard ASP.NET Cache. It should give you fine grained control over the lifetime of the cached entries.

I hope this helps.

All the best,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Li Zhou
Top achievements
Rank 1
answered on 14 Jul 2010, 02:05 PM
Tsvetomir ,

Thanks for your reply. that helps

Tags
Scheduler
Asked by
Li Zhou
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Li Zhou
Top achievements
Rank 1
Share this question
or