Exemplo n.º 1
0
 public void Dislike(IPrincipal user, int idQuote)
 {
     var like = new QuoteLike
     {
         UserId = user.Identity.GetUserId(),
         UserName = user.Identity.GetUserName(),
         Quote = idQuote,
     };
     lock (syncSubmit)
     {
         var other = db.QuoteLikes.ToList()
             .FirstOrDefault(x => x.Quote == like.Quote &&
                 x.UserId == like.UserId);
         if (other == null) return;
         db.QuoteLikes.DeleteOnSubmit(other);
     }
     Submit();
 }
Exemplo n.º 2
0
 public void Like(IPrincipal user, int idQuote)
 {
     var like = new QuoteLike
     {
         UserId = user.Identity.GetUserId(),
         UserName = user.Identity.GetUserName(),
         Quote = idQuote,
         UpdateTime = DateTime.Now,
     };
     lock (syncSubmit)
     {
         if (db.QuoteLikes.ToList()
             .Any(x => x.Quote == like.Quote &&
                 x.UserId == like.UserId))
             return;
         db.QuoteLikes.InsertOnSubmit(like);
     }
     Submit();
 }
Exemplo n.º 3
0
 partial void UpdateQuoteLike(QuoteLike instance);
Exemplo n.º 4
0
 partial void DeleteQuoteLike(QuoteLike instance);
Exemplo n.º 5
0
 partial void InsertQuoteLike(QuoteLike instance);