Пример #1
0
 public bool Exists(string quote)
 {
     using (var session = new DocumentStore { Url = ConfigurationManager.AppSettings["RavenUrl"].ToString(), ApiKey = ConfigurationManager.AppSettings["RavenApiKey"].ToString() }.Initialize().OpenSession())
     {
         var sayWhat = (from d in session.Query<SayWhat>() where d.Quote == quote select d).FirstOrDefault();
         return sayWhat != null;
     }
 }
Пример #2
0
 public string FindByEmail(string email)
 {
     using (var session = new DocumentStore { ConnectionStringName = "RavenHQ" }.Initialize().OpenSession())
     {
         var registrationDocument = (from d in session.Query<RegistrationDocument>()
                                     where d.Email == email
                                     select d).FirstOrDefault();
         return registrationDocument == null ? null : registrationDocument.Guid;
     }
 }