public EmbeddedDocumentStore(string name) { try { Conventions = new DocumentConvention { DocumentKeyGenerator = entity => { var typeTagName = Conventions.GetTypeTagName(entity.GetType()); if (typeTagName == null) return Guid.NewGuid().ToString(); return typeTagName + "/" + Guid.NewGuid(); } }; persistentSource = new IsolatedStoragePersistentSource(name, "ravenlight"); storage = new TableStorage(persistentSource); } catch { Dispose(); throw; } }
/// <summary> /// Generates the document key using identity. /// </summary> /// <param name="conventions">The conventions.</param> /// <param name="entity">The entity.</param> /// <returns></returns> public static string GenerateDocumentKeyUsingIdentity(DocumentConvention conventions, object entity) { return(conventions.FindTypeTagName(entity.GetType()).ToLower() + "/"); }
/// <summary> /// Generates the document key using identity. /// </summary> /// <param name="conventions">The conventions.</param> /// <param name="entity">The entity.</param> /// <returns></returns> public static string GenerateDocumentKeyUsingIdentity(DocumentConvention conventions, object entity) { return conventions.FindTypeTagName(entity.GetType()).ToLower() + "/"; }