Ejemplo n.º 1
0
        //GetEventCategoryByMainCategory
        public EventCategory GetEventCategoryByMainCategory(long maincategory_id, long event_id)
        {
            DataCacheObject dco = new DataCacheObject(DataCacheType.REFERENCE, DataCacheRegions.CATEGORIES, "GETEVENTCATEGORYBYMAINCATEGORY",
                                                      new object[] { maincategory_id, event_id }, CachingExpirationTime.Hours_01);
            EventCategory ec = CacheRepository.Get(dco) as EventCategory;

            if (ec != null)
            {
                return(ec);
            }
            ec = dataContext.spEventCategory_ByMainCategory(event_id, maincategory_id).FirstOrDefault();
            if (ec != null)
            {
                dco.Data = ec;
                CacheRepository.Add(dco);
            }
            return(ec);
        }