Skip to content

Instantly share code, notes, and snippets.

View asapostolov's full-sized avatar

Apostol Apostolov asapostolov

  • bilidpm.com/en
  • Plovdiv, Bulgaria
View GitHub Profile
@asapostolov
asapostolov / Raven Conflicts
Created January 30, 2014 10:14
RavenDB index for getting all the conflicted documents from a database.
from doc in docs
where doc["@metadata"]["Raven-Replication-Conflict"]
select new { Id = doc.__document_id }
# Auto detect text files and perform LF normalization
* text=auto
# These files are text and should be normalized (convert crlf => lf)
*.cs text diff=csharp
*.java text diff=java
*.html text diff=html
*.js text
*.cshtml text
@asapostolov
asapostolov / Raven-DB-Document-Manager.cs
Created March 3, 2012 16:05
Initalizes and manages RavenDB Document Store and Session. Initalize() method must be called in Application_Start event to initialize the store and optionally - SessionSaveAndClose() on Application_PostRequestHandlerExecute to save the changes.
public class DocumentManager
{
public static readonly string SessionKey = "current.session";
public static IDocumentStore CurrentDocumentStore { get; private set; }
public static IDocumentSession CurrentSession
{
get