public bool DeleteUser(GroupUserIdModel model) { try { var groupUser = _db.GroupUsers.First(x => x.GroupId == model.GroupId && x.UserId == model.UserId); _db.GroupUsers.Remove(groupUser); _db.SaveChanges(); return(true); } catch (Exception ex) { JavaScriptSerializer js = new JavaScriptSerializer(); string json = js.Serialize(model); Log.Error("Group - DeleteUser- " + json, ex); throw; } }
public bool UpdateLastSeen(GroupUserIdModel model) { try { var groupUser = _db.GroupUsers.First(x => x.GroupId == model.GroupId && x.UserId == model.UserId); groupUser.LastSeenOn = UnixTimeBaseClass.UnixTimeNow; _db.Entry(groupUser).State = EntityState.Modified; _db.SaveChanges(); return(true); } catch (Exception ex) { JavaScriptSerializer js = new JavaScriptSerializer(); string json = js.Serialize(model); Log.Error("Group - UpdateLastSeen - " + json, ex); throw; } }
public long GetLastSeen(GroupUserIdModel model) { return(_db.GroupUsers.First(x => x.GroupId == model.GroupId && x.UserId == model.UserId).LastSeenOn); }
public bool DeleteUser(GroupUserIdModel model) { return(_groupUser.DeleteUser(model)); }
public bool UpdateLastSeen(GroupUserIdModel model) { return(_groupUser.UpdateLastSeen(model)); }