private void GetSession() { using (JolTudomEEntities ent = new JolTudomEEntities()) { _Session = ent.Sessions.FirstOrDefault(s => s.Token == _Token); if (_Session != null) { ent.Sessions.Detach(_Session); } else { throw new SessionNotAvailable(); } } }
/// <summary> /// Deprecated Method for adding a new object to the Sessions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSessions(Session session) { base.AddObject("Sessions", session); }
/// <summary> /// Create a new Session object. /// </summary> /// <param name="token">Initial value of the Token property.</param> /// <param name="lastAction">Initial value of the LastAction property.</param> /// <param name="personID">Initial value of the PersonID property.</param> /// <param name="roleID">Initial value of the RoleID property.</param> public static Session CreateSession(global::System.String token, global::System.DateTime lastAction, global::System.Int32 personID, global::System.Int32 roleID) { Session session = new Session(); session.Token = token; session.LastAction = lastAction; session.PersonID = personID; session.RoleID = roleID; return session; }