示例#1
0
        /// <summary>
        /// Combines info from the user to the feedback so can display nicely in a list view
        /// </summary>
        protected override Feedback MapLinqTypeToOOType(LinqToSql_Feedback o)
        {
            Feedback o2 = new Feedback();

            MapValues(o2, o.GetProperyNameAndValues());

            ClimberProfile cp = new ClimberProfileDA(ctx).GetByID(o.UserID);

            o2.FeedbackName             = cp.FullName;
            o2.FeedbackProfileImageFile = cp.ProfilePictureFile;

            return(o2);
        }
示例#2
0
        public static ClimberProfile GetClimberFromCache(Guid id)
        {
            string         key          = "climber-" + id.ToString();
            ClimberProfile cachedObject = (ClimberProfile)cache.Get(key);

            if (cachedObject == null)
            {
                //read the object from the db
                ClimberProfileDA da = new ClimberProfileDA();
                cachedObject = da.GetByID(id);
                cache.Insert(key, cachedObject, null, Cache.NoAbsoluteExpiration, _20_Min_Span_ForClimberInCahce, CacheItemPriority.NotRemovable, null);
            }
            return(cachedObject);
        }