public POCO.Session UpdateSession(int sessionId, Enums.SessionStatus status) { using (var conn = new SqlConnection(connString)) { return(conn.QueryFirstOrDefault <POCO.Session>(sql_AvlRepository.sql_UpdateSession, new { SessionId = sessionId, Status = status, ModifiedBy = this.ServiceName, })); } }
public IEnumerable <POCO.Session> GetSessionsByStatus(Enums.SessionStatus sessionStatus) { using (var conn = new SqlConnection(connString)) { return(conn.Query <POCO.Session>(@"select s.*, sa.Roles, sa.TimeZone from Sessions s (nolock) inner join ServiceAccounts sa (nolock) on s.ServiceAccountId = sa.Id where s.Status = @Status", new { Status = sessionStatus })); } }