diff --git a/.gitignore b/.gitignore index 1f4e0d0..37adc9f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ _ReSharper.* *.ReSharper.user *.suo *.userprefs +RavenDB/ diff --git a/lib/AutoMapper.dll b/lib/AutoMapper.dll new file mode 100644 index 0000000..a852b82 Binary files /dev/null and b/lib/AutoMapper.dll differ diff --git a/lib/Esent.Interop.dll b/lib/Esent.Interop.dll new file mode 100644 index 0000000..477895c Binary files /dev/null and b/lib/Esent.Interop.dll differ diff --git a/lib/ICSharpCode.NRefactory.dll b/lib/ICSharpCode.NRefactory.dll new file mode 100644 index 0000000..1c97b85 Binary files /dev/null and b/lib/ICSharpCode.NRefactory.dll differ diff --git a/lib/Lucene.Net.dll b/lib/Lucene.Net.dll new file mode 100644 index 0000000..ca1f241 Binary files /dev/null and b/lib/Lucene.Net.dll differ diff --git a/lib/Newtonsoft.Json.dll b/lib/Newtonsoft.Json.dll new file mode 100644 index 0000000..4703b89 Binary files /dev/null and b/lib/Newtonsoft.Json.dll differ diff --git a/lib/Raven.Abstractions.dll b/lib/Raven.Abstractions.dll new file mode 100644 index 0000000..be3e22c Binary files /dev/null and b/lib/Raven.Abstractions.dll differ diff --git a/lib/Raven.Client.Embedded.dll b/lib/Raven.Client.Embedded.dll new file mode 100644 index 0000000..5a9498e Binary files /dev/null and b/lib/Raven.Client.Embedded.dll differ diff --git a/lib/Raven.Client.Embedded.xml b/lib/Raven.Client.Embedded.xml new file mode 100644 index 0000000..7a330ba --- /dev/null +++ b/lib/Raven.Client.Embedded.xml @@ -0,0 +1,302 @@ + + + + Raven.Client.Embedded + + + + + Manages access to RavenDB and open sessions to work with RavenDB. + Also supports hosting RavenDB in an embedded mode + + + + + Parse the connection string option + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Initialize the document store access method to RavenDB + + + + + Gets or sets the identifier for this store. + + The identifier. + + + + Get or set the configuration instance for embedded RavenDB + + + + + Run RavenDB in an embedded mode, using in memory only storage. + This is useful for unit tests, since it is very fast. + + + + + Run RavenDB in embedded mode, using the specified directory for data storage + + The data directory. + + + + Access the embedded instance of RavenDB + + + + + Whatever we should also host an HTTP endpoint for the document database + + + + + Expose the set of operations by the RavenDB server + + + + + Create a new instance + + + + + Gets the document for the specified key. + + The key. + + + + + Puts the document with the specified key in the database + + The key. + The etag. + The document. + The metadata. + + + + + Deletes the document with the specified key. + + The key. + The etag. + + + + Puts the attachment with the specified key + + The key. + The etag. + The data. + The metadata. + + + + Gets the attachment by the specified key + + The key. + + + + + Deletes the attachment with the specified key + + The key. + The etag. + + + + Gets the index names from the server + + Paging start + Size of the page. + + + + + Resets the specified index + + The name. + + + + Gets the index definition for the specified name + + The name. + + + + Puts the index definition for the specified name + + The name. + The index def. + + + + Puts the index for the specified name + + The name. + The index def. + if set to true [overwrite]. + + + + Puts the index definition for the specified name + + The type of the document. + The type of the reduce result. + The name. + The index def. + + + + + Puts the index for the specified name + + The type of the document. + The type of the reduce result. + The name. + The index def. + if set to true [overwrite]. + + + + Queries the specified index. + + The index. + The query. + The includes are ignored for this implementation. + + + + Deletes the index. + + The name. + + + + Gets the results for the specified ids. + + The ids. + The includes. + + + + + Executed the specified commands as a single batch + + The command data. + + + + Commits the specified tx id. + + The tx id. + + + + Rollbacks the specified tx id. + + The tx id. + + + + Promotes the transaction. + + From tx id. + + + + + Stores the recovery information. + + The resource manager Id for this transaction + The tx id. + The recovery information. + + + + Returns a new using the specified credentials + + The credentials for session. + + + + + Perform a set based deletes using the specified index. + + Name of the index. + The query to delete. + if set to true [allow stale]. + + + + Perform a set based update using the specified index. + + Name of the index. + The query to update. + The patch requests. + if set to true [allow stale]. + + + + Create a new instance of that will interacts + with the specified database + + + + + Returns a list of suggestions based on the specified suggestion query. + + The index to query for suggestions + The suggestion query. + + + + Spin the background worker for indexing + + + + + Access the database statistics + + + + + Provide direct access to the database transactional storage + + + + + Provide direct access to the database index definition storage + + + + + Provide direct access to the database index storage + + + + + Gets or sets the operations headers. + + The operations headers. + + + + It seems that we can't promote a transaction inside the same process + + + + diff --git a/lib/Raven.Client.Lightweight.dll b/lib/Raven.Client.Lightweight.dll new file mode 100644 index 0000000..7407143 Binary files /dev/null and b/lib/Raven.Client.Lightweight.dll differ diff --git a/lib/Raven.Client.Lightweight.xml b/lib/Raven.Client.Lightweight.xml new file mode 100644 index 0000000..1151d90 --- /dev/null +++ b/lib/Raven.Client.Lightweight.xml @@ -0,0 +1,5754 @@ + + + + Raven.Client.Lightweight + + + + + Access the database commands in async fashion + + + + + An async database command operations + + + + + Begins an async get operation + + The key. + The callback. + The state. + + + + Ends the async get operation + + The result. + + + + Begins an async multi get operation + + The keys. + The callback. + The state. + + + + Ends the async multi get operation + + The result. + + + + Begins the async query. + + The index. + The query. + The callback. + The state. + + + + Ends the async query. + + The result. + + + + + Begins the async batch operation + + The command data. + The callback. + The state. + + + + Ends the async batch operation + + The result. + + + + Initializes a new instance of the class. + + The URL. + The convention. + The credentials. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Begins an async get operation + + The key. + The callback. + The state. + + + + + Ends the async get operation + + The result. + + + + + Begins an async multi get operation + + The keys. + The callback. + The state. + + + + + Ends the async multi get operation + + The result. + + + + + Begins the async query. + + The index. + The query. + The callback. + The state. + + + + + Ends the async query. + + The result. + + + + + Begins the async batch operation + + The command data. + The callback. + The state. + + + + + Ends the async batch operation + + The result. + + + + + An async result that contains multiple steps + + + + + Initializes a new instance of the class. + + The state. + The request + + + + Completes this instance. + + + + + Gets or sets the result. + + The result. + + + + Gets a value that indicates whether the asynchronous operation has completed. + + + true if the operation is complete; otherwise, false. + + + + Gets a that is used to wait for an asynchronous operation to complete. + + + A that is used to wait for an asynchronous operation to complete. + + + + Gets a user-defined object that qualifies or contains information about an asynchronous operation. + + + A user-defined object that qualifies or contains information about an asynchronous operation. + + + + Gets a value that indicates whether the asynchronous operation completed synchronously. + + + true if the asynchronous operation completed synchronously; otherwise, false. + + + + Gets the request. + + The request. + + + + Gets or sets the error. + + The error. + + + + An that wraps another + + + + + + Initializes a new instance of the class. + + The inner. + The wrapped. + + + + Gets a value that indicates whether the asynchronous operation has completed. + + + true if the operation is complete; otherwise, false. + + + + Gets a that is used to wait for an asynchronous operation to complete. + + + A that is used to wait for an asynchronous operation to complete. + + + + Gets a user-defined object that qualifies or contains information about an asynchronous operation. + + + A user-defined object that qualifies or contains information about an asynchronous operation. + + + + Gets a value that indicates whether the asynchronous operation completed synchronously. + + + true if the asynchronous operation completed synchronously; otherwise, false. + + + + Gets the wrapped instance. + + The wrapped. + + + + Gets the inner . + + The inner. + + + + A representation of an HTTP json request to the RavenDB server + + + + + Creates the HTTP json request. + + The self. + The URL. + The method. + The credentials. + + + + + Creates the HTTP json request. + + The self. + The URL. + The method. + The metadata. + The credentials. + + + + + Begins the read response string. + + The callback. + The state. + + + + + Ends the reading of the response string. + + The result. + + + + + Reads the response string. + + + + + + Writes the specified data. + + The data. + + + + Writes the specified byte array. + + The byte array. + + + + Begins the write operation + + The byte array. + The callback. + The state. + + + + + Ends the write operation. + + The result. + + + + Adds the operation headers. + + The operations headers. + + + + Occurs when a json request is created + + + + + Gets or sets the response headers. + + The response headers. + + + + Gets or sets the response status code. + + The response status code. + + + + Expose the set of operations by the RavenDB server + + + + + Gets the document for the specified key. + + The key. + + + + + Gets the results for the specified ids. + + The ids. + The includes. + + + + + Puts the document with the specified key in the database + + The key. + The etag. + The document. + The metadata. + + + + + Deletes the document with the specified key. + + The key. + The etag. + + + + Puts the attachment with the specified key + + The key. + The etag. + The data. + The metadata. + + + + Gets the attachment by the specified key + + The key. + + + + + Deletes the attachment with the specified key + + The key. + The etag. + + + + Gets the index names from the server + + Paging start + Size of the page. + + + + + Resets the specified index + + The name. + + + + Gets the index definition for the specified name + + The name. + + + + Puts the index definition for the specified name + + The name. + The index def. + + + + Puts the index definition for the specified name + + The type of the document. + The type of the reduce result. + The name. + The index def. + + + + + Puts the index for the specified name + + The name. + The index def. + if set to true [overwrite]. + + + + Puts the index for the specified name + + The type of the document. + The type of the reduce result. + The name. + The index def. + if set to true [overwrite]. + + + + Queries the specified index. + + The index. + The query. + The includes. + + + + Deletes the index. + + The name. + + + + Executed the specified commands as a single batch + + The command data. + + + + Commits the specified tx id. + + The tx id. + + + + Rollbacks the specified tx id. + + The tx id. + + + + Promotes the transaction. + + From tx id. + + + + + Stores the recovery information. + + The resource manager Id for this transaction + The tx id. + The recovery information. + + + + Returns a new using the specified credentials + + The credentials for session. + + + + + Perform a set based deletes using the specified index. + + Name of the index. + The query to delete. + if set to true [allow stale]. + + + + Perform a set based update using the specified index. + + Name of the index. + The query to update. + The patch requests. + if set to true [allow stale]. + + + + Create a new instance of that will interacts + with the specified database + + + + + Returns a list of suggestions based on the specified suggestion query. + + The index to query for suggestions + The suggestion query. + + + + Gets or sets the operations headers. + + The operations headers. + + + + Gets a value indicating whether [supports promotable transactions]. + + + true if [supports promotable transactions]; otherwise, false. + + + + + Extension to json objects + + + + + Deserializes the specified instance to an instance of using the specified + + + + + Deserializes the specified instance to an instance of using the specified + + + + + Convert a lucene data format to and from json values + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can write JSON. + + + true if this can write JSON; otherwise, false. + + + + + Helper class that provide a way to escape query terms + + + + + Escapes Lucene operators and quotes phrases + + + + + Escapes Lucene operators and quotes phrases + + + + escaped term + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters + + + + + Provide access to the current transaction + + + + + Starts a transaction + + + + + + Starts a transaction with the specified timeout + + The timeout. + + + + + Gets the transaction information for the current transaction + + + + + + Replication and failover management on the client side + + + + + Updates the replication information if needed. + + The server client. + + + + Should execute the operation using the specified operation URL + + The operation URL. + The current request. + + + + + Determines whether this is the first failure on the specified operation URL. + + The operation URL. + + + + Increments the failure count for the specified operation URL + + The operation URL. + + + + Refreshes the replication information. + + The commands. + + + + Resets the failure count for the specified URL + + The operation URL. + + + + Gets the replication destinations. + + The replication destinations. + + + + Access the RavenDB operations using HTTP + + + + + Initializes a new instance of the class. + + The URL. + The convention. + The credentials. + The replication informer. + + + + Gets the document for the specified key. + + The key. + + + + + Perform a direct get for a document with the specified key on the specified server URL. + + The server URL. + The key. + + + + + Puts the document with the specified key in the database + + The key. + The etag. + The document. + The metadata. + + + + + Deletes the document with the specified key. + + The key. + The etag. + + + + Puts the attachment with the specified key + + The key. + The etag. + The data. + The metadata. + + + + Gets the attachment by the specified key + + The key. + + + + + Deletes the attachment with the specified key + + The key. + The etag. + + + + Gets the index names from the server + + Paging start + Size of the page. + + + + + Resets the specified index + + The name. + + + + Gets the index definition for the specified name + + The name. + + + + + Puts the index. + + The name. + The definition. + + + + + Puts the index. + + The name. + The definition. + if set to true [overwrite]. + + + + + Puts the index definition for the specified name + + The type of the document. + The type of the reduce result. + The name. + The index def. + + + + + Puts the index for the specified name + + The type of the document. + The type of the reduce result. + The name. + The index def. + if set to true [overwrite]. + + + + + Queries the specified index. + + The index. + The query. + The includes. + + + + + Deletes the index. + + The name. + + + + Gets the results for the specified ids. + + The ids. + The includes. + + + + + Perform a direct get for loading multiple ids in one request + + The ids. + The operation URL. + The includes. + + + + + Executed the specified commands as a single batch + + The command data. + + + + + Commits the specified tx id. + + The tx id. + + + + Rollbacks the specified tx id. + + The tx id. + + + + Promotes the transaction. + + From tx id. + + + + + Stores the recovery information. + + The resource manager Id for this transaction + The tx id. + The recovery information. + + + + Returns a new using the specified credentials + + The credentials for session. + + + + + Create a new instance of that will interacts + with the specified database + + + + + Perform a set based deletes using the specified index. + + Name of the index. + The query to delete. + if set to true [allow stale]. + + + + Perform a set based update using the specified index. + + Name of the index. + The query to update. + The patch requests. + if set to true [allow stale]. + + + + Returns a list of suggestions based on the specified suggestion query. + + The index to query for suggestions + The suggestion query. + + + + + Gets or sets the operations headers. + + The operations headers. + + + + Gets a value indicating whether [supports promotable transactions]. + + + true if [supports promotable transactions]; otherwise, false. + + + + + Gets the URL. + + The URL. + + + + Event arguments for the event of creating a + + + + + Gets or sets the web request. + + The request. + + + + Extensions for web requests + + + + + Gets the response stream with HTTP decompression. + + The response. + + + + + Convert strings from / to guids + + + + + Interface for performing type conversions. + We couldn't use the built-in TypeConverter because it is too big an interface for people to build on. + + + + + Returns whether this converter can convert an object of the given type to the type of this converter. + + + true if this converter can perform the conversion; otherwise, false. + + A that represents the type you want to convert from. + + + + + Converts the given object to the type of this converter. + + + An that represents the converted value. + + The to convert. + The conversion cannot be performed. + + + + Converts the given value object to the specified type, using the specified context and culture information. + + + An that represents the converted value. + + The to convert. + + + + Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. + + + true if this converter can perform the conversion; otherwise, false. + + A that represents the type you want to convert from. + + + + + Converts the given object to the type of this converter, using the specified context and culture information. + + + An that represents the converted value. + + The to convert. + The conversion cannot be performed. + + + + Converts the given value object to the specified type, using the specified context and culture information. + + + An that represents the converted value. + + The to convert. + + + + Convert strings from / to int32 + + + + + Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. + + + true if this converter can perform the conversion; otherwise, false. + + A that represents the type you want to convert from. + + + + + Converts the given object to the type of this converter, using the specified context and culture information. + + + An that represents the converted value. + + The to convert. + The conversion cannot be performed. + + + + Converts the given value object to the specified type, using the specified context and culture information. + + + An that represents the converted value. + + The to convert. + + + + Convert strings from / to int64 + + + + + Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. + + + true if this converter can perform the conversion; otherwise, false. + + A that represents the type you want to convert from. + + + + + Converts the given object to the type of this converter, using the specified context and culture information. + + + An that represents the converted value. + + The to convert. + The conversion cannot be performed. + + + + Converts the given value object to the specified type, using the specified context and culture information. + + + An that represents the converted value. + + The to convert. + + + + Implementation for async document session + + + + + Abstract implementation for in memory session operations + + + + + The entities waiting to be deleted + + + + + hold the data required to manage the data for RavenDB's Unit of Work + + + + + Translate between a key and its associated entity + + + + + The document store associated with this session + + + + + Initializes a new instance of the class. + + The document store. + The store listeners. + The delete listeners. + + + + Gets the metadata for the specified entity. + + + The instance. + + + + + Get the json document by key from the store + + + + + Gets the document id. + + The instance. + + + + + Determines whether the specified entity has changed. + + The entity. + + true if the specified entity has changed; otherwise, false. + + + + + Tracks the entity inside the unit of work + + + The document found. + + + + + Tracks the entity. + + + The key. + The document. + The metadata. + + + + + Marks the specified entity for deletion. The entity will be deleted when is called. + + + The entity. + + + + Converts the json document to an entity. + + + The id. + The document found. + The metadata. + + + + + Tries to set the identity property + + + The entity. + The id. + + + + Stores the specified entity in the session. The entity will be saved when is called. + + The entity. + + + + Tries to get the identity. + + The entity. + + + + + Creates the put entity command. + + The entity. + The document metadata. + + + + + Updates the batch results. + + The batch results. + The entities. + + + + Prepares for save changes. + + + + + + Determines if the entity have changed. + + The entity. + The document metadata. + + + + + Evicts the specified entity from the session. + Remove the entity from the delete queue and stops tracking changes for this entity. + + + The entity. + + + + Clears this instance. + Remove all entities from the delete queue and stops tracking changes for all entities. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Commits the specified tx id. + + The tx id. + + + + Rollbacks the specified tx id. + + The tx id. + + + + Promotes the transaction. + + From tx id. + + + + + Clears the enlistment. + + + + + Gets the number of requests for this session + + + + + + Gets or sets the timeout to wait for authoritive information if encountered non authoritive document. + + + + + + Gets the store identifier for this session. + The store identifier is the identifier for the particular RavenDB instance. + This is mostly useful when using sharding. + + The store identifier. + + + + Gets the conventions used by this session + + The conventions. + + This instance is shared among all sessions, changes to the should be done + via the instance, not on a single session. + + + + + The transaction resource manager identifier + + + + + Gets or sets the max number of requests per session. + If the rise above , an exception will be thrown. + + The max number of requests per session. + + + + Gets or sets a value indicating whether the session should use optimistic concurrency. + When set to true, a check is made so that a change made behind the session back would fail + and raise . + + + + + + Occurs when an entity is stored in the session + + + + + Occurs when an entity is converted to a document and metadata. + Changes made to the document / metadata instances passed to this event will be persisted. + + + + + Gets a value indicating whether any of the entities tracked by the session has changes. + + + + + + Gets or sets a value indicating whether non authoritive information is allowed. + Non authoritive information is document that has been modified by a transaction that hasn't been committed. + The server provides the latest committed version, but it is known that attempting to write to a non authoritive document + will fail, because it is already modified. + If set to false, the session will wait for the transaction to commit to get an + authoritive information. If the wait is longer than , is thrown. + + + true if non authoritive information is allowed; otherwise, false. + + + + + Interface for document session using async approaches + + + + + Stores the specified entity in the session. The entity will be saved when is called. + + The entity. + + + + Marks the specified entity for deletion. The entity will be deleted when is called. + + + The entity. + + + + Begins the async load operation + + The id. + The async callback. + The state. + + + + + Ends the async load operation + + + The result. + + + + + Begins the async multi load operation + + The ids. + The async callback. + The state. + + + + + Ends the async multi load operation + + + The result. + + + + + Begins the async save changes operation + + The async callback. + The state. + + + + + Ends the async save changes operation + + The result. + + + + Get the accessor for advanced operations + + + Those operations are rarely needed, and have been moved to a separate + property to avoid cluttering the API + + + + + Advanced async session operations + + + + + Advanced session operations + + + + + Evicts the specified entity from the session. + Remove the entity from the delete queue and stops tracking changes for this entity. + + The entity. + + + + Clears this instance. + Remove all entities from the delete queue and stops tracking changes for all entities. + + + + + Gets the metadata for the specified entity. + If the entity is transient, it will load the metadata from the store + and associate the current state of the entity with the metadata from the server. + + The instance. + + + + + Gets the document id for the specified entity. + + + This function may return null if the entity isn't tracked by the session, or if the entity is + a new entity with a key that should be generated on the server. + + The entity. + + + + Determines whether the specified entity has changed. + + The entity. + + true if the specified entity has changed; otherwise, false. + + + + + Gets the store identifier for this session. + The store identifier is the identifier for the particular RavenDB instance. + This is mostly useful when using sharding. + + The store identifier. + + + + Gets or sets a value indicating whether the session should use optimistic concurrency. + When set to true, a check is made so that a change made behind the session back would fail + and raise . + + + + + Gets or sets a value indicating whether non authoritive information is allowed. + Non authoritive information is document that has been modified by a transaction that hasn't been committed. + The server provides the latest committed version, but it is known that attempting to write to a non authoritive document + will fail, because it is already modified. + If set to false, the session will wait for the transaction to commit to get an + authoritive information. If the wait is longer than , is thrown. + + + true if non authoritive information is allowed; otherwise, false. + + + + + Gets or sets the timeout to wait for authoritive information if encountered non authoritive document. + + + + + Gets the conventions used by this session + + + This instance is shared among all sessions, changes to the should be done + via the instance, not on a single session. + + The conventions. + + + + Gets or sets the max number of requests per session. + If the rise above , an exception will be thrown. + + The max number of requests per session. + + + + Gets the number of requests for this session + + + + + Occurs after an entity is stored in RavenDB. + This event is raised for new and updated entities. + + + + + Occurs when an entity is converted to a document and metadata. + Changes made to the document / metadata instances passed to this event will be persisted. + + + + + Gets a value indicating whether any of the entities tracked by the session has changes. + + + + + Gets the async database commands. + + The async database commands. + + + + Initializes a new instance of the class. + + The document store. + The store listeners. + The delete listeners. + + + + Begins the async load operation + + The id. + The async callback. + The state. + + + + + Ends the async load operation + + + The result. + + + + + Begins the async multi load operation + + The ids. + The async callback. + The state. + + + + + Ends the async multi load operation + + + The result. + + + + + Begins the async save changes operation + + The async callback. + The state. + + + + + Ends the async save changes operation + + The result. + + + + Get the json document by key from the store + + + + + Commits the specified tx id. + + The tx id. + + + + Rollbacks the specified tx id. + + The tx id. + + + + Promotes the transaction. + + From tx id. + + + + + Gets the async database commands. + + The async database commands. + + + + Get the accessor for advanced operations + + + Those operations are rarely needed, and have been moved to a separate + property to avoid cluttering the API + + + + + An for a synchronous load + + + + + Initializes a new instance of the class. + + The state. + The entity. + + + + Gets the entity. + + The entity. + + + + Gets a value that indicates whether the asynchronous operation has completed. + + + true if the operation is complete; otherwise, false. + + + + Gets a that is used to wait for an asynchronous operation to complete. + + + A that is used to wait for an asynchronous operation to complete. + + + + Gets a user-defined object that qualifies or contains information about an asynchronous operation. + + + A user-defined object that qualifies or contains information about an asynchronous operation. + + + + Gets a value that indicates whether the asynchronous operation completed synchronously. + + + true if the asynchronous operation completed synchronously; otherwise, false. + + + + The default json contract will serialize all properties and all public fields + + + + + Initializes a new instance of the class. + + If set to true the will use a cached shared with other resolvers of the same type. + Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected + behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly + recommended to reuse instances with the . + + + + Gets the serializable members for the type. + + The type to get serializable members for. + The serializable members for the type. + + + + The set of conventions used by the which allow the users to customize + the way the Raven client API behaves + + + + + Initializes a new instance of the class. + + + + + Generates the document key using identity. + + The conventions. + The entity. + + + + + Get the default tag name for the specified type. + + The t. + + + + + Gets the name of the type tag. + + The type. + + + + + Generates the document key. + + The entity. + + + + + Gets the identity property. + + The type. + + + + + Creates the serializer. + + + + + + Register an action to customize the json serializer used by the + + + + + A list of type converters that can be used to translate the document key (string) + to whatever type it is that is used on the entity, if the type isn't already a string + + + + + Gets or sets the identity parts separator used by the hilo generators + + The identity parts separator. + + + + Gets or sets the default max number of requests per session. + + The max number of requests per session. + + + + Gets or sets the json contract resolver. + + The json contract resolver. + + + + Gets or sets the function to find the type tag. + + The name of the find type tag. + + + + Gets or sets the function to find the identity property. + + The find identity property. + + + + Gets or sets the document key generator. + + The document key generator. + + + + A query against a Raven index + + + + + A query against a Raven index + + + + + + Includes the specified path in the query, loading the document specified in that path + + The path. + + + + This function exists solely to forbid in memory where clause on IDocumentQuery, because + that is nearly always a mistake. + + + + + Includes the specified path in the query, loading the document specified in that path + + The path. + + + + Takes the specified count. + + The count. + + + + + Skips the specified count. + + The count. + + + + + Filter the results from the index using the specified where clause. + + The where clause. + + + + Matches exact value + + + Defaults to NotAnalyzed + + + + + Matches exact value + + + Defaults to allow wildcards only if analyzed + + + + + Matches exact value + + + + + Matches substrings of the field + + + + + Matches fields which starts with the specified value. + + Name of the field. + The value. + + + + Matches fields which ends with the specified value. + + Name of the field. + The value. + + + + Matches fields where the value is between the specified start and end, exclusive + + Name of the field. + The start. + The end. + + + + Matches fields where the value is between the specified start and end, inclusive + + Name of the field. + The start. + The end. + + + + Matches fields where the value is greater than the specified value + + Name of the field. + The value. + + + + Matches fields where the value is greater than or equal to the specified value + + Name of the field. + The value. + + + + Matches fields where the value is less than the specified value + + Name of the field. + The value. + + + + Matches fields where the value is less than or equal to the specified value + + Name of the field. + The value. + + + + Add an AND to the query + + + + + Add an OR to the query + + + + + Specifies a boost weight to the last where clause. + The higher the boost factor, the more relevant the term will be. + + boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term + + + + + Specifies a fuzziness factor to the single word term in the last where clause + + 0.0 to 1.0 where 1.0 means closer match + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches + + + + + Specifies a proximity distance for the phrase in the last where clause + + number of words within + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches + + + + + Filter matches to be inside the specified radius + + The radius. + The latitude. + The longitude. + + + + Sorts the query results by distance. + + + + + Order the results by the specified fields + + + The fields are the names of the fields to sort, defaulting to sorting by ascending. + You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending + + The fields. + + + + Instructs the query to wait for non stale results as of now. + + + + + + Instructs the query to wait for non stale results as of now for the specified timeout. + + The wait timeout. + + + + + Instructs the query to wait for non stale results as of the cutoff date. + + The cut off. + + + + + Instructs the query to wait for non stale results as of the cutoff date for the specified timeout + + The cut off. + The wait timeout. + + + + EXPERT ONLY: Instructs the query to wait for non stale results. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + + + + EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + The wait timeout. + + + + Selects the specified fields directly from the index + + The type of the projection. + The fields. + + + + Adds an ordering for a specific field to the query + + Name of the field. + if set to true [descending]. + + + + Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes + + Name of the field. + if set to true [descending]. + the type of the field to be sorted. + + + + Simplified method for opening a new clause within the query + + + + + + Simplified method for closing a clause within the query + + + + + + Negate the next operation + + + + + Gets the query result + Execute the query the first time that this is called. + + The query result. + + + + Customize the document query + + + + + Instructs the query to wait for non stale results as of now. + + + + + + Instructs the query to wait for non stale results as of now for the specified timeout. + + The wait timeout. + + + + + Instructs the query to wait for non stale results as of the cutoff date. + + The cut off. + + + + + Instructs the query to wait for non stale results as of the cutoff date for the specified timeout + + The cut off. + The wait timeout. + + + + EXPERT ONLY: Instructs the query to wait for non stale results. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + + + + EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + The wait timeout. + + + + Selects the specified fields directly from the index + + The type of the projection. + The fields. + + + + Filter matches to be inside the specified radius + + The radius. + The latitude. + The longitude. + + + + Provide access to the underlying + + + + + The last term that we asked the query to use equals on + + + + + Get the name of the index being queried + + + + + Grant access ot the query session + + + + + The list of fields to project directly from the index + + + + + The cutoff date to use for detecting staleness in the index + + + + + The fields to order the results by + + + + + The types to sort the fields by (NULL if not specified) + + + + + The page size to use when querying the index + + + + + which record to start reading from + + + + + Initializes a new instance of the class. + + The session. + The database commands. + Name of the index. + The projection fields. + + + + Initializes a new instance of the class. + + The other. + + + + EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + The wait timeout. + + + + Selects the specified fields directly from the index + + The type of the projection. + The fields. + + + + Filter matches to be inside the specified radius + + The radius. + The latitude. + The longitude. + + + + EXPERT ONLY: Instructs the query to wait for non stale results. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + + + + Instruct the query to wait for non stale result for the specified wait timeout. + + The wait timeout. + + + + + Gets the fields for projection + + + + + + Adds an ordering for a specific field to the query + + Name of the field. + if set to true [descending]. + + + + Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes + + Name of the field. + if set to true [descending]. + the type of the field to be sorted. + + + + Gets the enumerator. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Includes the specified path in the query, loading the document specified in that path + + The path. + + + + This function exists solely to forbid in memory where clause on IDocumentQuery, because + that is nearly always a mistake. + + + + + Includes the specified path in the query, loading the document specified in that path + + The path. + + + + Takes the specified count. + + The count. + + + + + Skips the specified count. + + The count. + + + + + Filter the results from the index using the specified where clause. + + The where clause. + + + + Matches exact value + + + Defaults to NotAnalyzed + + + + + Matches exact value + + + Defaults to allow wildcards only if analyzed + + + + + Simplified method for opening a new clause within the query + + + + + + Simplified method for closing a clause within the query + + + + + + Matches exact value + + + + + Matches substrings of the field + + + + + Matches fields which starts with the specified value. + + Name of the field. + The value. + + + + Matches fields which ends with the specified value. + + Name of the field. + The value. + + + + Matches fields where the value is between the specified start and end, exclusive + + Name of the field. + The start. + The end. + + + + + Matches fields where the value is between the specified start and end, inclusive + + Name of the field. + The start. + The end. + + + + + Matches fields where the value is greater than the specified value + + Name of the field. + The value. + + + + Matches fields where the value is greater than or equal to the specified value + + Name of the field. + The value. + + + + Matches fields where the value is less than the specified value + + Name of the field. + The value. + + + + Matches fields where the value is less than or equal to the specified value + + Name of the field. + The value. + + + + Add an AND to the query + + + + + Add an OR to the query + + + + + Specifies a boost weight to the last where clause. + The higher the boost factor, the more relevant the term will be. + + boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term + + + + + Specifies a fuzziness factor to the single word term in the last where clause + + 0.0 to 1.0 where 1.0 means closer match + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches + + + + + Specifies a proximity distance for the phrase in the last where clause + + number of words within + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches + + + + + Filter matches to be inside the specified radius + + The radius. + The latitude. + The longitude. + + + + Sorts the query results by distance. + + + + + Order the results by the specified fields + + + The fields are the names of the fields to sort, defaulting to sorting by ascending. + You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending + + The fields. + + + + Instructs the query to wait for non stale results as of now. + + + + + + Instructs the query to wait for non stale results as of now for the specified timeout. + + The wait timeout. + + + + + Instructs the query to wait for non stale results as of the cutoff date. + + The cut off. + + + + + Instructs the query to wait for non stale results as of the cutoff date for the specified timeout + + The cut off. + The wait timeout. + + + + Instructs the query to wait for non stale results as of now. + + + + + + Instructs the query to wait for non stale results as of now for the specified timeout. + + The wait timeout. + + + + + Instructs the query to wait for non stale results as of the cutoff date. + + The cut off. + + + + + Instructs the query to wait for non stale results as of the cutoff date for the specified timeout + + The cut off. + The wait timeout. + + + + EXPERT ONLY: Instructs the query to wait for non stale results. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + + + + Gets the query result. + + + + + + Generates the index query. + + The query. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + The last term that we asked the query to use equals on + + + + + Gets the current includes on this query + + + + + Gets the database commands associated with this document query + + + + + Get the name of the index being queried + + + + + Gets the session associated with this document query + + + + + Gets the query text built so far + + + + + Gets the query result + Execute the query the first time that this is called. + + The query result. + + + + Negates the next operation + + + + + Implements Unit of Work for accessing the RavenDB server + + + + + Interface for document session + + + + + Marks the specified entity for deletion. The entity will be deleted when is called. + + + The entity. + + + + Loads the specified entity with the specified id. + + The id. + + + + Returns whatever a document with the specified id is loaded in the + current session + + + + + Loads the specified entities with the specified ids. + + The ids. + + + + Loads the specified entities with the specified ids. + + The ids. + + + + Queries the specified index using Linq. + + The result of the query + Name of the index. + + + + Dynamically queries RavenDB using LINQ + + The result of the query + + + + Queries the index specified by using Linq. + + The result of the query + The type of the index creator. + + + + + Begin a load while including the specified path + + The path. + + + + Begin a load while including the specified path + + The path. + + + + Saves all the changes to the Raven server. + + + + + Stores the specified dynamic entity. + + The entity. + + + + Get the accessor for advanced operations + + + Those operations are rarely needed, and have been moved to a separate + property to avoid cluttering the API + + + + + Implementors of this interface provide transactional operations + Note that this interface is mostly useful only for expert usage + + + + + Commits the transaction specified. + + The tx id. + + + + Rollbacks the transaction specified. + + The tx id. + + + + Promotes a transaction specified to a distributed transaction + + From tx id. + The token representing the distributed transaction + + + + Stores the recovery information for the specified transaction + + The resource manager Id for this transaction + The tx id. + The recovery information. + + + + The transaction resource manager identifier + + + + + Advanced synchronous session operations + + + + + Refreshes the specified entity from Raven server. + + The entity. + + + + Queries the index specified by using lucene syntax. + + The result of the query + The type of the index creator. + + + + + Query the specified index using Lucene syntax + + Name of the index. + + + + Dynamically query RavenDB using Lucene syntax + + + + + Gets the document URL for the specified entity. + + The entity. + + + + + Gets the database commands. + + The database commands. + + + + Initializes a new instance of the class. + + The document store. + The store listeners. + The delete listeners. + + + + + Returns whatever a document with the specified id is loaded in the + current session + + + + + Loads the specified entity with the specified id. + + + The id. + + + + + Loads the specified entities with the specified ids. + + + The ids. + + + + + Loads the specified entities with the specified ids. + + The ids. + + + + Queries the specified index using Linq. + + The result of the query + Name of the index. + + + + + Queries the index specified by using Linq. + + The result of the query + The type of the index creator. + + + + + Refreshes the specified entity from Raven server. + + + The entity. + + + + Get the json document by key from the store + + + + + Begin a load while including the specified path + + The path. + + + + + Begin a load while including the specified path + + The path. + + + + + Gets the document URL for the specified entity. + + The entity. + + + + + Saves all the changes to the Raven server. + + + + + Queries the index specified by using lucene syntax. + + The result of the query + The type of the index creator. + + + + + Query the specified index using Lucene syntax + + + Name of the index. + + + + + Commits the specified tx id. + + The tx id. + + + + Rollbacks the specified tx id. + + The tx id. + + + + Promotes the transaction. + + From tx id. + + + + + Stores the recovery information for the specified transaction + + + The tx id. + The recovery information. + + + + Dynamically queries RavenDB using LINQ + + The result of the query + + + + Dynamically query RavenDB using Lucene syntax + + + + + Gets the database commands. + + The database commands. + + + + Get the accessor for advanced operations + + + Those operations are rarely needed, and have been moved to a separate + property to avoid cluttering the API + + + + + Metadata held about an entity by the session + + + + + Gets or sets the original value. + + The original value. + + + + Gets or sets the metadata. + + The metadata. + + + + Gets or sets the ETag. + + The ETag. + + + + Gets or sets the key. + + The key. + + + + Gets or sets the original metadata. + + The original metadata. + + + + Data for a batch command to the server + + + + + Gets or sets the commands. + + The commands. + + + + Gets or sets the entities. + + The entities. + + + + Manages access to RavenDB and open sessions to work with RavenDB. + + + + + Interface for managing access to RavenDB and open sessions. + + + + + Initializes this instance. + + + + + + Registers the delete listener. + + The delete listener. + + + + + Registers the store listener. + + The document store listener. + + + + + Opens the session. + + + + + + Opens the session for a particular database + + + + + Opens the session for a particular database with the specified credentials + + + + + Opens the session with the specified credentials. + + The credentials for session. + + + + Gets the shared operations headers. + + The shared operations headers. + + + + Occurs when an entity is stored inside any session opened from this instance + + + + + Gets or sets the identifier for this store. + + The identifier. + + + + Gets the database commands. + + The database commands. + + + + Gets the conventions. + + The conventions. + + + + Generate new instance of database commands + + + + + Initializes a new instance of the class. + + + + + Parse the connection string option + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Opens the session with the specified credentials. + + The credentials for session. + + + + Registers the store listener. + + The document store listener. + + + + + Opens the session. + + + + + + Opens the session for a particular database + + + + + Opens the session for a particular database with the specified credentials + + + + + Initializes this instance. + + + + + + Initialize the document store access method to RavenDB + + + + + Registers the delete listener. + + The delete listener. + + + + + Opens the async session. + + + + + + Gets the shared operations headers. + + The shared operations headers. + + + + Gets the database commands. + + The database commands. + + + + Gets the async database commands. + + The async database commands. + + + + Occurs when an entity is stored inside any session opened from this instance + + + + + Gets or sets the credentials. + + The credentials. + + + + Gets or sets the identifier for this store. + + The identifier. + + + + Gets or sets the name of the connection string name. + + + + + Gets or sets the URL. + + The URL. + + + + Gets or sets the default database name. + + The default database name. + + + + Gets the conventions. + + The conventions. + + + + The resource manager id for the document store. + IMPORTANT: Using Guid.NewGuid() to set this value is almost certainly a mistake, you should set + it to a value that remains consistent between restart of the system. + + + + + Generate hilo numbers against a RavenDB document + + + + + Initializes a new instance of the class. + + The document store. + The tag. + The capacity. + + + + Generates the document key. + + The convention. + The entity. + + + + + Fluent interface for specifying include paths + for loading documents + + + + + Includes the specified path. + + The path. + + + + + Includes the specified path. + + The path. + + + + + Loads the specified ids. + + The ids. + + + + + Loads the specified id. + + The id. + + + + + Loads the specified ids. + + The ids. + + + + + Loads the specified id. + + + The id. + + + + + Fluent implementation for specifying include paths + for loading documents + + + + + Includes the specified path. + + The path. + + + + Includes the specified path. + + The path. + + + + Loads the specified ids. + + The ids. + + + + Loads the specified id. + + The id. + + + + Initializes a new instance of the class. + + The session. + + + + Loads the specified ids. + + + The ids. + + + + Loads the specified id. + + + The id. + + + + Generate a hilo key for each given type + + + + + Initializes a new instance of the class. + + The document store. + The capacity. + + + + Generates the document key. + + The conventions. + The entity. + + + + + An implementation of for RavenDB Client API + + + + + Initializes a new instance of the class. + + The session. + + + + Notifies an enlisted object that an escalation of the delegated transaction has been requested. + + + A transmitter/receiver propagation token that marshals a distributed transaction. For more information, see . + + + + + Notifies a transaction participant that enlistment has completed successfully. + + An attempt to enlist or serialize a transaction. + + + + Notifies an enlisted object that the transaction is being committed. + + A interface used to send a response to the transaction manager. + + + + Notifies an enlisted object that the transaction is being rolled back. + + A object used to send a response to the transaction manager. + + + + Gets the local or distributed transaction id. + + The transaction information. + + + + + An implementation of for the Raven Client API, allowing Raven + Client API to participate in Distributed Transactions + + + + + Initializes a new instance of the class. + + The session. + + + + Notifies an enlisted object that a transaction is being prepared for commitment. + + A object used to send a response to the transaction manager. + + + + Notifies an enlisted object that a transaction is being committed. + + An object used to send a response to the transaction manager. + + + + Notifies an enlisted object that a transaction is being rolled back (aborted). + + A object used to send a response to the transaction manager. + + + + Notifies an enlisted object that the status of a transaction is in doubt. + + An object used to send a response to the transaction manager. + + + + Initializes this instance. + + + + + Rollbacks the specified single phase enlistment. + + The single phase enlistment. + + + + Helper class for reflection operations + + + + + Gets the full name without version information. + + Type of the entity. + + + + + A query that is executed against sharded instances + + + + + Initializes a new instance of the class. + + Name of the index. + The shard sessions. + + + + Initializes a new instance of the class. + + The queries. + The shard sessions. + + + + Gets the query result. + + + + + + Gets the enumerator. + + + + + + Fors the each query. + + The action. + + + + Includes the specified path in the query, loading the document specified in that path + + The path. + + + + Includes the specified path in the query, loading the document specified in that path + + The path. + + + + Takes the specified count. + + The count. + + + + + Skips the specified count. + + The count. + + + + + Filter the results from the index using the specified where clause. + + The where clause. + + + + Matches exact value + + + Defaults to NotAnalyzed + + + + + Matches exact value + + + Defaults to allow wildcards only if analyzed + + + + + Matches exact value + + + + + Matches substrings of the field + + + + + Matches fields which starts with the specified value. + + Name of the field. + The value. + + + + Matches fields which ends with the specified value. + + Name of the field. + The value. + + + + Matches fields where the value is between the specified start and end, exclusive + + Name of the field. + The start. + The end. + + + + Matches fields where the value is between the specified start and end, inclusive + + Name of the field. + The start. + The end. + + + + Matches fields where the value is greater than the specified value + + Name of the field. + The value. + + + + Matches fields where the value is greater than or equal to the specified value + + Name of the field. + The value. + + + + Matches fields where the value is less than the specified value + + Name of the field. + The value. + + + + Matches fields where the value is less than or equal to the specified value + + Name of the field. + The value. + + + + Add an AND to the query + + + + + + Add an OR to the query + + + + + + Specifies a boost weight to the last where clause. + The higher the boost factor, the more relevant the term will be. + + boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term + + + + + Specifies a fuzziness factor to the single word term in the last where clause + + 0.0 to 1.0 where 1.0 means closer match + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches + + + + + Specifies a proximity distance for the phrase in the last where clause + + number of words within + + + http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches + + + + + Filter matches to be inside the specified radius + + The radius. + The latitude. + The longitude. + + + + Sorts the query results by distance. + + + + + Order the results by the specified fields + + + The fields are the names of the fields to sort, defaulting to sorting by ascending. + You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending + + The fields. + + + + Instructs the query to wait for non stale results as of now. + + + + + + Instructs the query to wait for non stale results as of now for the specified timeout. + + The wait timeout. + + + + + Instructs the query to wait for non stale results as of the cutoff date. + + The cut off. + + + + + Instructs the query to wait for non stale results as of the cutoff date for the specified timeout + + The cut off. + The wait timeout. + + + + + EXPERT ONLY: Instructs the query to wait for non stale results. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + + + + EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. + This shouldn't be used outside of unit tests unless you are well aware of the implications + + The wait timeout. + + + + Selects the specified fields directly from the index + + The type of the projection. + The fields. + + + + Adds an ordering for a specific field to the query + + Name of the field. + if set to true [descending]. + + + + Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes + + Name of the field. + if set to true [descending]. + the type of the field to be sorted. + + + + This function exists solely to forbid in memory where clause on IDocumentQuery, because + that is nearly always a mistake. + + + + + Simplified method for opening a new clause within the query + + + + + + Simplified method for closing a clause within the query + + + + + + Negate the next operation + + + + + Gets the query result + Execute the query the first time that this is called. + + The query result. + + + + A spatial query allows to perform spatial filtering on the index + + + + + Initializes a new instance of the class. + + The session. + The database commands. + Name of the index. + The projection fields. + + + + Initializes a new instance of the class. + + The document query. + The radius. + The latitude. + The longitude. + + + + Initializes a new instance of the class. + + The document query. + if set to true the query will be sorted by distance. + + + + Generates the index query. + + The query. + + + + + Delegate definition when an entity is stored in the session + + + + + Delegate definition for converting an entity to a document and metadata + + + + + This exception occurs when a (replication) conflict is encountered. + Usually this required a user to manually resolve the conflict. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Gets or sets the conflicted version ids. + + The conflicted version ids. + + + + This exception is raised when a non authoritive information is encountered + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + This exception is thrown when a separate instance of an entity is added to the session + when a different entity with the same key already exists within the session. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + This exception is raised whenever a trigger vetos the read by the session + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Extension methods to create mutli tenants databases + + + + + Ensures that the database exists, creating it if needed + + + + + Hook for users to provide additional logic on delete operations + + + + + Invoked before the delete request is sent to the server. + + The key. + The entity instance. + The metadata. + + + + Hook for users to provide additional logic on store operations + + + + + Invoked before the store request is sent to the server. + + The key. + The entity instance. + The metadata. + + + + Invoked after the store request is sent to the server. + + The key. + The entity instance. + The metadata. + + + + Base class for creating indexes + + + The naming convention is that underscores in the inherited class names are replaced by slashed + For example: Posts_ByName will be saved to Posts/ByName + + + + + Creates the index definition. + + + + + + Executes the index creation against the specified document store. + + The document store. + + + + Gets the name of the index. + + The name of the index. + + + + Gets or sets the document store. + + The document store. + + + + Base class for creating indexes + + + The naming convention is that underscores in the inherited class names are replaced by slashed + For example: Posts_ByName will be saved to Posts/ByName + + + + + Base class for creating indexes + + + The naming convention is that underscores in the inherited class names are replaced by slashed + For example: Posts_ByName will be saved to Posts/ByName + + + + + Creates the index definition. + + + + + + Create a new instance + + + + + Register a field to be indexed + + + + + Register a field to be stored + + + + + Register a field to be sorted + + + + + The result translator definition + + + + + The reduce definition + + + + + The map definition + + + + + Index storage options + + + + + Index sort options + + + + + Indexing options + + + + + Precedence values for operations + + + + + x.y f(x) a[x] x++ x-- new + + + + + + - ! ~ ++x --x (T)x + + + + + * / % + + + + + + - + + + + + << >> + + + + + < > <= >= is as + + + + + == != + + + + + & + + + + + ^ + + + + + | + + + + + && (AndAlso in VB) + + + + + || + + + + + ?? + + + + + ?: + + + + + = *= /= %= += -= <<= >>= &= ^= |= + + + + + pseudo operator for comparisons + + + + + Methods on the enum + + + + + Needs parenthesis for the expression + + + + + Based off of System.Linq.Expressions.ExpressionStringBuilder + + + + + Convert the expression to a string + + The convention. + The node. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the element init. + + The initializer. + + + + + Visits the children of the extension expression. + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the lambda. + + + The node. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the member assignment. + + The assignment. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the member list binding. + + The binding. + + + + + Visits the member member binding. + + The binding. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + Visits the children of the . + + The expression to visit. + + The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. + + + + + DatabaseAccessor for loading documents in the translator + + + + + Loading a document during result transformers + + + + + Helper class for creating indexed from implementations of . + + + + + Creates the indexes found in the specified assembly. + + The assembly to scan for indexing tasks. + The document store. + + + + Creates the indexes found in the specified catalog + + The catalog to getn indexing tasks from. + The document store. + + + + This class attempts to provide a strongly typed index definition on the client. + It is here solely as a convenience, and it is _expected_ to fail in some scenarios. + The recommended way is to define indexes outside your code, using the Web UI. + + + + + Initializes a new instance of the class. + + + + + Toes the index definition. + + The convention. + + + + + Gets or sets the map function + + The map. + + + + Gets or sets the reduce function + + The reduce. + + + + Gets or sets the reduce function + + The reduce. + + + + Gets or sets the stores options + + The stores. + + + + Gets or sets the indexing options + + The indexes. + + + + Gets or sets the sort options. + + The sort options. + + + + This class attempts to provide a strongly typed index definition on the client. + It is here solely as a convenience, and it is _expected_ to fail in some scenarios. + The recommended way is to define indexes outside your code, using the Web UI. + + + + + Accessor for generating spatial queries on the client side + + + + + Marker method for allowing generating sptial indexes on the client + + + + + A specialized query provider processor for querying dynamic types + + + + + + Process a Linq expression to a Lucene query + + + + + Initializes a new instance of the class. + + The session. + The customize query. + Executed after the query run, allow access to the query results + Name of the index. + + + + Visits the expression and generate the lucene query + + The expression. + + + + Gets member info for the specified expression and the path to that expression + + + + + + + Get the member expression from the expression + + + + + Processes the expression. + + The expression. + + + + Creates the underlying document query for be populated by the linq provider + + + + + + Executes the specified expression. + + The expression. + + + + + Gets the current path in the case of expressions within collections + + + + + Gets the lucene query. + + The lucene query. + + + + Gets the document session this processor is associated with + + + + + Gets or sets the fields to fetch. + + The fields to fetch. + + + + Different query types + + + + + + + + + + + + + + + + + + + + Get count of items for the query + + + + + Get only the first item + + + + + Get only the first item (or null) + + + + + Get only the first item (or throw if there are more than one) + + + + + Get only the first item (or throw if there are more than one) or null if empty + + + + + Creates a dynamic query provider around the provided session + + + + + Gets member info for the specified expression and the path to that expression + + + + + + + A specialized queryable object for querying dynamic indexes + + + + + + Implements + + + + + An implementation of with Raven specific operation + + + + + Provide statistics about the query, such as total count of matching records + + + + + Customizes the query using the specified action + + The action. + + + + + Initializes a new instance of the class. + + The provider. + The query stats to fill + + + + Initializes a new instance of the class. + + The provider. + The expression. + The query stats to fill + + + + Gets the enumerator. + + + + + + Provide statistics about the query, such as total count of matching records + + + + + Customizes the query using the specified action + + The action. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + + + + + Get the name of the index being queried + + + + + Grant access ot the query session + + + + + Creates a dynamic raven queryable around the provided query provider + + + + + Creates a dynamic raven queryable around the provided query provider + expression + + + + + This is a specialized query provider for querying dynamic indexes + + + + + + Extension for the built-in allowing for Raven specific operations + + + + + Callback to get the results of the query + + + + + Customizes the query using the specified action + + + + + Change the result type for the query provider + + + + + Gets the session. + + The session. + + + + Gets the name of the index. + + The name of the index. + + + + Creates a dynamic query provider around the provided document session + + + + + + + + Change the result type for the query provider + + + + + Executes the query represented by a specified expression tree. + + An expression tree that represents a LINQ query. + + The value that results from executing the specified query. + + + + + Executes the specified expression. + + + The expression. + + + + + Executes the query represented by a specified expression tree. + + An expression tree that represents a LINQ query. + + The value that results from executing the specified query. + + + + + Callback to get the results of the query + + + + + Customizes the query using the specified action + + The action. + + + + Gets the IndexName for this dynamic query provider + + + + + Gets the actions for customizing the generated lucene query + + + + + Gets the session. + + The session. + + + + This class represents a node in an expression, usually a member - but in the case of dynamic queries the path to a member + + + + + Creates an ExpressionMemberInfo + + + + + + + Gets the full path of the member being referred to by this node + + + + + Gets the actual type being referred to + + + + + Extensions to the linq syntax + + + + + Project using a different type + + + + + Suggest alternative values for the queried term + + + + + Suggest alternative values for the queried term + + + + + Marker method for allowing complex (multi entity) queries on the server. + + + + + Marker method for allowing hierarchical queries on the server. + + + + + Marker method for allowing hierarchical queries on the server. + + + + + An implementation of + + + + + Change the result type for the query provider + + + + + Initializes a new instance of the class. + + The session. + Name of the index. + + + + + Executes the query represented by a specified expression tree. + + An expression tree that represents a LINQ query. + + The value that results from executing the specified query. + + + + + Executes the specified expression. + + + The expression. + + + + + Executes the query represented by a specified expression tree. + + An expression tree that represents a LINQ query. + + The value that results from executing the specified query. + + + + + Callback to get the results of the query + + + + + Customizes the query using the specified action + + The action. + + + + Gets the actions for customizing the generated lucene query + + + + + Gets the session. + + The session. + + + + Gets the name of the index. + + The name of the index. + + + + Statistics about a raven query. + Such as how many records match the query + + + + + Whatever the query returned potentially stale results + + + + + What was the total count of the results that matched the query + + + + + Gets or sets the skipped results (duplicate documents); + + + + + The time when the query results were unstale. + + + + + Extensions that provide nicer API for using Raven Client API + + + + + Constant for the built-in index + + + + + Query the "Raven/DocumentsByEntityName" index for all instances of a specified tag. + + + The session. + + + + + Implements Unit of Work for accessing a set of sharded RavenDB servers + + + + + Clears this instance. + Remove all entities from the delete queue and stops tracking changes for all entities. + + + + + Gets the metadata for the specified entity. + + + The instance. + + + + + Gets the document id. + + The instance. + + + + + Determines whether the specified entity has changed. + + The entity. + + true if the specified entity has changed; otherwise, false. + + + + + Initializes a new instance of the class. + + The shard strategy. + The shard sessions. + + + + Loads the specified entity with the specified id. + + + The id. + + + + + Loads the specified entities with the specified ids. + + + The ids. + + + + + Returns whatever a document with the specified id is loaded in the + current session + + + + + Loads the specified entities with the specified ids. + + + The ids. + + + + + Begin a load while including the specified path + + The path. + + + + Begin a load while including the specified path + + The path. + + + + Gets the document URL for the specified entity. + + The entity. + + + + + Marks the specified entity for deletion. The entity will be deleted when is called. + + + The entity. + + + + Queries the specified index using Linq. + + The result of the query + Name of the index. + + + + + Queries the index specified by using Linq. + + The result of the query + The type of the index creator. + + + + + Refreshes the specified entity from Raven server. + + + The entity. + + + + Stores the specified entity in the session. The entity will be saved when is called. + + The entity. + + + + Stores a dynamic entity + + The entity. + + + + + Evicts the specified entity from the session. + Remove the entity from the delete queue and stops tracking changes for this entity. + + + The entity. + + + + Note that while we can assume a transaction for a single shard, cross shard transactions will NOT work. + + + + + Query the specified index using Lucene syntax + + + Name of the index. + + + + + Queries the index specified by using lucene syntax. + + The result of the query + The type of the index creator. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Executes a dynamic query against the RavenDB store + + + + + + + Executes a dynamic lucene query against the RavenDB store + + + + + + + Gets or sets a value indicating whether the session should use optimistic concurrency. + When set to true, a check is made so that a change made behind the session back would fail + and raise . + + + + + + Gets or sets a value indicating whether non authoritive information is allowed. + Non authoritive information is document that has been modified by a transaction that hasn't been committed. + The server provides the latest committed version, but it is known that attempting to write to a non authoritive document + will fail, because it is already modified. + If set to false, the session will wait for the transaction to commit to get an + authoritive information. If the wait is longer than , is thrown. + + + true if non authoritive information is allowed; otherwise, false. + + + + + Gets or sets the timeout to wait for authoritive information if encountered non authoritive document. + + + + + + Gets the number of requests for this session + + + + + + Occurs when an entity is stored in the session + + + + + Occurs when an entity is converted to a document and metadata. + Changes made to the document / metadata instances passed to this event will be persisted. + + + + + Gets a value indicating whether any of the entities tracked by the session has changes. + + + + + + Gets the database commands. + + The database commands. + + + + Get the accessor for advanced operations + + + Those operations are rarely needed, and have been moved to a separate + property to avoid cluttering the API + + + + + Gets the store identifier for this session. + The store identifier is the identifier for the particular RavenDB instance. + This is mostly useful when using sharding. + + The store identifier. + + + + Gets the conventions used by this session + + The conventions. + + This instance is shared among all sessions, changes to the should be done + via the instance, not on a single session. + + + + + Gets or sets the max number of requests per session. + If the rise above , an exception will be thrown. + + The max number of requests per session. + + + + Implements a sharded document store + Hiding most sharding details behind this and the gives you the ability to use + sharding without really thinking about this too much + + + + + Initializes a new instance of the class. + + The shard strategy. + The shards. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Registers the store listener. + + The document store listener. + + + + + Opens the session. + + + + + + Opens the session for a particular database + + + + + Opens the session for a particular database with the specified credentials + + + + + Opens the session with the specified credentials. + + The credentials for session. + + + + Initializes this instance. + + + + + + Registers the delete listener. + + The delete listener. + + + + + Gets the shared operations headers. + + The shared operations headers. + + + + Occurs when an entity is stored inside any session opened from this instance + + + + + Gets or sets the identifier for this store. + + The identifier. + + + + Gets the database commands. + + The database commands. + + + + Gets the conventions. + + The conventions. + + + + Holds a list of shards + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The shards. + + + + The shard strategy define how we access, select and resolve specific shards + inside the . + + + + + Gets the shard selection strategy. + + The shard selection strategy. + + + + Gets the shard resolution strategy. + + The shard resolution strategy. + + + + Gets the shard access strategy. + + The shard access strategy. + + + + Apply an operation to all the shard session + + + + + Applies the specified action to all shard sessions. + + + The shard sessions. + The operation. + + + + + Apply an operation to all the shard session in parallel + + + + + Applies the specified action to all shard sessions in parallel + + + The shard sessions. + The operation. + + + + + Apply an operation to all the shard session in sequence + + + + + Applies the specified action for all shard sessions. + + + The shard sessions. + The operation. + + + + + Shard resolution strategy that select all the shards + + + + + Implementors of this interface provide a way to decide which shards will be queried + for a specified operation + + + + + Selects the shard ids appropriate for the specified data + + + + + Selects the shard ids appropriate for the given data + + + + + Information required to resolve the appropriate shard for an entity / entity and key + + + + + Builds an instance of from the given type + + + + + Builds an instance of from the given type + and key + + + + + Gets or sets the key. + + The key. + + + + Gets or sets the type of the entity. + + The type of the entity. + + + + Implementors of this interface provide a way to go from an exists/new + entity to the appropriate shard for the entity + + + + + Find the shard id for a new object. + + + + + Find the shard id for existing object. + + + + + Default shard strategy for the sharding document store + + + + + Gets or sets the shard selection strategy. + + The shard selection strategy. + + + + Gets or sets the shard resolution strategy. + + The shard resolution strategy. + + + + Gets or sets the shard access strategy. + + The shard access strategy. + + + + The event arguments raised when an entity is stored + + + + + Gets or sets the session identifier. + + The session identifier. + + + + Gets or sets the entity instance. + + The entity instance. + + + + The Inflector class transforms words from one + form to another. For example, from singular to plural. + + + + + Return the plural of a word. + + The singular form + The plural form of + + + + Return the singular of a word. + + The plural form + The singular form of + + + + Capitalizes a word. + + The word to be capitalized. + capitalized. + + + diff --git a/lib/Raven.Database.dll b/lib/Raven.Database.dll new file mode 100644 index 0000000..180a039 Binary files /dev/null and b/lib/Raven.Database.dll differ diff --git a/lib/Raven.Http.dll b/lib/Raven.Http.dll new file mode 100644 index 0000000..4a60b4a Binary files /dev/null and b/lib/Raven.Http.dll differ diff --git a/lib/Raven.Munin.dll b/lib/Raven.Munin.dll new file mode 100644 index 0000000..3544aea Binary files /dev/null and b/lib/Raven.Munin.dll differ diff --git a/lib/Raven.Storage.Esent.dll b/lib/Raven.Storage.Esent.dll new file mode 100644 index 0000000..30f1f4d Binary files /dev/null and b/lib/Raven.Storage.Esent.dll differ diff --git a/lib/Raven.Storage.Managed.dll b/lib/Raven.Storage.Managed.dll new file mode 100644 index 0000000..c49afcd Binary files /dev/null and b/lib/Raven.Storage.Managed.dll differ diff --git a/lib/Spatial.Net.dll b/lib/Spatial.Net.dll new file mode 100644 index 0000000..c14baa0 Binary files /dev/null and b/lib/Spatial.Net.dll differ diff --git a/lib/log4net.dll b/lib/log4net.dll new file mode 100644 index 0000000..ffc57e1 Binary files /dev/null and b/lib/log4net.dll differ diff --git a/src/CodeCampOverflow/Behaviors/PersistenceBehavior.cs b/src/CodeCampOverflow/Behaviors/PersistenceBehavior.cs new file mode 100644 index 0000000..c851dfa --- /dev/null +++ b/src/CodeCampOverflow/Behaviors/PersistenceBehavior.cs @@ -0,0 +1,23 @@ +using Raven.Client; +using FubuMVC.Core.Behaviors; + +namespace CodeCampOverflow.Behaviors +{ + public class PersistenceBehavior : BasicBehavior + { + private readonly IDocumentSession _session; + + public PersistenceBehavior(IDocumentSession session) : base(PartialBehavior.Ignored) + { + _session = session; + } + + protected override void afterInsideBehavior() + { + base.afterInsideBehavior(); + + _session.SaveChanges(); + _session.Dispose(); + } + } +} \ No newline at end of file diff --git a/src/CodeCampOverflow/Behaviors/PersistenceConvention.cs b/src/CodeCampOverflow/Behaviors/PersistenceConvention.cs new file mode 100644 index 0000000..dce842f --- /dev/null +++ b/src/CodeCampOverflow/Behaviors/PersistenceConvention.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using FubuMVC.Core.Registration; +using FubuMVC.Core.Registration.Nodes; + +namespace CodeCampOverflow.Behaviors +{ + public class PersistenceConvention : IConfigurationAction + { + public void Configure(BehaviorGraph graph) + { + graph.Actions() + .Each(actionCall => actionCall.AddBefore(Wrapper.For())); + } + } +} \ No newline at end of file diff --git a/src/CodeCampOverflow/CodeCampOverflow.csproj b/src/CodeCampOverflow/CodeCampOverflow.csproj index 2bd57df..44364ac 100644 --- a/src/CodeCampOverflow/CodeCampOverflow.csproj +++ b/src/CodeCampOverflow/CodeCampOverflow.csproj @@ -33,6 +33,9 @@ 4 + + ..\..\lib\AutoMapper.dll + ..\..\lib\FubuCore.dll @@ -46,6 +49,19 @@ ..\..\lib\HtmlTags.dll + + ..\..\lib\Raven.Client.Embedded.dll + + + ..\..\lib\Raven.Client.Lightweight.dll + + + False + ..\..\lib\Raven.Http.dll + + + ..\..\lib\Raven.Storage.Esent.dll + ..\..\lib\StructureMap.dll @@ -75,19 +91,25 @@ + + + Global.asax + + + Home.aspx @@ -105,7 +127,9 @@ - + + + diff --git a/src/CodeCampOverflow/CodeCampOverflowContainerRegistry.cs b/src/CodeCampOverflow/CodeCampOverflowContainerRegistry.cs index b0e3c0c..e27f330 100644 --- a/src/CodeCampOverflow/CodeCampOverflowContainerRegistry.cs +++ b/src/CodeCampOverflow/CodeCampOverflowContainerRegistry.cs @@ -1,4 +1,8 @@ -using StructureMap.Configuration.DSL; +using CodeCampOverflow.Persistence; +using Raven.Client; +using Raven.Client.Client; +using Raven.Http; +using StructureMap.Configuration.DSL; namespace CodeCampOverflow { @@ -6,7 +10,28 @@ public class CodeCampOverflowContainerRegistry : Registry { public CodeCampOverflowContainerRegistry() { - + For().Use(); + For().Singleton().Use(StartupDb); + For() + .HybridHttpOrThreadLocalScoped() + .Use(x => + { + var store = x.GetInstance(); + return store.OpenSession(); + }); + } + + public static IDocumentStore StartupDb() + { + NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080); + var store = new EmbeddableDocumentStore + { + DataDirectory = @"App_Data\RavenDB", + UseEmbeddedHttpServer = true + }; + store.Initialize(); + + return store; } } } \ No newline at end of file diff --git a/src/CodeCampOverflow/CodeCampOverflowFubuRegistry.cs b/src/CodeCampOverflow/CodeCampOverflowFubuRegistry.cs index c458110..713fa79 100644 --- a/src/CodeCampOverflow/CodeCampOverflowFubuRegistry.cs +++ b/src/CodeCampOverflow/CodeCampOverflowFubuRegistry.cs @@ -1,4 +1,5 @@ -using CodeCampOverflow.Controllers; +using CodeCampOverflow.Behaviors; +using CodeCampOverflow.Controllers; using FubuMVC.Core; namespace CodeCampOverflow @@ -23,6 +24,8 @@ public CodeCampOverflowFubuRegistry() .ConstrainToHttpMethod(action => action.Method.Name.EndsWith("Query"), "GET"); Views.TryToAttachWithDefaultConventions(); + + ApplyConvention(); } } } \ No newline at end of file diff --git a/src/CodeCampOverflow/Controllers/HomeController.cs b/src/CodeCampOverflow/Controllers/HomeController.cs index 697efa8..e0e30ec 100644 --- a/src/CodeCampOverflow/Controllers/HomeController.cs +++ b/src/CodeCampOverflow/Controllers/HomeController.cs @@ -1,33 +1,20 @@ -using System.Collections.Generic; -using CodeCampOverflow.Models.Domain; using CodeCampOverflow.Models.Home; +using CodeCampOverflow.Persistence; namespace CodeCampOverflow.Controllers { public class HomeController { - public HomeViewModel IndexQuery() - { - var returnModel = new HomeViewModel(); + private readonly IQuestionRepository _repo; - returnModel.Questions.Add(new Question - { - Id = 1, - Title = "What is 1337% of Pi?" - }); - returnModel.Questions.Add(new Question - { - Id = 2, - Title = "How many licks does it take to get to the Tootsie Roll center of a Tootsie Pop?", - Answers = new List { new Answer { Id = 4, Body = "3" } } - }); - returnModel.Questions.Add(new Question - { - Id = 3, - Title = "Why are manhole covers round?" - }); + public HomeController(IQuestionRepository repo) + { + _repo = repo; + } - return returnModel; + public HomeViewModel IndexQuery() + { + return new HomeViewModel { Questions = _repo.GetQuestions() }; } } } \ No newline at end of file diff --git a/src/CodeCampOverflow/Controllers/QuestionController.cs b/src/CodeCampOverflow/Controllers/QuestionController.cs index 228c96d..5c0e5b0 100644 --- a/src/CodeCampOverflow/Controllers/QuestionController.cs +++ b/src/CodeCampOverflow/Controllers/QuestionController.cs @@ -1,14 +1,25 @@ -using CodeCampOverflow.Models.Question; +using System.Linq; +using CodeCampOverflow.Models; +using CodeCampOverflow.Models.Question; +using CodeCampOverflow.Persistence; using FubuMVC.Core; namespace CodeCampOverflow.Controllers { public class QuestionController { + private readonly IQuestionRepository _repo; + + public QuestionController(IQuestionRepository repo) + { + _repo = repo; + } + [UrlPattern("question/{Id}")] public QuestionViewModel IndexQuery(QuestionInputModel inputModel) { - return new QuestionViewModel { Id = inputModel.Id }; + var question = _repo.GetQuestions().Where(x => x.Id == inputModel.Id).Single(); + return question.Map(); } public AskQuestionViewModel AskQuery() diff --git a/src/CodeCampOverflow/Models/Domain/Answer.cs b/src/CodeCampOverflow/Models/Domain/Answer.cs index d80abc2..8361479 100644 --- a/src/CodeCampOverflow/Models/Domain/Answer.cs +++ b/src/CodeCampOverflow/Models/Domain/Answer.cs @@ -2,7 +2,7 @@ { public class Answer { - public int Id { get; set; } + public string Id { get; set; } public string Body { get; set; } } } \ No newline at end of file diff --git a/src/CodeCampOverflow/Models/Domain/Everything.cs b/src/CodeCampOverflow/Models/Domain/Everything.cs new file mode 100644 index 0000000..276d441 --- /dev/null +++ b/src/CodeCampOverflow/Models/Domain/Everything.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; + +namespace CodeCampOverflow.Models.Domain +{ + public class Everything + { + public Everything() + { + Questions = new List(); + } + + public string Id { get; set; } + public IList Questions { get; set; } + } +} \ No newline at end of file diff --git a/src/CodeCampOverflow/Models/Domain/Question.cs b/src/CodeCampOverflow/Models/Domain/Question.cs index b275464..b0103e4 100644 --- a/src/CodeCampOverflow/Models/Domain/Question.cs +++ b/src/CodeCampOverflow/Models/Domain/Question.cs @@ -4,12 +4,7 @@ namespace CodeCampOverflow.Models.Domain { public class Question { - public Question() - { - Answers = new List(); - } - - public int Id { get; set; } + public string Id { get; set; } public string Title { get; set; } public string Body { get; set; } public IList Answers { get; set; } diff --git a/src/CodeCampOverflow/Models/Home/HomeViewModel.cs b/src/CodeCampOverflow/Models/Home/HomeViewModel.cs index 7055af2..38f9871 100644 --- a/src/CodeCampOverflow/Models/Home/HomeViewModel.cs +++ b/src/CodeCampOverflow/Models/Home/HomeViewModel.cs @@ -4,11 +4,6 @@ namespace CodeCampOverflow.Models.Home { public class HomeViewModel { - public HomeViewModel() - { - Questions = new List(); - } - - public IList Questions { get; private set; } + public IList Questions { get; set; } } } \ No newline at end of file diff --git a/src/CodeCampOverflow/Models/ObjectExtensions.cs b/src/CodeCampOverflow/Models/ObjectExtensions.cs new file mode 100644 index 0000000..f45c986 --- /dev/null +++ b/src/CodeCampOverflow/Models/ObjectExtensions.cs @@ -0,0 +1,22 @@ +using System; +using AutoMapper; + +namespace CodeCampOverflow.Models +{ + public static class ObjectExtensions + { + public static object Map(this object source, Type destinationType) + { + if (destinationType.IsValueType && source == null) + { + return Activator.CreateInstance(destinationType); + } + return Mapper.DynamicMap(source, source.GetType(), destinationType); + } + + public static T Map(this object source) + { + return (T)source.Map(typeof(T)); + } + } +} \ No newline at end of file diff --git a/src/CodeCampOverflow/Models/Question/QuestionInputModel.cs b/src/CodeCampOverflow/Models/Question/QuestionInputModel.cs index e3d0fe6..72322aa 100644 --- a/src/CodeCampOverflow/Models/Question/QuestionInputModel.cs +++ b/src/CodeCampOverflow/Models/Question/QuestionInputModel.cs @@ -2,6 +2,6 @@ { public class QuestionInputModel { - public int Id { get; set; } + public string Id { get; set; } } } \ No newline at end of file diff --git a/src/CodeCampOverflow/Models/Question/QuestionViewModel.cs b/src/CodeCampOverflow/Models/Question/QuestionViewModel.cs index 37000dd..29c8bff 100644 --- a/src/CodeCampOverflow/Models/Question/QuestionViewModel.cs +++ b/src/CodeCampOverflow/Models/Question/QuestionViewModel.cs @@ -1,7 +1,13 @@ -namespace CodeCampOverflow.Models.Question +using System.Collections.Generic; +using CodeCampOverflow.Models.Domain; + +namespace CodeCampOverflow.Models.Question { public class QuestionViewModel { - public int Id { get; set; } + public string Id { get; set; } + public string Title { get; set; } + public string Body { get; set; } + public IList Answers { get; set; } } } \ No newline at end of file diff --git a/src/CodeCampOverflow/Persistence/IQuestionRepository.cs b/src/CodeCampOverflow/Persistence/IQuestionRepository.cs new file mode 100644 index 0000000..572cb43 --- /dev/null +++ b/src/CodeCampOverflow/Persistence/IQuestionRepository.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using CodeCampOverflow.Models.Domain; + +namespace CodeCampOverflow.Persistence +{ + public interface IQuestionRepository + { + IList GetQuestions(); + } +} \ No newline at end of file diff --git a/src/CodeCampOverflow/Persistence/QuestionRepository.cs b/src/CodeCampOverflow/Persistence/QuestionRepository.cs new file mode 100644 index 0000000..0191146 --- /dev/null +++ b/src/CodeCampOverflow/Persistence/QuestionRepository.cs @@ -0,0 +1,52 @@ +using System; +using Raven.Client; +using System.Collections.Generic; +using CodeCampOverflow.Models.Domain; + +namespace CodeCampOverflow.Persistence +{ + public class QuestionRepository : IQuestionRepository + { + private readonly IDocumentSession _session; + + public QuestionRepository(IDocumentSession session) + { + _session = session; + } + + public IList GetQuestions() + { + var list = _session.Load("codecampoverflow/42"); + + // Prepopulate some questions and answers if database is empty + if (list == null) + { + list = new Everything { Id = "codecampoverflow/42" }; + list.Questions.Add(new Question + { + Id = Guid.NewGuid().ToString("D"), + Title = "What is 1337% of Pi?", + Body = "I hear the answer will make you *nerd asplode*!", + Answers = new List() + }); + list.Questions.Add(new Question + { + Id = Guid.NewGuid().ToString("D"), + Title = "How many licks does it take to get to the Tootsie Roll center of a Tootsie Pop?", + Body = "Mr. Owl: \"Let's find out...\"", + Answers = new List { new Answer { Id = Guid.NewGuid().ToString("D"), Body = "3" } } + }); + list.Questions.Add(new Question + { + Id = Guid.NewGuid().ToString("D"), + Title = "Why are manhole covers round?", + Body = "If you know this, you may be qualified to interview at Microsoft.", + Answers = new List() + }); + _session.Store(list); + } + + return list.Questions; + } + } +} \ No newline at end of file