Exemple #1
0
 public bool TryParticipate(DbEventParticipation p)
 {
     try
     {
         return(Context.Connection.Execute("INSERT INTO fso_event_participation (event_id, user_id) VALUES (@event_id, @user_id)", p) > 0);
     }
     catch
     {
         //already exists, or foreign key fails
         return(false);
     }
 }
Exemple #2
0
 public bool Participated(DbEventParticipation p)
 {
     return(Context.Connection.Query <int>("SELECT count(*) FROM fso_event_participation WHERE event_id = @event_id AND user_id = @user_id", p).First() > 0);
 }