public override Rating Update(Rating obj)
        {
            using (var conn = _sqlLite.GetConnection())
            {
                var a = conn.Find<Rating>(obj.RatingID);
                a.UpdateModel(obj);
                conn.Update(a);

                return a;
            }
        }
        public override Rating Insert(Rating obj)
        {
            obj.DateCreated = DateTime.UtcNow;
            obj.RatingID = Guid.NewGuid().ToString();

            using (var conn = _sqlLite.GetConnection())
            {
                conn.Insert(obj);
            }

            return obj;
        }
예제 #3
0
        public void AddRiffRating(string riffId, string userId, float value)
        {
            var r = new RiffSharer.Models.Rating();

            r.RiffID = riffId;
            r.UserID = userId;
            r.Value = value;

            _rar.Insert(r);
        }
예제 #4
0
 public void UpdateModel(Rating r)
 {
     UserID = r.UserID;
     RiffID = r.RiffID;
     Value = r.Value;
 }