示例#1
0
        /// <summary>
        /// Removes a rating of the given type.
        /// </summary>
        /// <param name="type">The rating type</param>
        /// <param name="modelId">The unique model type</param>
        /// <param name="userId">The user if</param>
        public void RemoveRating(Models.RatingType type, Guid modelId, string userId)
        {
            var rating = session.Get <Models.Rating>(where : r => r.Type == type && r.ModelId == modelId && r.UserId == userId).SingleOrDefault();

            if (rating != null)
            {
                session.Remove <Models.Rating>(rating);
            }
        }
示例#2
0
 /// <summary>
 /// Removes the given model from the current session.
 /// </summary>
 /// <param name="model">The model</param>
 public virtual void Remove(T model)
 {
     session.Remove <T>(model);
 }