public void RemoveFromLoggedInUsers(LoggedInUser user) { db.LoggedInUsers.DeleteOnSubmit(user); }
partial void DeleteLoggedInUser(LoggedInUser instance);
partial void UpdateLoggedInUser(LoggedInUser instance);
partial void InsertLoggedInUser(LoggedInUser instance);
private void detach_LoggedInUsers(LoggedInUser entity) { this.SendPropertyChanging(); entity.ChatRoom = null; }
public ActionResult Join(int id) { ChatRoom room = roomRepository.GetChatRoom(id); if (room == null) return RedirectToAction("NotFound", "ChatRooms"); try { LoggedInUser user = new LoggedInUser(); user.UserName = User.Identity.Name; user.LastMessageTimeStamp = DateTime.Now; user.LoginTimeStamp = DateTime.Now; room.LoggedInUsers.Add(user); roomRepository.Save(); AddMessage(id, User.Identity.Name, " has joined the chat"); } catch { RedirectToAction("Error", "ChatRooms"); } return RedirectToAction("Room", "ChatRooms", new { id = room.ChatRoomID }); }