예제 #1
0
 public IList <DbIrtPeptide> GetPeptides()
 {
     using (var session = new StatelessSessionWithLock(_sessionFactory.OpenStatelessSession(), _databaseLock,
                                                       false, CancellationToken.None))
     {
         return(session.CreateCriteria(typeof(DbIrtPeptide)).List <DbIrtPeptide>());
     }
 }
예제 #2
0
파일: IrtDb.cs 프로젝트: rfellers/pwiz
        public string GetDocumentXml()
        {
            using (var session = new StatelessSessionWithLock(_sessionFactory.OpenStatelessSession(), _databaseLock,
                                                              false, CancellationToken.None))
            {
                if (!SqliteOperations.TableExists(session.Connection, @"DocumentXml"))
                {
                    return(null);
                }

                using (var cmd = session.Connection.CreateCommand())
                {
                    cmd.CommandText = @"SELECT Xml FROM DocumentXml";
                    return(Convert.ToString(cmd.ExecuteScalar()));
                }
            }
        }