Esempio n. 1
0
        public OrganizationsUtility()
        {
            OnUpdateRole += (s, e) =>
            {
                IOrganizationUser user = e.Data;

                var key = GetKeyEmployee(user.OrganizationId);
                Cache.Clear(key);
            };

            OnAddEmployee += (s, e) =>
            {
                IOrganizationUser user = e.Data;

                var key = GetKeyEmployee(user.OrganizationId);
                Cache.Clear(key);
            };

            OnEmployeeRemove += (s, e) =>
            {
                IOrganizationUser user = e.Data;

                var key = GetKeyEmployee(user.OrganizationId);
                Cache.Clear(key);

                key = Cache.GetKeys(CacheKey.User, user.UserId);
                Cache.Clear(key);
            };

            OnDelete.Add((s, e) =>
            {
                int organizationId = e.Data;
                var key            = Cache.GetKeys(CacheKey.Organization, organizationId);
                Cache.Clear(key);
            });
        }