public IList <DbIrtPeptide> GetPeptides() { using (var session = new StatelessSessionWithLock(_sessionFactory.OpenStatelessSession(), _databaseLock, false, CancellationToken.None)) { return(session.CreateCriteria(typeof(DbIrtPeptide)).List <DbIrtPeptide>()); } }
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())); } } }