diff --git a/.gitignore b/.gitignore index 62fa9116..45cedb62 100644 --- a/.gitignore +++ b/.gitignore @@ -46,4 +46,5 @@ App_Data/ *.suo *.user *.ncrunch* -*.gpState \ No newline at end of file +*.gpState +/PublishProfiles diff --git a/README.md b/README.md index a5b63bf4..595753c1 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,45 @@ +# ServiceStack.Examples + [Join the new google group](http://groups.google.com/group/servicestack) or follow [@demisbellot](http://twitter.com/demisbellot) and [@ServiceStack](http://twitter.com/servicestack) -for twitter updates. +for twitter updates. -#Example Projects built with [ServiceStack](https://github.com/ServiceStack/ServiceStack), [C# RedisClient](https://github.com/ServiceStack/ServiceStack.Redis), [OrmLite](https://github.com/ServiceStack/ServiceStack.OrmLite), etc +Example Projects built with [ServiceStack](https://github.com/binary2015nov/ServiceStack), [C# RedisClient](https://github.com/binary2015nov/ServiceStack.Redis), [OrmLite](https://github.com/binary2015nov/ServiceStack.OrmLite), etc -## [Download](https://github.com/ServiceStack/ServiceStack.Examples/archive/master.zip) +## [Download](https://github.com/binary2015nov/ServiceStack.Examples/archive/master.zip) Download the tarball: -[https://github.com/ServiceStack/ServiceStack.Examples/archive/master.zip](https://github.com/ServiceStack/ServiceStack.Examples/archive/master.zip) +[https://github.com/binary2015nov/ServiceStack.Examples/archive/master.zip](https://github.com/binary2015nov/ServiceStack.Examples/archive/master.zip) or clone this repo to download the source: - git clone git://github.com/ServiceStack/ServiceStack.Examples.git - + git clone git://github.com/binary2015nov/ServiceStack.Examples.git ## [Live Demos](https://github.com/ServiceStackApps/LiveDemos) -[Live demos](https://github.com/ServiceStackApps/LiveDemos) and tutorials are available at the following locations: +Live demos and tutorials are available at the following locations: ### [Backbone.js TODO app with REST and Redis backend](http://todos.servicestack.net) + [![Backbone REST and Redis TODOs](http://servicestack.net/showcase/img/todos-400x350.png)](http://todos.servicestack.net) ### [Creating a Hello World Web service from scratch](http://mono.servicestack.net/ServiceStack.Hello/) + [![ServiceStacks Hello, World!](http://servicestack.net/showcase/img/hello-400x350.png)](http://mono.servicestack.net/ServiceStack.Hello/) ### [GitHub-like browser to manage remote filesystem over REST](http://restfiles.servicestack.net) + [![GitHub-like REST Files](http://servicestack.net/showcase/img/restfiles-400x350.png)](http://restfiles.servicestack.net) ### [Creating a StackOverflow-like app in Redis](http://redisstackoverflow.servicestack.net) + [![Redis StackOverflow](http://servicestack.net/showcase/img/redisstackoverflow-400x350.png)](http://redisstackoverflow.servicestack.net) ### [Northwind dataset services](http://northwind.servicestack.net) -[![Redis StackOverflow](http://servicestack.net/showcase/img/northwind-400x350.png)](http://northwind.servicestack.net) - -### Other examples -* [Calling Web Services with Mono Touch](http://mono.servicestack.net/monotouch/remote-info/) -* [Calling Web Services using Silverlight](http://mono.servicestack.net/ServiceStack.Examples.Clients/Silverlight.htm) -* [Calling SOAP 1.1 Web Service Examples](http://mono.servicestack.net/ServiceStack.Examples.Clients/Soap11.aspx) -* [Calling SOAP 1.2 Web Service Examples](http://mono.servicestack.net/ServiceStack.Examples.Clients/Soap12.aspx) +[![Redis StackOverflow](http://servicestack.net/showcase/img/northwind-400x350.png)](http://northwind.servicestack.net) ### Troubleshooting -- Since the example project uses 32bit Sqlite.dll, on a 64bit machine you must set IIS to run 32bit apps (in the App Domain config) +* Since the example project uses 32bit Sqlite.dll, on a 64bit machine you must set IIS to run 32bit apps (in the App Domain config) diff --git a/build/build.bat b/build/build.bat index e398d4d4..271489f8 100644 --- a/build/build.bat +++ b/build/build.bat @@ -1,4 +1,3 @@ -SET MSBUILD=C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe - -%MSBUILD% build.msbuild +SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" +%MSBUILD% /p:Configuration=Release ..\src\AllExamples.sln diff --git a/build/build.msbuild b/build/build.msbuild deleted file mode 100644 index 7f4218cc..00000000 --- a/build/build.msbuild +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/lib/ServiceStack.Client.dll b/lib/ServiceStack.Client.dll new file mode 100644 index 00000000..780d0e90 Binary files /dev/null and b/lib/ServiceStack.Client.dll differ diff --git a/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/net40/ServiceStack.Client.xml b/lib/ServiceStack.Client.xml similarity index 89% rename from src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/net40/ServiceStack.Client.xml rename to lib/ServiceStack.Client.xml index 19e159c1..857fed6c 100644 --- a/src/RedisStackOverflow/packages/ServiceStack.Client.4.0.60/lib/net40/ServiceStack.Client.xml +++ b/lib/ServiceStack.Client.xml @@ -1,435 +1,456 @@ - - - - ServiceStack.Client - - - + + + + ServiceStack.Client + + + Need to provide async request options http://msdn.microsoft.com/en-us/library/86wf6409(VS.71).aspx - - - - The request filter is called before any request. - This request filter is executed globally. - - - - - The response action is called once the server response is available. - It will allow you to access raw response information. - This response action is executed globally. - Note that you should NOT consume the response stream as this is handled by ServiceStack - - - - - Called before request resend, when the initial request required authentication - - - - - The request filter is called before any request. - This request filter only works with the instance where it was set (not global). - - - - - The response action is called once the server response is available. - It will allow you to access raw response information. - Note that you should NOT consume the response stream as this is handled by ServiceStack - - - - - The ResultsFilter is called before the Request is sent allowing you to return a cached response. - - - - - The ResultsFilterResponse is called before returning the response allowing responses to be cached. - - - - - Called with requestUri, ResponseType when server returns 304 NotModified - - - - - Useful .NET Encryption Utils from: - https://msdn.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider(v=vs.110).aspx - - - - Need to provide async request options - http://msdn.microsoft.com/en-us/library/86wf6409(VS.71).aspx - - - - The request filter is called before any request. - This request filter is executed globally. - - - - - The response action is called once the server response is available. - It will allow you to access raw response information. - This response action is executed globally. - Note that you should NOT consume the response stream as this is handled by ServiceStack - - - - - Sets all baseUri properties, using the Format property for the SyncReplyBaseUri and AsyncOneWayBaseUri - - Base URI of the service - - - - Whether to Accept Gzip,Deflate Content-Encoding and to auto decompress responses - - - - - The user name for basic authentication - - - - - The password for basic authentication - - - - - Sets the username and the password for basic authentication. - - - - - The Authorization Bearer Token to send with this request - - - - - Determines if the basic auth header should be sent with every request. - By default, the basic auth header is only sent when "401 Unauthorized" is returned. - - - - - Specifies if cookies should be stored - - - - - The ResultsFilter is called before the Request is sent allowing you to return a cached response. - - - - - The ResultsFilterResponse is called before returning the response allowing responses to be cached. - - - - - Called with requestUri, ResponseType when server returns 304 NotModified - - - - - Called by Send method if an exception occurs, for instance a System.Net.WebException because the server - returned an HTTP error code. Override if you want to handle specific exceptions or always want to parse the - response to a custom ErrorResponse DTO type instead of ServiceStack's ErrorResponse class. In case ex is a - System.Net.WebException, do not use - createWebRequest/getResponse/HandleResponse<TResponse> to parse the response - because that will result in the same exception again. Use - ThrowWebServiceException<YourErrorResponseType> to parse the response and to throw a - WebServiceException containing the parsed DTO. Then override Send to handle that exception. - - - - - APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Get(url)) { ... } - - - - - APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Get(url)) { ... } - - - - - Gets the collection of headers to be added to outgoing requests. - - - - - Whether to execute async callbacks on the same Synchronization Context it was called from. - - - - - Gets or sets authentication information for the request. - Warning: It's recommened to use and for basic auth. - This property is only used for IIS level authentication. - - - - - Called before request resend, when the initial request required authentication - - - - - The request filter is called before any request. - This request filter only works with the instance where it was set (not global). - - - - - The response action is called once the server response is available. - It will allow you to access raw response information. - Note that you should NOT consume the response stream as this is handled by ServiceStack - - - - - Returns the next message from queueName or null if no message - - - - - - - Generic Proxy for service calls. - - The service Contract - - - - Returns the transparent proxy for the service call - - - - - Creates the error response from the values provided. - - If the errorCode is empty it will use the first validation error code, - if there is none it will throw an error. - - The error code. - The error message. - The validation errors. - - - - - Default MaxStringContentLength is 8k, and throws an exception when reached - - - - - Serializer cache of delegates required to create a type from a string map (e.g. for REST urls) - - - - - Gets the namespace from an attribute marked on the type's definition - - - Namespace of type - - - - Specifies if cookies should be stored - - - - - Compresses the specified text using the default compression method: Deflate - - The text. - Type of the compression. - - - - - Compresses the specified text using the default compression method: Deflate - - - - - Decompresses the specified gz buffer using the default compression method: Inflate - - The gz buffer. - Type of the compression. - - - - - Decompresses the specified gz buffer using the default compression method: Inflate - - - - - Donated by Ivan Korneliuk from his post: - http://korneliuk.blogspot.com/2012/08/servicestack-reusing-dtos.html - - Modified to only allow using routes matching the supplied HTTP Verb - - - - - Generate a url from a Request DTO. Pretty URL generation require Routes to be defined using `[Route]` on the Request DTO - - - - - The exception which is thrown when a validation error occurred. - This validation is serialized in a extra clean and human-readable way by ServiceStack. - - - - - Used if we need to serialize this exception to XML - - - - - - Returns the first error code - - The error code. - - - - Encapsulates a validation result. - - - - - Constructs a new ValidationResult - - - - - Constructs a new ValidationResult - - A list of validation results - - - - Initializes a new instance of the class. - - The errors. - The success code. - The error code. - - - - Merge errors from another - - - - - - Gets or sets the success code. - - The success code. - - - - Gets or sets the error code. - - The error code. - - - - Gets or sets the success message. - - The success message. - - - - Gets or sets the error message. - - The error message. - - - - The errors generated by the validation. - - - - - Returns True if the validation was successful (errors list is empty). - - - - - Adds the singleton instance of to an endpoint on the client. - - - Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/ - - - - - Adds the singleton of the class to the client endpoint's message inspectors. - - The endpoint that is to be customized. - The client runtime to be customized. - - - - Maintains a copy of the cookies contained in the incoming HTTP response received from any service - and appends it to all outgoing HTTP requests. - - - This class effectively allows to send any received HTTP cookies to different services, - reproducing the same functionality available in ASMX Web Services proxies with the class. - Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/ - - - - - Initializes a new instance of the class. - - - - - Inspects a message after a reply message is received but prior to passing it back to the client application. - - The message to be transformed into types and handed back to the client application. - Correlation state data. - - - - Inspects a message before a request message is sent to a service. - - The message to be sent to the service. - The client object channel. - - Null since no message correlation is used. - - - - - Gets the singleton instance. - - - - - Naming convention for the request's Response DTO - - - - - Shortcut to get the ResponseStatus whether it's bare or inside a IHttpResult - - - - - - + + + + The request filter is called before any request. + This request filter is executed globally. + + + + + The response action is called once the server response is available. + It will allow you to access raw response information. + This response action is executed globally. + Note that you should NOT consume the response stream as this is handled by ServiceStack + + + + + Called before request resend, when the initial request required authentication + + + + + The request filter is called before any request. + This request filter only works with the instance where it was set (not global). + + + + + The response action is called once the server response is available. + It will allow you to access raw response information. + Note that you should NOT consume the response stream as this is handled by ServiceStack + + + + + The ResultsFilter is called before the Request is sent allowing you to return a cached response. + + + + + The ResultsFilterResponse is called before returning the response allowing responses to be cached. + + + + + Called with requestUri, ResponseType when server returns 304 NotModified + + + + + Useful .NET Encryption Utils from: + https://msdn.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider(v=vs.110).aspx + + + + + Generic Proxy for service calls. + + The service Contract + + + + Returns the transparent proxy for the service call + + + + + Returns the next message from queueName or null if no message + + + + + + + Creates the error response from the values provided. + + If the errorCode is empty it will use the first validation error code, + if there is none it will throw an error. + + The error code. + The error message. + The validation errors. + + + + + Default MaxStringContentLength is 8k, and throws an exception when reached + + + + + Serializer cache of delegates required to create a type from a string map (e.g. for REST urls) + + + + + Gets the namespace from an attribute marked on the type's definition + + + Namespace of type + + + + Makes a client middleware to access remote web service. This is an abstract class. + Needs to provide async request options, http://msdn.microsoft.com/en-us/library/86wf6409(VS.71).aspx. + + + + + The request filter is called before any request. + This request filter is executed globally. + + + + + The response action is called once the server response is available. + It will allow you to access raw response information. + This response action is executed globally. + Note that you should NOT consume the response stream as this is handled by ServiceStack + + + + + Gets the collection of headers to be added to outgoing requests. + + + + + Initializes a new instance of the ServiceStack.ServiceClientBase class. + + + + + Sets all baseUri properties, using the Format property for the SyncReplyBaseUri and AsyncOneWayBaseUri + + Base URI of the service + + + + Whether to Accept Gzip,Deflate Content-Encoding and to auto decompress responses + + + + + The user name for basic authentication + + + + + The password for basic authentication + + + + + Sets the username and the password for basic authentication. + + + + + The Authorization Bearer Token to send with this request + + + + + Gets or sets authentication information for the request. + Warning: It's recommened to use and for basic auth. + This property is only used for IIS level authentication. + + + + + Determines if the basic auth header should be sent with every request. + By default, the basic auth header is only sent when "401 Unauthorized" is returned. + + + + + Specifies if cookies should be stored + + + + + Called before request resend, when the initial request required authentication + + + + + If a request fails with a 401 Unauthorized and a BearerToken is present the client + will automatically fetch a new AccessToken using this RefreshToken and retry the request + + + + + Send the Request to get the AccessToken with the RefreshToken at a non-default location + + + + + The request filter is called before any request. + This request filter only works with the instance where it was set (not global). + + + + + The ResultsFilter is called before the Request is sent allowing you to return a cached response. + + + + + The ResultsFilterResponse is called before returning the response allowing responses to be cached. + + + + + Called with requestUri, ResponseType when server returns 304 NotModified + + + + + The response action is called once the server response is available. + It will allow you to access raw response information. + Note that you should NOT consume the response stream as this is handled by ServiceStack + + + + + Called by Send method if an exception occurs, for instance a System.Net.WebException because the server + returned an HTTP error code. Override if you want to handle specific exceptions or always want to parse the + response to a custom ErrorResponse DTO type instead of ServiceStack's ErrorResponse class. In case ex is a + System.Net.WebException, do not use + createWebRequest/getResponse/HandleResponse<TResponse> to parse the response + because that will result in the same exception again. Use + ThrowWebServiceException<YourErrorResponseType> to parse the response and to throw a + WebServiceException containing the parsed DTO. Then override Send to handle that exception. + + + + + APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Get(url)) { ... } + + + + + APIs returning HttpWebResponse must be explicitly Disposed, e.g using (var res = client.Get(url)) { ... } + + + + + Compresses the specified text using the default compression method: Deflate + + The text. + Type of the compression. + + + + + Compresses the specified text using the default compression method: Deflate + + + + + Decompresses the specified gz buffer using the default compression method: Inflate + + The gz buffer. + Type of the compression. + + + + + Decompresses the specified gz buffer using inflate or gzip method + + Compressed stream + Type of the compression. Can be "gzip" or "deflate" + Decompressed stream + + + + Decompresses the specified gz buffer using the default compression method: Inflate + + + + + Donated by Ivan Korneliuk from his post: + http://korneliuk.blogspot.com/2012/08/servicestack-reusing-dtos.html + + Modified to only allow using routes matching the supplied HTTP Verb + + + + + Generate a url from a Request DTO. Pretty URL generation require Routes to be defined using `[Route]` on the Request DTO + + + + + The exception which is thrown when a validation error occurred. + This validation is serialized in a extra clean and human-readable way by ServiceStack. + + + + + Returns the first error code + + The error code. + + + + Used if we need to serialize this exception to XML + + + + + + Encapsulates a validation result. + + + + + Gets or sets the success code. + + The success code. + + + + Gets or sets the error code. + + The error code. + + + + Gets or sets the success message. + + The success message. + + + + Gets or sets the error message. + + The error message. + + + + The errors generated by the validation. + + + + + Returns True if the validation was successful (errors list is empty). + + + + + Constructs a new ValidationResult + + + + + Constructs a new ValidationResult + + A list of validation results + + + + Initializes a new instance of the class. + + The errors. + The success code. + The error code. + + + + Merge errors from another + + + + + + Adds the singleton instance of to an endpoint on the client. + + + Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/ + + + + + Adds the singleton of the class to the client endpoint's message inspectors. + + The endpoint that is to be customized. + The client runtime to be customized. + + + + Maintains a copy of the cookies contained in the incoming HTTP response received from any service + and appends it to all outgoing HTTP requests. + + + This class effectively allows to send any received HTTP cookies to different services, + reproducing the same functionality available in ASMX Web Services proxies with the class. + Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/ + + + + + Initializes a new instance of the class. + + + + + Gets the singleton instance. + + + + + Inspects a message after a reply message is received but prior to passing it back to the client application. + + The message to be transformed into types and handed back to the client application. + Correlation state data. + + + + Inspects a message before a request message is sent to a service. + + The message to be sent to the service. + The client object channel. + + Null since no message correlation is used. + + + + + Specifies if cookies should be stored + + + + + Naming convention for the request's Response DTO + + + + + Shortcut to get the ResponseStatus whether it's bare or inside a IHttpResult + + + + + + diff --git a/lib/ServiceStack.Common.dll b/lib/ServiceStack.Common.dll new file mode 100644 index 00000000..00ad7cce Binary files /dev/null and b/lib/ServiceStack.Common.dll differ diff --git a/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.60/lib/net40/ServiceStack.Common.xml b/lib/ServiceStack.Common.xml similarity index 70% rename from src/RedisStackOverflow/packages/ServiceStack.Common.4.0.60/lib/net40/ServiceStack.Common.xml rename to lib/ServiceStack.Common.xml index 2ff3e337..b3066dc6 100644 --- a/src/RedisStackOverflow/packages/ServiceStack.Common.4.0.60/lib/net40/ServiceStack.Common.xml +++ b/lib/ServiceStack.Common.xml @@ -1,410 +1,538 @@ - - - - ServiceStack.Common - - - - - Categories of sql statements. - - - - - Unknown - - - - - DML statements that alter database state, e.g. INSERT, UPDATE - - - - - Statements that return a single record - - - - - Statements that iterate over a result set - - - - - A callback for ProfiledDbConnection and family - - - - - Called when a command starts executing - - - - - - - Called when a reader finishes executing - - - - - - - - Called when a reader is done iterating through the data - - - - - - Called when an error happens during execution of a command - - - - - - - - True if the profiler instance is active - - - - - Return T[0] when enumerable is null, safe to use in enumerations like foreach - - - - - Gets the textual description of the enum if it has one. e.g. - - - enum UserColors - { - [Description("Bright Red")] - BrightRed - } - UserColors.BrightRed.ToDescription(); - - - - - - - - Creates a Console Logger, that logs all messages to: System.Console - - Made public so its testable - - - - - Default logger is to Console.WriteLine - - Made public so its testable - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Logs the specified message. - - - - - Logs the format. - - - - - Logs the specified message. - - - - - Creates a Debug Logger, that logs all messages to: System.Diagnostics.Debug - - Made public so its testable - - - - - Default logger is to System.Diagnostics.Debug.WriteLine - - Made public so its testable - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Logs the specified message. - - - - - Logs the format. - - - - - Logs the specified message. - - - - - Wraps a database connection, allowing sql execution timings to be collected when a session is started. - - - - - Returns a new that wraps , - providing query execution profiling. If profiler is null, no profiling will occur. - - Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection - The currently started or null. - Determines whether the ProfiledDbConnection will dispose the underlying connection. - - - - The underlying, real database connection to your db provider. - - - - - The current profiler instance; could be null. - - - - - The raw connection this is wrapping - - - - - Wrapper for a db provider factory to enable profiling - - - - - Every provider factory must have an Instance public field - - - - - Allow to re-init the provider factory. - - - - - - - proxy - - - - - - - proxy - - - - - proxy - - - - - proxy - - - - - proxy - - - - - proxy - - - - - proxy - - - - - proxy - - - - - proxy - - - - - proxy - - - - - Useful IPAddressExtensions from: - http://blogs.msdn.com/knom/archive/2008/12/31/ip-address-calculations-with-c-subnetmasks-networks.aspx - - - - - - Gets the ipv4 addresses from all Network Interfaces that have Subnet masks. - - - - - - Gets the ipv6 addresses from all Network Interfaces. - - - - - - Func to get the Strongly-typed field - - - - - Required to cast the return ValueType to an object for caching - - - - - Func to set the Strongly-typed field - - - - - Required to cast the ValueType to an object for caching - - - - - Required to cast the ValueType to an object for caching - - - - - Func to get the Strongly-typed field - - - - - Required to cast the return ValueType to an object for caching - - - - - Func to set the Strongly-typed field - - - - - Required to cast the ValueType to an object for caching - - - - - Required to cast the ValueType to an object for caching - - - - - Common functionality when creating adapters - - - - - Executes the specified expression. - - - The action. - - - - - Executes the specified action (for void methods). - - The action. - - - - Note: InMemoryLog keeps all logs in memory, so don't use it long running exceptions - - Returns a thread-safe InMemoryLog which you can use while *TESTING* - to provide a detailed analysis of your logs. - - - - - Creates a Unified Resource Name (URN) with the following formats: - - - urn:{TypeName}:{IdFieldValue} e.g. urn:UserSession:1 - - urn:{TypeName}:{IdFieldName}:{IdFieldValue} e.g. urn:UserSession:UserId:1 - - - - - - - Provide the an option for the callee to block until all commands are executed - - - - - - - Invokes the action provided and returns true if no excpetion was thrown. - Otherwise logs the exception and returns false if an exception was thrown. - - The action. - - - - - Runs an action for a minimum of runForMs - - What to run - Minimum ms to run for - time elapsed in micro seconds - - - - Returns average microseconds an action takes when run for the specified runForMs - - What to run - How many times to run for each iteration - Minimum ms to run for - - - - - - - + + + + ServiceStack.Common + + + + + + Provide the an option for the callee to block until all commands are executed + + + + + + + Return T[0] when enumerable is null, safe to use in enumerations like foreach + + + + + Gets the textual description of the enum if it has one. e.g. + + + enum UserColors + { + [Description("Bright Red")] + BrightRed + } + UserColors.BrightRed.ToDescription(); + + + + + + + + Default base sleep time (milliseconds). + + + + + Default maximum back-off time before retrying a request + + + + + Maximum retry limit. Avoids integer overflow issues. + + + + + How long to sleep before next retry using Exponential BackOff delay with Full Jitter. + + + + + + Exponential BackOff Delay with Full Jitter + + + + + + + Exponential BackOff Delay with Full Jitter from: + https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/retry/PredefinedBackoffStrategies.java + + + + + + + + + Calculate exponential retry back-off. + + + + + + + Calculate exponential retry back-off. + + + + + + + + + Invokes the action provided and returns true if no excpetion was thrown. + Otherwise logs the exception and returns false if an exception was thrown. + + The action. + + + + + Useful IPAddressExtensions from: + http://blogs.msdn.com/knom/archive/2008/12/31/ip-address-calculations-with-c-subnetmasks-networks.aspx + + + + + + Gets the ipv4 addresses from all Network Interfaces that have Subnet masks. + + + + + + Gets the ipv6 addresses from all Network Interfaces. + + + + + + Creates a Console Logger, that logs all messages to: System.Console + + Made public so its testable + + + + + Default logger is to Console.WriteLine + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Logs the specified message. + + + + + Logs the format. + + + + + Logs the specified message. + + + + + Creates a Debug Logger, that logs all messages to: System.Diagnostics.Debug + + Made public so its testable + + + + + Default logger is to System.Diagnostics.Debug.WriteLine + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Logs the specified message. + + + + + Logs the format. + + + + + Logs the specified message. + + + + + Categories of sql statements. + + + + + Unknown + + + + + DML statements that alter database state, e.g. INSERT, UPDATE + + + + + Statements that return a single record + + + + + Statements that iterate over a result set + + + + + A callback for ProfiledDbConnection and family + + + + + Called when a command starts executing + + + + + + + Called when a reader finishes executing + + + + + + + + Called when a reader is done iterating through the data + + + + + + Called when an error happens during execution of a command + + + + + + + + True if the profiler instance is active + + + + + Wraps a database connection, allowing sql execution timings to be collected when a session is started. + + + + + Returns a new that wraps , + providing query execution profiling. If profiler is null, no profiling will occur. + + Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection + The currently started or null. + Determines whether the ProfiledDbConnection will dispose the underlying connection. + + + + The underlying, real database connection to your db provider. + + + + + The current profiler instance; could be null. + + + + + The raw connection this is wrapping + + + + + Wrapper for a db provider factory to enable profiling + + + + + Every provider factory must have an Instance public field + + + + + Allow to re-init the provider factory. + + + + + + + proxy + + + + + + + proxy + + + + + proxy + + + + + proxy + + + + + proxy + + + + + proxy + + + + + proxy + + + + + proxy + + + + + proxy + + + + + proxy + + + + + Runs an action for a minimum of runForMs + + What to run + Minimum ms to run for + time elapsed in micro seconds + + + + Returns average microseconds an action takes when run for the specified runForMs + + What to run + How many times to run for each iteration + Minimum ms to run for + + + + + + + + Protect against XSS by cleaning non-standared User Input + + + + + Common functionality when creating adapters + + + + + Executes the specified expression. + + + The action. + + + + + Executes the specified action (for void methods). + + The action. + + + + Note: InMemoryLog keeps all logs in memory, so don't use it long running exceptions + + Returns a thread-safe InMemoryLog which you can use while *TESTING* + to provide a detailed analysis of your logs. + + + + + Use specified Layout + + + + + Use Layout with specified name + + + + + Render without any Layout + + + + + + + + + + Add additional Args available to all pages + + + + + Add additional template filters available to all pages + + + + + Return additional HTTP Headers in HTTP Requests + + + + + Specify the Content-Type of the Response + + + + + Transform the Page output using a chain of stream transformers + + + + + Transform the entire output using a chain of stream transformers + + + + + Available transformers that can transform context filter stream outputs + + + + + Don't allow access to specified filters + + + + + The last error thrown by a filter + + + + + The StackTrace where the Last Error Occured + + + + + What argument errors should be binded to + + + + + Whether to skip execution of all page filters and just write template string fragments + + + + + Overrides Context to specify whether to Ignore or Continue executing filters on error + + + + + Whether to always rethrow Exceptions + + + + + Immediately halt execution of the page + + + + + Rethrow fatal exceptions thrown on incorrect API usage + + + + + Available transformers that can transform context filter stream outputs + + + + How long in between checking for modified pages + + + + Render render filter exceptions in-line where filter is located + + + + + What argument to assign Fitler Exceptions to + + + + + Whether to + + + + + Creates a Unified Resource Name (URN) with the following formats: + + - urn:{TypeName}:{IdFieldValue} e.g. urn:UserSession:1 + - urn:{TypeName}:{IdFieldName}:{IdFieldValue} e.g. urn:UserSession:UserId:1 + + + + + diff --git a/lib/ServiceStack.Interfaces.dll b/lib/ServiceStack.Interfaces.dll new file mode 100644 index 00000000..17a19ac0 Binary files /dev/null and b/lib/ServiceStack.Interfaces.dll differ diff --git a/src/Docs/packages/ServiceStack.Interfaces.4.0.11/lib/net40/ServiceStack.Interfaces.xml b/lib/ServiceStack.Interfaces.xml similarity index 66% rename from src/Docs/packages/ServiceStack.Interfaces.4.0.11/lib/net40/ServiceStack.Interfaces.xml rename to lib/ServiceStack.Interfaces.xml index fd6b0866..80cdcaff 100644 --- a/src/Docs/packages/ServiceStack.Interfaces.4.0.11/lib/net40/ServiceStack.Interfaces.xml +++ b/lib/ServiceStack.Interfaces.xml @@ -4,10 +4,158 @@ ServiceStack.Interfaces - + + + Gets or sets parameter name with which allowable values will be associated. + + + + + Generates body DTO parameter only if `DisableAutoDtoInBodyParam = false` + + + + + Always generate body DTO for request + + + + + Never generate body DTO for request + + + + + The overall description of an API. Used by Swagger. + + + + + Create or not body param for request type when verb is POST or PUT. + Value can be one of the constants of `GenerateBodyParam` class: + `GenerateBodyParam.IfNotDisabled` (default value), `GenerateBodyParam.Always`, `GenerateBodyParam.Never` + + + + + Tells if body param is required + + + + + Gets or sets verb to which applies attribute. By default applies to all verbs. + + + + + Gets or sets parameter type: It can be only one of the following: path, query, body, form, or header. + + + + + Gets or sets unique name for the parameter. Each name must be unique, even if they are associated with different paramType values. + + + + Other notes on the name field: + If paramType is body, the name is used only for UI and codegeneration. + If paramType is path, the name field must correspond to the associated path segment from the path field in the api object. + If paramType is query, the name field corresponds to the query param name. + + + + + + Gets or sets the human-readable description for the parameter. + + + + + For path, query, and header paramTypes, this field must be a primitive. For body, this can be a complex or container datatype. + + + + + Fine-tuned primitive type definition. + + + + + For path, this is always true. Otherwise, this field tells the client whether or not the field must be supplied. + + + + + For query params, this specifies that a comma-separated list of values can be passed to the API. For path and body types, this field cannot be true. + + + + + Gets or sets route to which applies attribute, matches using StartsWith. By default applies to all routes. + + + + + Whether to exclude this property from being included in the ModelSchema + + + + + The status code of a response + + + + + The description of a response status code + + + + + HTTP status code of response + + + + + End-user description of the data which is returned by response + + + + + If set to true, the response is default for all non-explicity defined status codes + + + + + Open API schema definition type for response + + + + + The Password Hasher provider used to hash users passwords, by default uses the same algorithm used by ASP.NET Identity v3: + PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, 10000 iterations. + + + + + The first byte marker used to specify the format used. The default implementation uses the following format: + { 0x01, prf (UInt32), iter count (UInt32), salt length (UInt32), salt, subkey } + + + - Required when using a TypeDescriptor to make it unique + Returns a boolean indicating whether the matches the . + The out parameter indicates whether the password should be re-hashed. + The hash value for a user's stored password. + The password supplied for comparison. + Implementations of this method should be time consistent. + + + + Returns a hashed representation of the supplied . + + The password to hash. + A hashed representation of the supplied . @@ -108,17 +256,10 @@ The values. - - - Removes items from cache that have keys matching the specified wildcard pattern - - The wildcard, where "*" means any sequence of characters and "?" means any single character. - - + - Removes items from the cache based on the specified regular expression pattern + Extend ICacheClient API with shared, non-core features - Regular expression pattern to search cache keys @@ -210,11 +351,30 @@ a Dictionary holding all items indexed by their key. + + + Removes items from cache that have keys matching the specified wildcard pattern + + The wildcard, where "*" means any sequence of characters and "?" means any single character. + + + + Removes items from the cache based on the specified regular expression pattern + + Regular expression pattern to search cache keys + A Users Session + + + Store any object at key + + + + Set a typed value at key @@ -231,13 +391,18 @@ - + - Store any object at key + Remove the value at key + + + Delete all Cache Entries (requires ICacheClient that implements IRemoveByPattern) + + Retrieves a User Session @@ -245,7 +410,7 @@ - Gets the session for this request, creates one if it doesn't exist. + Gets the Session Bag for this request, creates one if it doesn't exist. @@ -253,29 +418,53 @@ - Gets the session for this request, creates one if it doesn't exist. + Gets the Session Bag for this request, creates one if it doesn't exist. Only for ASP.NET apps. Uses the HttpContext.Current singleton. + + + Create a Session Bag using a custom sessionId + + + + Allow delegation of dependencies to other IOC's - + - Resolve Property Dependency + Resolve Constructor Dependency - + - Resolve Constructor Dependency + Resolve a dependency from the AppHost's IOC + + + Provides a common interface for Settings providers such as + ConfigurationManager or Azure's RoleEnvironment. The only + requirement is that if the implementation cannot find the + specified key, the return value must be null + + The key for the setting + The string value of the specified key, or null if the key + was invalid + + + + Return all keys in this configuration source. + + + BelongToAttribute @@ -293,11 +482,21 @@ Decimal length attribute. + + + Mark types that are to be excluded from specified features + + Explicit foreign key name. If it's null, or empty, the FK name will be autogenerated as before. + + + Hash Key Attribute used to specify which property is the HashKey, e.g. in DynamoDb. + + IgnoreAttribute @@ -305,12 +504,42 @@ properties with this attribute are ignored when building sql sentences + + + Ignore this property in SELECT statements + + + + + Ignore this property in UPDATE statements + + + + + Ignore this property in INSERT statements + + + + + Decorate any type or property with adhoc info + + Primary key attribute. use to indicate that property is part of the pk + + + Range Key Attribute used to specify which property is the RangeKey, e.g. in DynamoDb. + + + + + Used to indicate that property is a row version incremented automatically by the database + + Used to annotate an Entity with its DB schema @@ -323,144 +552,159 @@ - + - Decorate any type or property with adhoc info + Generic ResponseStatus for when Response Type can't be inferred. + In schemaless formats like JSON, JSV it has the same shape as a typed Response DTO - + - Creates a Debug Logger, that logs all messages to: System.Diagnostics.Debug - - Made public so its testable + Contract indication that the Response DTO has a ResponseStatus - + - Factory to create ILog instances + Refresh file stats for this node if supported - + - Gets the logger. + How many results to skip - + - Gets the logger. + How many results to return - + - Default logger is to System.Diagnostics.Debug.WriteLine - - Made public so its testable + List of fields to sort by, can order by multiple fields and inverse order, e.g: Id,-Amount - + - Logs a message in a running application + List of fields to sort by descending, can order by multiple fields and inverse order, e.g: -Id,Amount - + - Logs a Debug message. + Include aggregate data like Total, COUNT(*), COUNT(DISTINCT Field), Sum(Amount), etc - The message. - + - Logs a Debug message and exception. + The fields to return - The message. - The exception. - + - Logs a Debug format message. + Populate with Include=Total or if registered with: AutoQueryFeature { IncludeTotal = true } - The format. - The args. - + - Logs a Error message. + Unifed API to create any missing Tables, Data Structure Schema + or perform any other tasks dependencies require to run at Startup. - The message. - + - Logs a Error message and exception. + Provide unique, incrementing sequences. Used in PocoDynamo. - The message. - The exception. - + - Logs a Error format message. + Marker interfaces - The format. - The args. - + - Logs a Fatal message. + The minimal API Surface to capture the most common SYNC requests. + Convenience extensions over these core API's available in ServiceGatewayExtensions - The message. - + - Logs a Fatal message and exception. + Normal Request/Reply Services - The message. - The exception. - + - Logs a Error format message. + Auto Batched Request/Reply Requests - The format. - The args. - + - Logs an Info message and exception. + OneWay Service - The message. - + - Logs an Info message and exception. + Auto Batched OneWay Requests - The message. - The exception. - + - Logs an Info format message. + The minimal API Surface to capture the most common ASYNC requests. + Convenience extensions over these core API's available in ServiceGatewayExtensions - The format. - The args. - + - Logs a Warning message. + Normal Request/Reply Services - The message. - + - Logs a Warning message and exception. + Auto Batched Request/Reply Requests - The message. - The exception. - + - Logs a Warning format message. + OneWay Service + + + + + Auto Batched OneWay Requests + + + + + Helper ILog implementation that reduces effort to extend or use without needing to impl each API + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Logs the specified message. + + + + + Logs the format. + + + + + Logs the specified message. + + + + + Logs a message in a running application - The format. - The args. @@ -470,61 +714,234 @@ true if this instance is debug enabled; otherwise, false. - + - Initializes a new instance of the class. + Logs a Debug message. + The message. - + - Initializes a new instance of the class. + Logs a Debug message and exception. + The message. + The exception. - + - Logs the specified message. + Logs a Debug format message. + The format. + The args. - + - Logs the format. + Logs a Error message. + The message. - + - Logs the specified message. + Logs a Error message and exception. + The message. + The exception. - + - Default logger is to System.Diagnostics.Debug.Print - - Made public so its testable + Logs a Error format message. + + The format. + The args. + + + + Logs a Fatal message. + The message. - + - Initializes a new instance of the class. + Logs a Fatal message and exception. + The message. + The exception. - + - Initializes a new instance of the class. + Logs a Error format message. + The format. + The args. - + - Logs the specified message. + Logs an Info message and exception. + + The message. + + + + Logs an Info message and exception. + The message. + The exception. - + - Logs the format. + Logs an Info format message. + The format. + The args. - + - Logs the specified message. + Logs a Warning message. + + The message. + + + + Logs a Warning message and exception. + + The message. + The exception. + + + + Logs a Warning format message. + + The format. + The args. + + + + Factory to create ILog instances + + + + + Gets the logger. + + + + + Gets the logger. + + + + + Pushes a property on the current log context, returning an + to remove the property again from the async context. + + Property Name + Property Value + Interface for popping the property off the stack + + + + Pushes a property on the current log context, returning an + to remove the property again from the async context. + + The logger + Property Name + Property Value + Interface for popping the property off the stack + + + + Logs a Debug format message and exception. + + Exception related to the event. + The format. + The args. + + + + Logs an Info format message and exception. + + Exception related to the event. + The format. + The args. + + + + Logs a Warn format message and exception. + + Exception related to the event. + The format. + The args. + + + + Logs an Error format message and exception. + + Exception related to the event. + The format. + The args. + + + + Logs a Fatal format message and exception. + + Exception related to the event. + The format. + The args. + + + + Logs a Debug format message and exception. + + The logger + Exception related to the event. + The format. + The args. + + + + Logs an Info format message and exception. + + The logger + Exception related to the event. + The format. + The args. + + + + Logs a Warn format message and exception. + + The logger + Exception related to the event. + The format. + The args. + + + + Logs an Error format message and exception. + + The logger + Exception related to the event. + The format. + The args. + + + + Logs a Fatal format message and exception. + + The logger + Exception related to the event. + The format. + The args. + + + + Provides access to log factories and loggers. This class cannot be inherited. + + + + + Gets or sets the log factory used to create loggers. The default value is + . @@ -534,12 +951,22 @@ Made public so its testable - + - StringBuilderLog writes to shared StringBuffer. + Default logger is to System.Diagnostics.Debug.Print Made public so its testable + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Logs the specified message. @@ -556,6 +983,12 @@ The message. + + + StringBuilderLog writes to shared StringBuffer. + Made public so its testable + + Creates a test Logger, that stores all log messages in a member list @@ -572,7 +1005,7 @@ Initializes a new instance of the class. - The type. + The type. @@ -600,32 +1033,47 @@ The message. - + - Contract indication that the Response DTO has a ResponseStatus + Single threaded message handler that can process all messages + of a particular message type. - + - Logging API for this library. You can inject your own implementation otherwise - will use the DebugLogFactory to write to System.Diagnostics.Debug + The type of the message this handler processes - + - Gets the logger. + The MqClient processing the message - + - Gets the logger. + Process all messages pending + - + + + Process messages from a single queue. + + + The queue to process + A predicate on whether to continue processing the next message if any + + + + + Process a single message + + + - Gets or sets the log factory. - Use this to override the factory that is used to create loggers + Get Current Stats for this Message Handler + @@ -662,32 +1110,65 @@ Create a typed message from a raw MQ Response artefact + + + Create a temporary Queue for Request / Reply + + + Simple definition of an MQ Host + + + Factory to create consumers and producers that work with this service + + - Register DTOs and hanlders the MQ Host will process + Register DTOs and hanlders the MQ Server will process + + + + + + + Register DTOs and hanlders the MQ Server will process using specified number of threads + - + - Register DTOs and hanlders the MQ Host will process + Register DTOs and hanlders the MQ Server will process + + + Register DTOs and hanlders the MQ Server will process using specified number of threads + + + + + + Get Total Current Stats for all Message Handlers + + + Get a list of all message types registered on this MQ Host + + Get the status of the service. Potential Statuses: Disposed, Stopped, Stopping, Starting, Started @@ -710,16 +1191,6 @@ Stop the MQ Host if not already stopped. - - - Factory to create consumers and producers that work with this service - - - - - Get a list of all message types registered on this MQ Host - - Basic implementation of IMessage[T] @@ -743,37 +1214,37 @@ retry attempts and store the message straight into the DLQ - + - Wrap the common redis list operations under a IList[string] interface. + Specify a VirtualPath or Layout for a Code Page - + - Redis transaction for typed client + Specify static page arguments - - + - interface to queueable operation using typed redis client + Wrap the common redis list operations under a IList[string] interface. - - + - Interface to redis typed pipeline + Redis transaction for typed client + - + - Pipeline interface shared by typed and non-typed pipelines + Interface to redis typed pipeline - + - Interface to operations that allow queued commands to be completed + interface to queueable operation using typed redis client + @@ -829,18 +1300,6 @@ - - - Subscribe to channels by name - - - - - - Subscribe to channels matching the supplied patterns - - - The number of active subscriptions this client has @@ -861,293 +1320,429 @@ Registered handler called when each channel is unsubscribed - - - Interface to redis transaction - - - - - Base transaction interface, shared by typed and non-typed transactions - - - - - interface to operation that can queue commands - - - + - Interface to redis pipeline + Subscribe to channels by name + - + - Gets or sets parameter name with which allowable values will be associated. + Subscribe to channels matching the supplied patterns + - + - The overall description of an API. Used by Swagger. + Interface to redis transaction - + - Gets or sets verb to which applies attribute. By default applies to all verbs. + Base transaction interface, shared by typed and non-typed transactions - + - Gets or sets parameter type: It can be only one of the following: path, query, body, or header. + Interface to redis pipeline - + - Gets or sets unique name for the parameter. Each name must be unique, even if they are associated with different paramType values. + Pipeline interface shared by typed and non-typed pipelines - - - Other notes on the name field: - If paramType is body, the name is used only for UI and codegeneration. - If paramType is path, the name field must correspond to the associated path segment from the path field in the api object. - If paramType is query, the name field corresponds to the query param name. - - - + - Gets or sets the human-readable description for the parameter. + interface to operation that can queue commands - + - For path, query, and header paramTypes, this field must be a primitive. For body, this can be a complex or container datatype. + Interface to operations that allow queued commands to be completed - + - For path, this is always true. Otherwise, this field tells the client whether or not the field must be supplied. + A log entry added by the IRequestLogger - + - For query params, this specifies that a comma-separated list of values can be passed to the API. For path and body types, this field cannot be true. + Error information pertaining to a particular named field. + Used for returning multiple field validation errors.s - + - The status code of a response + Common ResponseStatus class that should be present on all response DTO's - + - The description of a response status code + Initializes a new instance of the class. + + A response status without an errorcode == success - + - Marker interfaces + Initializes a new instance of the class. + A response status with an errorcode == failure - + - Implement on Request DTOs that need access to the raw Request Stream + Initializes a new instance of the class. + A response status with an errorcode == failure - + - The raw Http Request Input Stream + Holds the custom ErrorCode enum if provided in ValidationException + otherwise will hold the name of the Exception type, e.g. typeof(Exception).Name + + A value of non-null means the service encountered an error while processing the request. - + - Resolve a dependency from the AppHost's IOC + A human friendly error message - - - + - This interface can be implemented by an attribute - which adds an request filter for the specific request DTO the attribute marked. + The Server StackTrace when DebugMode is enabled - + - The request filter is executed before the service. + For multiple detailed validation errors. + Can hold a specific error message for each named field. - The http request wrapper - The http response wrapper - The request DTO - + - A new shallow copy of this filter is used on every request. + For additional custom metadata about the error - - + - Order in which Request Filters are executed. - <0 Executed before global request filters - >0 Executed after global request filters + Decorate on Request DTO's to alter the accessibility of a service and its visibility on /metadata pages - + - This interface can be implemented by an attribute - which adds an response filter for the specific response DTO the attribute marked. + Allow access but hide from metadata to requests from Localhost only - + - The response filter is executed after the service + Allow access but hide from metadata to requests from Localhost and Local Intranet only - The http request wrapper - The http response wrapper - + - A new shallow copy of this filter is used on every request. + Restrict access and hide from metadata to requests from Localhost only - - + - Order in which Response Filters are executed. - <0 Executed before global response filters - >0 Executed after global response filters + Restrict access and hide from metadata to requests from Localhost and Local Intranet only - + - The HTTP Response Status + Restrict access and hide from metadata to requests from External only - + - The HTTP Response Status Code + Sets a single access restriction + Restrict Access to. - + - The HTTP Status Description + Restrict access to any of the specified access scenarios + Access restrictions - + - The HTTP Response ContentType + Sets a single metadata Visibility restriction + Restrict metadata Visibility to. - + - Additional HTTP Headers + Restrict metadata visibility to any of the specified access scenarios + Visibility restrictions - + - Response DTO + Restrict access and metadata visibility to any of the specified access scenarios + The restrict access to scenarios. - + - if not provided, get's injected by ServiceStack + Restrict access and metadata visibility to any of the specified access scenarios + The restrict access to scenarios. - + - Holds the request call context + Returns the allowed set of scenarios based on the user-specified restrictions + + - + - A thin wrapper around ASP.NET or HttpListener's HttpRequest + Converts from a User intended restriction to a flag with all the allowed attribute flags set, e.g: + + If No Network restrictions were specified all Network access types are allowed, e.g: + restrict EndpointAttributes.None => ... 111 + + If a Network restriction was specified, only it will be allowed, e.g: + restrict EndpointAttributes.LocalSubnet => ... 010 + + The returned Enum will have a flag with all the allowed attributes set + + - + - A thin wrapper around each host's Request e.g: ASP.NET, HttpListener, MQ, etc + Used to decorate Request DTO's to associate a RESTful request + path mapping with a service. Multiple attributes can be applied to + each request DTO, to map multiple paths to the service. - + - The entire string contents of Request.InputStream + Initializes an instance of the class. - + + The path template to map to the request. See + RouteAttribute.Path + for details on the correct format. + - + - The underlying ASP.NET or HttpListener HttpRequest + Initializes an instance of the class. + + The path template to map to the request. See + RouteAttribute.Path + for details on the correct format. + + A comma-delimited list of HTTP verbs supported by the + service. If unspecified, all verbs are assumed to be supported. - + - The name of the service being called (e.g. Request DTO Name) + Gets or sets the path template to be mapped to the request. - - - - The Verb / HttpMethod or Action for this request + + A value providing the path mapped to + the request. Never . + + + Some examples of valid paths are: + + + "/Inventory" + "/Inventory/{Category}/{ItemId}" + "/Inventory/{ItemPath*}" + + + Variables are specified within "{}" + brackets. Each variable in the path is mapped to the same-named property + on the request DTO. At runtime, ServiceStack will parse the + request URL, extract the variable values, instantiate the request DTO, + and assign the variable values into the corresponding request properties, + prior to passing the request DTO to the service object for processing. + + It is not necessary to specify all request properties as + variables in the path. For unspecified properties, callers may provide + values in the query string. For example: the URL + "http://services/Inventory?Category=Books&ItemId=12345" causes the same + request DTO to be processed as "http://services/Inventory/Books/12345", + provided that the paths "/Inventory" (which supports the first URL) and + "/Inventory/{Category}/{ItemId}" (which supports the second URL) + are both mapped to the request DTO. + + Please note that while it is possible to specify property values + in the query string, it is generally considered to be less RESTful and + less desirable than to specify them as variables in the path. Using the + query string to specify property values may also interfere with HTTP + caching. + + The final variable in the path may contain a "*" suffix + to grab all remaining segments in the path portion of the request URL and assign + them to a single property on the request DTO. + For example, if the path "/Inventory/{ItemPath*}" is mapped to the request DTO, + then the request URL "http://services/Inventory/Books/12345" will result + in a request DTO whose ItemPath property contains "Books/12345". + You may only specify one such variable in the path, and it must be positioned at + the end of the path. + + + + + Gets or sets short summary of what the route does. - + - Optional preferences for the processing of this Request + Gets or sets longer text to explain the behaviour of the route. - + - The Request DTO, after it has been deserialized. + Gets or sets a comma-delimited list of HTTP verbs supported by the service, such as + "GET,PUT,POST,DELETE". + + A providing a comma-delimited list of HTTP verbs supported + by the service, or empty if all verbs are supported. + - + - The request ContentType + Used to rank the precedences of route definitions in reverse routing. + i.e. Priorities below 0 are auto-generated have less precedence. - + - The expected Response ContentType for this request + Must match rule defined in Config.RequestRules or Regex expression with format: + "{IHttpRequest.Field} =~ {pattern}", e.g "PathInfo =~ \/[0-9]+$" - + - Whether the ResponseContentType has been explicitly overrided or whether it was just the default + Fallback routes have the lowest precedence, i.e. after normal Routes, static files or any matching Catch All Handlers. - + - Attach any data to this request that all filters and services can access. + Additional checks to notify of invalid state, configuration or use of ServiceStack libraries. + Can disable StrictMode checks with Config.StrictMode = false; - + - Buffer the Request InputStream so it can be re-read + Get or sets tag name - + - The Remote Ip as reported by Request.UserHostAddress + Get or sets operation verbs for which the attribute be applied - + - The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress + Adds an expired Set-Cookie instruction for clients to delete this Cookie - + - e.g. is https or not + Adds a new Set-Cookie instruction for ss-pid - + - Access to the multi-part/formdata files posted on this request + Adds a new Set-Cookie instruction for ss-id - + - The value of the Referrer, null if not available + Order in which Request Filters are executed. + <0 Executed before global request filters + >0 Executed after global request filters + + + + + A new shallow copy of this filter is used on every request. + + + + + + This interface can be implemented by an attribute + which adds an request filter for the specific request DTO the attribute marked. + + + + + The request filter is executed before the service. + + The http request wrapper + The http response wrapper + The request DTO + + + + This interface can be implemented by an attribute + which adds an request filter for the specific request DTO the attribute marked. + + + + + The request filter is executed before the service. + + The http request wrapper + The http response wrapper + The request DTO + + + + Order in which Response Filters are executed. + <0 Executed before global response filters + >0 Executed after global response filters + + + + + A new shallow copy of this filter is used on every request. + + + + + + This interface can be implemented by an attribute + which adds an response filter for the specific response DTO the attribute marked. + + + + + The response filter is executed after the service + + The http request wrapper + The http response wrapper + + + + This interface can be implemented by an attribute + which adds an response filter for the specific response DTO the attribute marked. + + + + + The response filter is executed after the service + + The http request wrapper + The http response wrapper + + + + A thin wrapper around ASP.NET or HttpListener's HttpRequest @@ -1180,506 +1775,625 @@ The value of the X-Real-IP header, null if null or empty + + + The value of the Accept HTTP Request Header + + A thin wrapper around ASP.NET or HttpListener's HttpResponse - + - A thin wrapper around each host's Response e.g: ASP.NET, HttpListener, MQ, etc + Adds a new Set-Cookie instruction to Response + - + - Signal that this response has been handled and no more processing should be done. - When used in a request or response filter, no more filters or processing is done on this request. + Removes all pending Set-Cookie instructions - + - Calls Response.End() on ASP.NET HttpResponse otherwise is an alias for Close(). - Useful when you want to prevent ASP.NET to provide it's own custom error page. + The HTTP Response Status - + - Response.Flush() and OutputStream.Flush() seem to have different behaviour in ASP.NET + The HTTP Response Status Code - + - The underlying ASP.NET or HttpListener HttpResponse + The HTTP Status Description - + - The Response DTO + The HTTP Response ContentType - + - Gets a value indicating whether this instance is closed. + Additional HTTP Headers - + - Log every service request + Additional HTTP Cookies - + - Log a request + Response DTO - The RequestContext - Request DTO - Response DTO or Exception - How long did the Request take - + - View the most recent logs + if not provided, get's injected by ServiceStack - - - + - Turn On/Off Session Tracking + Holds the request call context - + - Turn On/Off Raw Request Body Tracking + The padding length written with the body, to be added to ContentLength of body - + - Turn On/Off Tracking of Responses + Serialize the Response within the specified scope - + - Turn On/Off Tracking of Exceptions + Whether this HttpResult allows Partial Response - + - Limit access to /requestlogs service to role + Write a partial content result - + - Don't log requests of these types. + Whether this HttpResult allows Partial Response - + - Don't log request bodys for services with sensitive information. - By default Auth and Registration requests are hidden. + Write a partial content result - + - Implement on services that need access to the RequestContext + A thin wrapper around each host's Request e.g: ASP.NET, HttpListener, MQ, etc - + - Responsible for executing the operation within the specified context. + The underlying ASP.NET or HttpListener HttpRequest - The operation types. - + - Returns the first matching RestPath + The Response API for this Request - + - Executes the MQ DTO request. + The name of the service being called (e.g. Request DTO Name) - + - Executes the MQ DTO request with the supplied requestContext + The Verb / HttpMethod or Action for this request - + - Executes the DTO request under the supplied requestContext. + Different Attribute Enum flags classifying this Request - + - Executes the DTO request with an empty RequestContext. + Optional preferences for the processing of this Request - + - Allow the registration of user-defined routes for services + The Request DTO, after it has been deserialized. - + - Maps the specified REST path to the specified request DTO. + The request ContentType - The type of request DTO to map - the path to. - The path to map the request DTO to. - See RouteAttribute.Path - for details on the correct format. - The same instance; - never . - + - Maps the specified REST path to the specified request DTO, and - specifies the HTTP verbs supported by the path. + Whether this was an Internal Request - The type of request DTO to map - the path to. - The path to map the request DTO to. - See RouteAttribute.Path - for details on the correct format. - - The comma-delimited list of HTTP verbs supported by the path, - such as "GET,PUT,DELETE". Specify empty or - to indicate that all verbs are supported. - - The same instance; - never . - + - Maps the specified REST path to the specified request DTO, - specifies the HTTP verbs supported by the path, and indicates - the default MIME type of the returned response. + The UserAgent for the request - - The type of request DTO to map the path to. - - The path to map the request DTO to. - See RouteAttribute.Path - for details on the correct format. - - The comma-delimited list of HTTP verbs supported by the path, - such as "GET,PUT,DELETE". - - The same instance; - never . - + - Maps the specified REST path to the specified request DTO, - specifies the HTTP verbs supported by the path, and indicates - the default MIME type of the returned response. + A Dictionary of HTTP Cookies sent with this Request - - Used to rank the precedences of route definitions in reverse routing. - i.e. Priorities below 0 are auto-generated have less precedence. - - + - Maps the specified REST path to the specified request DTO, - specifies the HTTP verbs supported by the path, and indicates - the default MIME type of the returned response. + The expected Response ContentType for this request - - The type of request DTO to map the path to. - - The path to map the request DTO to. - See RouteAttribute.Path - for details on the correct format. - - The comma-delimited list of HTTP verbs supported by the path, - such as "GET,PUT,DELETE". - - - The short summary of what the REST does. - - - The longer text to explain the behaviour of the REST. - - The same instance; - never . - + - Used to decorate Request DTO's to associate a RESTful request - path mapping with a service. Multiple attributes can be applied to - each request DTO, to map multiple paths to the service. + Whether the ResponseContentType has been explicitly overrided or whether it was just the default - + - Initializes an instance of the class. + Attach any data to this request that all filters and services can access. - - The path template to map to the request. See - RouteAttribute.Path - for details on the correct format. - - + - Initializes an instance of the class. + The HTTP Headers in a NameValueCollection - - The path template to map to the request. See - RouteAttribute.Path - for details on the correct format. - - A comma-delimited list of HTTP verbs supported by the - service. If unspecified, all verbs are assumed to be supported. - + - Gets or sets the path template to be mapped to the request. + The ?query=string in a NameValueCollection - - A value providing the path mapped to - the request. Never . - - - Some examples of valid paths are: - - - "/Inventory" - "/Inventory/{Category}/{ItemId}" - "/Inventory/{ItemPath*}" - - - Variables are specified within "{}" - brackets. Each variable in the path is mapped to the same-named property - on the request DTO. At runtime, ServiceStack will parse the - request URL, extract the variable values, instantiate the request DTO, - and assign the variable values into the corresponding request properties, - prior to passing the request DTO to the service object for processing. - - It is not necessary to specify all request properties as - variables in the path. For unspecified properties, callers may provide - values in the query string. For example: the URL - "http://services/Inventory?Category=Books&ItemId=12345" causes the same - request DTO to be processed as "http://services/Inventory/Books/12345", - provided that the paths "/Inventory" (which supports the first URL) and - "/Inventory/{Category}/{ItemId}" (which supports the second URL) - are both mapped to the request DTO. - - Please note that while it is possible to specify property values - in the query string, it is generally considered to be less RESTful and - less desirable than to specify them as variables in the path. Using the - query string to specify property values may also interfere with HTTP - caching. - - The final variable in the path may contain a "*" suffix - to grab all remaining segments in the path portion of the request URL and assign - them to a single property on the request DTO. - For example, if the path "/Inventory/{ItemPath*}" is mapped to the request DTO, - then the request URL "http://services/Inventory/Books/12345" will result - in a request DTO whose ItemPath property contains "Books/12345". - You may only specify one such variable in the path, and it must be positioned at - the end of the path. - - + - Gets or sets short summary of what the route does. + The HTTP POST'ed Form Data in a NameValueCollection - + - Gets or sets longer text to explain the behaviour of the route. + Buffer the Request InputStream so it can be re-read - + - Gets or sets a comma-delimited list of HTTP verbs supported by the service, such as - "GET,PUT,POST,DELETE". + The entire string contents of Request.InputStream - - A providing a comma-delimited list of HTTP verbs supported - by the service, or empty if all verbs are supported. - + - + - Used to rank the precedences of route definitions in reverse routing. - i.e. Priorities below 0 are auto-generated have less precedence. + Relative URL containing /path/info?query=string - + - Fallback routes have the lowest precedence, i.e. after normal Routes, static files or any matching Catch All Handlers. + The Absolute URL for the request - + - Generic ResponseStatus for when Response Type can't be inferred. - In schemaless formats like JSON, JSV it has the same shape as a typed Response DTO + The Remote IP as reported by Request.UserHostAddress - + - A log entry added by the IRequestLogger + The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress - + - Decorate on Request DTO's to alter the accessibility of a service and its visibility on /metadata pages + The value of the Authorization Header used to send the Api Key, null if not available - + - Restrict access and metadata visibility to any of the specified access scenarios + e.g. is https or not - The restrict access to scenarios. - + - Restrict access and metadata visibility to any of the specified access scenarios + Array of different Content-Types accepted by the client - The restrict access to scenarios. - + - Returns the allowed set of scenarios based on the user-specified restrictions + The normalized /path/info for the request - - - + - Allow access but hide from metadata to requests from Localhost only + The original /path/info as sent - + - Allow access but hide from metadata to requests from Localhost and Local Intranet only + The Request Body Input Stream - + - Restrict access and hide from metadata to requests from Localhost and Local Intranet only + The size of the Request Body if provided - + - Restrict access and hide from metadata to requests from Localhost only + Access to the multi-part/formdata files posted on this request - + - Sets a single access restriction + The value of the Referrer, null if not available - Restrict Access to. - + - Restrict access to any of the specified access scenarios + Log every service request - Access restrictions - + - Sets a single metadata Visibility restriction + Turn On/Off Session Tracking - Restrict metadata Visibility to. - + - Restrict metadata visibility to any of the specified access scenarios + Turn On/Off Raw Request Body Tracking - Visibility restrictions - + - Converts from a User intended restriction to a flag with all the allowed attribute flags set, e.g: - - If No Network restrictions were specified all Network access types are allowed, e.g: - restrict EndpointAttributes.None => ... 111 - - If a Network restriction was specified, only it will be allowed, e.g: - restrict EndpointAttributes.LocalSubnet => ... 010 - - The returned Enum will have a flag with all the allowed attributes set + Turn On/Off Tracking of Responses - - - + - Error information pertaining to a particular named field. - Used for returning multiple field validation errors.s + Turn On/Off Tracking of Exceptions - + - Common ResponseStatus class that should be present on all response DTO's + Limit logging to only Service Requests - + - Initializes a new instance of the class. - - A response status without an errorcode == success + Limit access to /requestlogs service to role - + - Initializes a new instance of the class. - - A response status with an errorcode == failure + Don't log matching requests - + - Initializes a new instance of the class. - - A response status with an errorcode == failure + Don't log requests of these types. - + - Holds the custom ErrorCode enum if provided in ValidationException - otherwise will hold the name of the Exception type, e.g. typeof(Exception).Name - - A value of non-null means the service encountered an error while processing the request. + Don't log request bodys for services with sensitive information. + By default Auth and Registration requests are hidden. - + - A human friendly error message + Log a request + The RequestContext + Request DTO + Response DTO or Exception + How long did the Request take - + - + View the most recent logs + + - + - For multiple detailed validation errors. - Can hold a specific error message for each named field. + Implement on services that need access to the RequestContext - + - Write a partial content result + Implement on Request DTOs that need access to the raw Request Stream - + - Whether this HttpResult allows Partial Response + The raw Http Request Input Stream - + + + A thin wrapper around each host's Response e.g: ASP.NET, HttpListener, MQ, etc + + + + + The underlying ASP.NET, .NET Core or HttpListener HttpResponse + + + - Sends the specified request. + The corresponding IRequest API for this Response - The request. + + + + The Response Status Code + + + + + The Response Status Description + + + + + The Content-Type for this Response + + + + + Add a Header to this Response + + + + + + + Remove an existing Header added on this Response + + + + + + Get an existing Header added to this Response + + + + + Return a Redirect Response to the URL specified + + + + + + The Response Body Output Stream + + + + + The Response DTO + + + + + Buffer the Response OutputStream so it can be written in 1 batch + + + + + Signal that this response has been handled and no more processing should be done. + When used in a request or response filter, no more filters or processing is done on this request. + + + + + Calls Response.End() on ASP.NET HttpResponse otherwise is an alias for Close(). + Useful when you want to prevent ASP.NET to provide it's own custom error page. + + + + + Response.Flush() and OutputStream.Flush() seem to have different behaviour in ASP.NET + + + + + Flush this Response Output Stream Async + + + + + + + Gets a value indicating whether this instance is closed. + + + + + Set the Content Length in Bytes for this Response + + + + + + Whether the underlying TCP Connection for this Response should remain open + + + + + Whether the HTTP Response Headers have already been written. + + + + + Responsible for executing the operation within the specified context. + + The operation types. + + + + Returns the first matching RestPath + + + + + Executes the MQ DTO request. + + + + + Executes the MQ DTO request with the supplied requestContext + + + + + Executes the DTO request under the supplied requestContext. + + + + + Executes the DTO request under supplied context and option to Execute Request/Response Filters. + + + + + Executes the DTO request with an empty RequestContext. + + + + + Executes the DTO request with the current HttpRequest and option to Execute Request/Response Filters. + + + + + Allow the registration of user-defined routes for services + + + + + Maps the specified REST path to the specified request DTO. + + The type of request DTO to map + the path to. + The path to map the request DTO to. + See RouteAttribute.Path + for details on the correct format. + The same instance; + never . + + + + Maps the specified REST path to the specified request DTO, and + specifies the HTTP verbs supported by the path. + + The type of request DTO to map + the path to. + The path to map the request DTO to. + See RouteAttribute.Path + for details on the correct format. + + The comma-delimited list of HTTP verbs supported by the path, + such as "GET,PUT,DELETE". Specify empty or + to indicate that all verbs are supported. + + The same instance; + never . + + + + Maps the specified REST path to the specified request DTO, + specifies the HTTP verbs supported by the path, and indicates + the default MIME type of the returned response. + + + The type of request DTO to map the path to. + + The path to map the request DTO to. + See RouteAttribute.Path + for details on the correct format. + + The comma-delimited list of HTTP verbs supported by the path, + such as "GET,PUT,DELETE". + + The same instance; + never . + + + + Maps the specified REST path to the specified request DTO, + specifies the HTTP verbs supported by the path, and indicates + the default MIME type of the returned response. + + + Used to rank the precedences of route definitions in reverse routing. + i.e. Priorities below 0 are auto-generated have less precedence. + + + + + Maps the specified REST path to the specified request DTO, + specifies the HTTP verbs supported by the path, and indicates + the default MIME type of the returned response. + + + The type of request DTO to map the path to. + + The path to map the request DTO to. + See RouteAttribute.Path + for details on the correct format. + + The comma-delimited list of HTTP verbs supported by the path, + such as "GET,PUT,DELETE". + + + The short summary of what the REST does. + + + The longer text to explain the behaviour of the REST. + + The same instance; + never . + + + + Maps the specified REST path to the specified request DTO, + specifies the HTTP verbs supported by the path, and indicates + the default MIME type of the returned response. + + + The type of request DTO to map the path to. + + The path to map the request DTO to. + See RouteAttribute.Path + for details on the correct format. + + The comma-delimited list of HTTP verbs supported by the path, + such as "GET,PUT,DELETE". + + + The short summary of what the REST does. + + + The longer text to explain the behaviour of the REST. + + + Must match rule defined in Config.RequestRules or Regex expression with format: + "{IHttpRequest.Field} =~ {pattern}", e.g "PathInfo =~ \/[0-9]+$" + + The same instance; + never . + diff --git a/lib/ServiceStack.OrmLite.Sqlite.dll b/lib/ServiceStack.OrmLite.Sqlite.dll new file mode 100644 index 00000000..0e1eb221 Binary files /dev/null and b/lib/ServiceStack.OrmLite.Sqlite.dll differ diff --git a/lib/ServiceStack.OrmLite.Sqlite.xml b/lib/ServiceStack.OrmLite.Sqlite.xml new file mode 100644 index 00000000..e82b4688 --- /dev/null +++ b/lib/ServiceStack.OrmLite.Sqlite.xml @@ -0,0 +1,13 @@ + + + + ServiceStack.OrmLite.Sqlite + + + + + New behavior from using System.Data.SQLite.Core + + + + diff --git a/lib/ServiceStack.OrmLite.dll b/lib/ServiceStack.OrmLite.dll new file mode 100644 index 00000000..060ae2ea Binary files /dev/null and b/lib/ServiceStack.OrmLite.dll differ diff --git a/lib/ServiceStack.OrmLite.xml b/lib/ServiceStack.OrmLite.xml new file mode 100644 index 00000000..b01739a3 --- /dev/null +++ b/lib/ServiceStack.OrmLite.xml @@ -0,0 +1,4536 @@ + + + + ServiceStack.OrmLite + + + + + Represents the key aspects of a sql operation + + + + + The command (sql or a stored-procedure name) to execute + + + + + The parameters associated with the command + + + + + The active transaction for the command + + + + + The effective timeout for the command + + + + + The type of command that the command-text represents + + + + + Should data be buffered before returning? + + + + + Should the plan for this query be cached? + + + + + Additional state flags against this command + + + + + Can async queries be pipelined? + + + + + Initialize the command definition + + + + + For asynchronous operations, the cancellation-token + + + + + Additional state flags that control command behaviour + + + + + No additional flags + + + + + Should data be buffered before returning? + + + + + Can async queries be pipelined? + + + + + Should the plan cache be bypassed? + + + + + Implements custom property mapping by user provided criteria (usually presence of some custom attribute with column to member mapping) + + + + + Creates custom property mapping + + Target entity type + Property selector based on target type and DataReader column name + + + + Always returns default constructor + + DataReader column names + DataReader column types + Default constructor + + + + Always returns null + + + + + + Not implemented as far as default constructor used for all cases + + + + + + + + Returns property based on selector strategy + + DataReader column name + Poperty member map + + + + This class represents a SQL string, it can be used if you need to denote your parameter is a Char vs VarChar vs nVarChar vs nChar + + + + + Default value for IsAnsi. + + + + + A value to set the default value of strings + going through Dapper. Default is 4000, any value larger than this + field will not have the default value applied. + + + + + Create a new DbString + + + + + Ansi vs Unicode + + + + + Fixed length + + + + + Length of the string -1 for max + + + + + The value of the string + + + + + Add the parameter to the command... internal use only + + + + + + + Represents default type mapping strategy used by Dapper + + + + + Creates default type map + + Entity type + + + + Finds best constructor + + DataReader column names + DataReader column types + Matching constructor or default one + + + + Returns the constructor, if any, that has the ExplicitConstructorAttribute on it. + + + + + Gets mapping for constructor parameter + + Constructor to resolve + DataReader column name + Mapping implementation + + + + Gets member mapping for column + + DataReader column name + Mapping implementation + + + + Should column names like User_Id be allowed to match properties/fields like UserId ? + + + + + The settable properties for this typemap + + + + + A bag of parameters that can be passed to the Dapper Query and Execute methods + + + + + construct a dynamic parameter bag + + + + + construct a dynamic parameter bag + + can be an anonymous type or a DynamicParameters bag + + + + Append a whole object full of params to the dynamic + EG: AddDynamicParams(new {A = 1, B = 2}) // will add property A and B to the dynamic + + + + + + Add a parameter to this dynamic parameter list + + + + + Add a parameter to this dynamic parameter list + + + + + If true, the command-text is inspected and only values that are clearly used are included on the connection + + + + + Add all the parameters needed to the command just before it executes + + The raw command prior to execution + Information about the query + + + + All the names of the param in the bag, use Get to yank them out + + + + + Get the value of a parameter + + + + The value, note DBNull.Value is not returned, instead the value is returned as null + + + + Allows you to automatically populate a target property/field from output parameters. It actually + creates an InputOutput parameter, so you can still pass data in. + + + The object whose property/field you wish to populate. + A MemberExpression targeting a property/field of the target (or descendant thereof.) + + The size to set on the parameter. Defaults to 0, or DbString.DefaultLength in case of strings. + The DynamicParameters instance + + + + Tell Dapper to use an explicit constructor, passing nulls or 0s for all parameters + + + + + Handles variances in features per DBMS + + + + + Gets the feature set based on the passed connection + + + + + True if the db supports array columns e.g. Postgresql + + + + + Represents simple member map for one of target parameter or property or field to source DataReader column + + + + + Creates instance for simple property mapping + + DataReader column name + Target property + + + + Creates instance for simple field mapping + + DataReader column name + Target property + + + + Creates instance for simple constructor parameter mapping + + DataReader column name + Target constructor parameter + + + + DataReader column name + + + + + Target member type + + + + + Target property + + + + + Target field + + + + + Target constructor parameter + + + + + Used to pass a IEnumerable<SqlDataRecord> as a SqlDataRecordListTVPParameter + + + + + Create a new instance of SqlDataRecordListTVPParameter + + + + + Dapper, a light weight object mapper for ADO.NET + + + + + Execute a query asynchronously using .NET 4.5 Task. + + Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Execute a query asynchronously using .NET 4.5 Task. + + Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Execute a query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a query asynchronously using .NET 4.5 Task. + + + + + Execute a query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a single-row query asynchronously using .NET 4.5 Task. + + + + + Execute a command asynchronously using .NET 4.5 Task. + + + + + Execute a command asynchronously using .NET 4.5 Task. + + + + + Maps a query to objects + + The first type in the recordset + The second type in the recordset + The return type + + + + + + + The field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + Is it a stored proc or a batch? + + + + + Maps a query to objects + + The first type in the recordset + The second type in the recordset + The return type + + The field we should split and read the second object from (default: id) + The command to execute + + + + + + Maps a query to objects + + + + + + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + + + + + + Maps a query to objects + + + + + + + The field we should split and read the second object from (default: id) + The command to execute + + + + + + Perform a multi mapping query with 4 input parameters + + + + + + + + + + + + + + + + + + + + Perform a multi mapping query with 4 input parameters + + + + + + + + The field we should split and read the second object from (default: id) + The command to execute + + + + + + Perform a multi mapping query with 5 input parameters + + + + + Perform a multi mapping query with 5 input parameters + + + + + Perform a multi mapping query with 6 input parameters + + + + + Perform a multi mapping query with 6 input parameters + + + + + Perform a multi mapping query with 7 input parameters + + + + + Perform a multi mapping query with 7 input parameters + + + + + Perform a multi mapping query with arbitrary input parameters + + The return type + + + array of types in the recordset + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + Is it a stored proc or a batch? + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Execute parameterized SQL and return an + + An that can be used to iterate over the results of the SQL query. + + This is typically used when the results of a query are not processed by Dapper, for example, used to fill a + or . + + + + + + + + + + Execute parameterized SQL and return an + + An that can be used to iterate over the results of the SQL query. + + This is typically used when the results of a query are not processed by Dapper, for example, used to fill a + or . + + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Called if the query cache is purged via PurgeQueryCache + + + + + Purge the query cache + + + + + Return a count of all the cached queries by dapper + + + + + + Return a list of all the queries cached by dapper + + + + + + + Deep diagnostics only: find any hash collisions in the cache + + + + + + Clear the registered type handlers + + + + + Configure the specified type to be mapped to a given db-type + + + + + Configure the specified type to be processed by a custom handler + + + + + Configure the specified type to be processed by a custom handler + + + + + Configure the specified type to be processed by a custom handler + + + + + Get the DbType that maps to a given value + + + + + OBSOLETE: For internal usage only. Lookup the DbType and handler for a given Type and member + + + + + Obtains the data as a list; if it is *already* a list, the original object is returned without + any duplication; otherwise, ToList() is invoked. + + + + + Execute parameterized SQL + + Number of rows affected + + + + Execute parameterized SQL + + Number of rows affected + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Execute parameterized SQL that selects a single value + + The first cell selected + + + + Execute parameterized SQL and return an + + An that can be used to iterate over the results of the SQL query. + + This is typically used when the results of a query are not processed by Dapper, for example, used to fill a + or . + + + + + + + + + + Execute parameterized SQL and return an + + An that can be used to iterate over the results of the SQL query. + + This is typically used when the results of a query are not processed by Dapper, for example, used to fill a + or . + + + + + Execute parameterized SQL and return an + + An that can be used to iterate over the results of the SQL query. + + This is typically used when the results of a query are not processed by Dapper, for example, used to fill a + or . + + + + + Return a sequence of dynamic objects with properties matching the columns + + Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Return a dynamic object with properties matching the columns + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Return a dynamic object with properties matching the columns + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Return a dynamic object with properties matching the columns + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Return a dynamic object with properties matching the columns + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Executes a query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per T + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per the Type suggested + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per the Type suggested + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per the Type suggested + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per the Type suggested + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a single-row query, returning the data typed as per the Type suggested + + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object + A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object + A single instance or null of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object + A single or null instance of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object + A single instance of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Executes a query, returning the data typed as per T + + the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object + A single instance of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is + created per row, and a direct column-name===member-name mapping is assumed (case insensitive). + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Maps a query to objects + + The first type in the record set + The second type in the record set + The return type + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + Is it a stored proc or a batch? + + + + + Maps a query to objects + + + + + + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + + + + + + Perform a multi mapping query with 4 input parameters + + + + + + + + + + + + + + + + + + + + Perform a multi mapping query with 5 input parameters + + + + + + + + + + + + + + + + + + + + + Perform a multi mapping query with 6 input parameters + + + + + + + + + + + + + + + + + + + + + + Perform a multi mapping query with 7 input parameters + + + + + + + + + + + + + + + + + + + + + + + Perform a multi mapping query with arbitrary input parameters + + The return type + + + array of types in the record set + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + Is it a stored proc or a batch? + + + + + Internal use only + + + + + + + Internal use only + + + + + Internal use only + + + + + Internal use only + + + + + OBSOLETE: For internal usage only. Sanitizes the paramter value with proper type casting. + + + + + Replace all literal tokens with their text form + + + + + Convert numeric values to their string form for SQL literal purposes + + + + + Internal use only + + + + + Gets type-map for the given type + + Type map instance, default is to create new instance of DefaultTypeMap + + + + Gets type-map for the given type + + Type map implementation, DefaultTypeMap instance if no override present + + + + Set custom mapping for type deserializers + + Entity type to override + Mapping rules impementation, null to remove custom map + + + + Internal use only + + + + + + + + + + + Throws a data exception, only used internally + + + + + How should connection strings be compared for equivalence? Defaults to StringComparer.Ordinal. + Providing a custom implementation can be useful for allowing multi-tenancy databases with identical + schema to share strategies. Note that usual equivalence rules apply: any equivalent connection strings + MUST yield the same hash-code. + + + + + Key used to indicate the type name associated with a DataTable + + + + + Used to pass a DataTable as a TableValuedParameter + + + + + Associate a DataTable with a type name + + + + + Fetch the type name associated with a DataTable + + + + + Used to pass a IEnumerable<SqlDataRecord> as a TableValuedParameter + + + + + Dummy type for excluding from multi-map + + + + + The grid reader provides interfaces for reading multiple result sets from a Dapper query + + + + + Read the next grid of results, returned as a dynamic object + + Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read the next grid of results, returned as a dynamic object + + Note: each row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read an individual row of the next grid of results, returned as a dynamic object + + Note: the row can be accessed via "dynamic", or by casting to an IDictionary<string,object> + + + + Read the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read an individual row of the next grid of results + + + + + Read multiple objects from a single record set on the grid + + + + + Read multiple objects from a single record set on the grid + + + + + Read multiple objects from a single record set on the grid + + + + + Read multiple objects from a single record set on the grid + + + + + Read multiple objects from a single record set on the grid + + + + + Read multiple objects from a single record set on the grid + + + + + Read multiple objects from a single record set on the grid + + + + + Has the underlying reader been consumed? + + + + + The command associated with the reader + + + + + Dispose the grid, closing and disposing both the underlying reader and command. + + + + + Implement this interface to pass an arbitrary db specific parameter to Dapper + + + + + Add the parameter needed to the command before it executes + + The raw command prior to execution + Parameter name + + + + Parses a data reader to a sequence of data of the supplied type. Used for deserializing a reader without a connection, etc. + + + + + Parses a data reader to a sequence of data of the supplied type (as object). Used for deserializing a reader without a connection, etc. + + + + + Parses a data reader to a sequence of dynamic. Used for deserializing a reader without a connection, etc. + + + + + Gets the row parser for a specific row on a data reader. This allows for type switching every row based on, for example, a TypeId column. + You could return a collection of the base type but have each more specific. + + The data reader to get the parser for the current row from + The type to get the parser for + The start column index of the object (default 0) + The length of columns to read (default -1 = all fields following startIndex) + Return null if we can't find the first column? (default false) + A parser for this specific object from this row. + + + + Gets the row parser for a specific row on a data reader. This allows for type switching every row based on, for example, a TypeId column. + You could return a collection of the base type but have each more specific. + + The data reader to get the parser for the current row from + The type to get the parser for + The start column index of the object (default 0) + The length of columns to read (default -1 = all fields following startIndex) + Return null if we can't find the first column? (default false) + A parser for this specific object from this row. + + var result = new List<BaseType>(); + using (var reader = connection.ExecuteReader(@" + select 'abc' as Name, 1 as Type, 3.0 as Value + union all + select 'def' as Name, 2 as Type, 4.0 as Value")) + { + if (reader.Read()) + { + var toFoo = reader.GetRowParser<BaseType>(typeof(Foo)); + var toBar = reader.GetRowParser<BaseType>(typeof(Bar)); + var col = reader.GetOrdinal("Type"); + do + { + switch (reader.GetInt32(col)) + { + case 1: + result.Add(toFoo(reader)); + break; + case 2: + result.Add(toBar(reader)); + break; + } + } while (reader.Read()); + } + } + + abstract class BaseType + { + public abstract int Type { get; } + } + class Foo : BaseType + { + public string Name { get; set; } + public override int Type => 1; + } + class Bar : BaseType + { + public float Value { get; set; } + public override int Type => 2; + } + + + + + Identity of a cached query in Dapper, used for extensibility + + + + + Create an identity for use with DynamicParameters, internal use only + + + + + + + + + + + + + + The sql + + + + + The command type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Compare 2 Identity objects + + + + + + + Implement this interface to pass an arbitrary db specific set of parameters to Dapper + + + + + Add all the parameters needed to the command just before it executes + + The raw command prior to execution + Information about the query + + + + Implements this interface to provide custom member mapping + + + + + Source DataReader column name + + + + + Target member type + + + + + Target property + + + + + Target field + + + + + Target constructor parameter + + + + + Extends IDynamicParameters with facilities for executing callbacks after commands have completed + + + + + Invoked when the command has executed + + + + + Extends IDynamicParameters providing by-name lookup of parameter values + + + + + Get the value of the specified parameter (return null if not found) + + + + + Implement this interface to perform custom type-based parameter handling and value parsing + + + + + Assign the value of a parameter before a command executes + + The parameter to configure + Parameter value + + + + Parse a database value back to a typed value + + The value from the database + The type to parse to + The typed value + + + + Implement this interface to change default mapping of reader columns to type members + + + + + Finds best constructor + + DataReader column names + DataReader column types + Matching constructor or default one + + + + Returns a constructor which should *always* be used. + + Parameters will be default values, nulls for reference types and zero'd for value types. + + Use this class to force object creation away from parameterless constructors you don't control. + + + + + Gets mapping for constructor parameter + + Constructor to resolve + DataReader column name + Mapping implementation + + + + Gets member mapping for column + + DataReader column name + Mapping implementation + + + + This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), + and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** + equality. The type is fully thread-safe. + + + + + Represents a placeholder for a value that should be replaced as a literal value in the resulting sql + + + + + The text in the original command that should be replaced + + + + + The name of the member referred to by the token + + + + + Permits specifying certain SqlMapper values globally. + + + + + Resets all Settings to their default values + + + + + Specifies the default Command Timeout for all Queries + + + + + Indicates whether nulls in data are silently ignored (default) vs actively applied and assigned to members + + + + + Should list expansions be padded with null-valued parameters, to prevent query-plan saturation? For example, + an 'in @foo' expansion with 7, 8 or 9 values will be sent as a list of 10 values, with 3, 2 or 1 of them null. + The padding size is relative to the size of the list; "next 10" under 150, "next 50" under 500, + "next 100" under 1500, etc. + + + Caution: this should be treated with care if your DB provider (or the specific configuration) allows for null + equality (aka "ansi nulls off"), as this may change the intent of your query; as such, this is disabled by + default and must be enabled. + + + + + If set (non-negative), when performing in-list expansions of integer types ("where id in @ids", etc), switch to a string_split based + operation if there are more than this many elements. Note that this feautre requires SQL Server 2016 / compatibility level 130 (or above). + + + + + Base-class for simple type-handlers + + + + + Assign the value of a parameter before a command executes + + The parameter to configure + Parameter value + + + + Parse a database value back to a typed value + + The value from the database + The typed value + + + + Base-class for simple type-handlers that are based around strings + + + + + Parse a string into the expected type (the string will never be null) + + + + + Format an instace into a string (the instance will never be null) + + + + + Assign the value of a parameter before a command executes + + The parameter to configure + Parameter value + + + + Parse a database value back to a typed value + + The value from the database + The typed value + + + + Not intended for direct usage + + + + + Not intended for direct usage + + + + + Not intended for direct usage + + + + + A type handler for data-types that are supported by the underlying provider, but which need + a well-known UdtTypeName to be specified + + + + + Creates a new instance of UdtTypeHandler with the specified UdtTypeName + + + + + Used to pass a DataTable as a TableValuedParameter + + + + + Create a new instance of TableValuedParameter + + + + + Create a new instance of TableValuedParameter + + + + + Describes a reader that controls the lifetime of both a command and a reader, + exposing the downstream command/reader as properties. + + + + + Obtain the underlying reader + + + + + Obtain the underlying command + + + + + Enables the efficient, dynamic composition of query predicates. + + + + + Creates a predicate that evaluates to true. + + + + + Creates a predicate that evaluates to false. + + + + + Creates a predicate expression from the specified lambda expression. + + + + + Combines the first predicate with the second using the logical "and". + + + + + Combines the first predicate with the second using the logical "or". + + + + + Negates the predicate. + + + + + Combines the first expression with the second using the specified merge function. + + + + + SQL Server 2016 specific features + + + + Tests whether a string contains valid JSON. + The string to test. + Returns True if the string contains valid JSON; otherwise, returns False. Returns null if expression is null. + ISJSON does not check the uniqueness of keys at the same level. + + + + Extracts a scalar value from a JSON string. + + An expression. Typically the name of a variable or a column that contains JSON text.

+ If JSON_VALUE finds JSON that is not valid in expression before it finds the value identified by path, the function returns an error. If JSON_VALUE doesn't find the value identified by path, it scans the entire text and returns an error if it finds JSON that is not valid anywhere in expression. + + + A JSON path that specifies the property to extract. For more info, see JSON Path Expressions (SQL Server).

+ In SQL Server 2017 and in Azure SQL Database, you can provide a variable as the value of path.

+ If the format of path isn't valid, JSON_VALUE returns an error.

+ + + Returns a single text value of type nvarchar(4000). The collation of the returned value is the same as the collation of the input expression. + If the value is greater than 4000 characters:

+
    +
  • In lax mode, JSON_VALUE returns null.
  • +
  • In strict mode, JSON_VALUE returns an error.
  • +
+
+ If you have to return scalar values greater than 4000 characters, use OPENJSON instead of JSON_VALUE. For more info, see OPENJSON (Transact-SQL). +
+ +
+ + Extracts a scalar value from a JSON string. + + An expression. Typically the name of a variable or a column that contains JSON text.

+ If JSON_VALUE finds JSON that is not valid in expression before it finds the value identified by path, the function returns an error. If JSON_VALUE doesn't find the value identified by path, it scans the entire text and returns an error if it finds JSON that is not valid anywhere in expression. + + + A JSON path that specifies the property to extract. For more info, see JSON Path Expressions (SQL Server).

+ In SQL Server 2017 and in Azure SQL Database, you can provide a variable as the value of path.

+ If the format of path isn't valid, JSON_VALUE returns an error.

+ + + Returns a single text value of type nvarchar(4000). The collation of the returned value is the same as the collation of the input expression. + If the value is greater than 4000 characters:

+
    +
  • In lax mode, JSON_VALUE returns null.
  • +
  • In strict mode, JSON_VALUE returns an error.
  • +
+
+ If you have to return scalar values greater than 4000 characters, use OPENJSON instead of JSON_VALUE. For more info, see OPENJSON (Transact-SQL). +
+ +
+ + + Extracts an object or an array from a JSON string.

+ To extract a scalar value from a JSON string instead of an object or an array, see JSON_VALUE(Transact-SQL). + For info about the differences between JSON_VALUE and JSON_QUERY, see Compare JSON_VALUE and JSON_QUERY. +
+ Type of objects returned + + An expression. Typically the name of a variable or a column that contains JSON text.

+ If JSON_QUERY finds JSON that is not valid in expression before it finds the value identified by path, the function returns an error. If JSON_QUERY doesn't find the value identified by path, it scans the entire text and returns an error if it finds JSON that is not valid anywhere in expression. + + + A JSON path that specifies the object or the array to extract.

+ In SQL Server 2017 and in Azure SQL Database, you can provide a variable as the value of path.

+ The JSON path can specify lax or strict mode for parsing.If you don't specify the parsing mode, lax mode is the default. For more info, see JSON Path Expressions (SQL Server).

+ The default value for path is '$'. As a result, if you don't provide a value for path, JSON_QUERY returns the input expression.

+ If the format of path isn't valid, JSON_QUERY returns an error. + + + Returns a JSON fragment of type T. The collation of the returned value is the same as the collation of the input expression.

+ If the value is not an object or an array: +
    +
  • In lax mode, JSON_QUERY returns null.
  • +
  • In strict mode, JSON_QUERY returns an error.
  • +
+
+
+ + + Clear select expression. All properties will be selected. + + + + + set the specified selectExpression. + + + raw Select expression: "SomeField1, SomeField2 from SomeTable" + + + + + set the specified DISTINCT selectExpression. + + + raw Select expression: "SomeField1, SomeField2 from SomeTable" + + + + + Set the specified selectExpression using matching fields. + + + Matching Fields: "SomeField1, SomeField2" + + + + + Set the specified DISTINCT selectExpression using matching fields. + + + Matching Fields: "SomeField1, SomeField2" + + + + + + Offset of the first row to return. The offset of the initial row is 0 + + + + + Number of rows returned by a SELECT statement + + + + + Set the specified offset and rows for SQL Limit clause. + + + Offset of the first row to return. The offset of the initial row is 0 + + + Number of rows returned by a SELECT statement + + + + + Set the specified offset and rows for SQL Limit clause where they exist. + + + Offset of the first row to return. The offset of the initial row is 0 + + + Number of rows returned by a SELECT statement + + + + + Set the specified rows for Sql Limit clause. + + + Number of rows returned by a SELECT statement + + + + + Clear Sql Limit clause + + + + + Clear Offset and Limit clauses. Alias for Limit() + + + + + + Fields to be updated. + + + List<string> containing Names of properties to be updated + + + + + Fields to be updated. + + + IEnumerable<string> containing Names of properties to be updated + + + + + Fields to be updated. + + + x=> x.SomeProperty1 or x=> new { x.SomeProperty1, x.SomeProperty2 } + + + + + Clear UpdateFields list ( all fields will be updated) + + + + + Fields to be inserted. + + + x=> x.SomeProperty1 or x=> new{ x.SomeProperty1, x.SomeProperty2} + + + objectWithProperties + + + + + fields to be inserted. + + + IList<string> containing Names of properties to be inserted + + + + + Clear InsertFields list ( all fields will be inserted) + + + + + Merge params into an encapsulated SQL Statement with embedded param values + + + + + Determines whether the expression is the parameter inside MemberExpression which should be compared with TrueExpression. + + Returns true if the specified expression is the parameter inside MemberExpression which should be compared with TrueExpression; + otherwise, false. + + + + Determines whether the expression is the parameter. + + Returns true if the specified expression is parameter; + otherwise, false. + + + + Determines whether the expression is a Parameter or Convert Expression. + + Returns true if the specified expression is parameter or convert; + otherwise, false. + + + + Unquoted alias for the column or expression being selected. + + + + + The SQL expression being selected, including any necessary quoting. + + + + + Unquoted column name being selected. + + + + + Table name or alias used to prefix the column name, if any. Already quoted. + + + + + RDBMS Dialect this Converter is for. Injected at registration. + + + + + SQL Column Definiton used in CREATE Table. + + + + + Used in DB Params. Defaults to DbType.String + + + + + Quoted Value in SQL Statement + + + + + Customize how DB Param is initialized. Useful for supporting RDBMS-specific Types. + + + + + Parameterized value in parameterized queries + + + + + Value from DB to Populate on POCO Data Model with + + + + + Retrieve Value from ADO.NET IDataReader. Defaults to reader.GetValue() + + + + + For Types that are natively supported by RDBMS's and shouldn't be quoted + + + + + Invoked when a DB Connection is opened + + + + + Gets the explicit Converter registered for a specific type + + + + + Return best matching converter, falling back to Enum, Value or Ref Type Converters + + + + + Quote the string so that it can be used inside an SQL-expression + Escape quotes inside the string + + + + + + + Returns results from using an SqlFormat query. E.g: + db.SelectFmt<Person>("Age > {0}", 40) + db.SelectFmt<Person>("SELECT * FROM Person WHERE Age > {0}", 40) + + + + + Returns a partial subset of results from the specified tableType using a SqlFormat query. E.g: + db.SelectFmt<EntityWithId>(typeof(Person), "Age > {0}", 40) + + + + + Returns a single scalar value using an SqlFormat query. E.g: + db.ScalarFmt<int>("SELECT COUNT(*) FROM Person WHERE Age > {0}", 40) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.ColumnFmt<string>("SELECT LastName FROM Person WHERE Age = {0}", 27) + + + + + Returns the distinct first column values in a HashSet using an SqlFormat query. E.g: + db.ColumnDistinctFmt<int>("SELECT Age FROM Person WHERE Age < {0}", 50) + + + + + Returns an Dictionary<K, List<V>> grouping made from the first two columns using an SqlFormat query. E.g: + db.LookupFmt<int, string>("SELECT Age, LastName FROM Person WHERE Age < {0}", 50) + + + + + Returns a Dictionary from the first 2 columns: Column 1 (Keys), Column 2 (Values) using an SqlFormat query. E.g: + db.DictionaryFmt<int, string>("SELECT Id, LastName FROM Person WHERE Age < {0}", 50) + + + + + Returns true if the Query returns any records, using an SqlFormat query. E.g: + db.ExistsFmt<Person>("Age = {0}", 42) + db.ExistsFmt<Person>("SELECT * FROM Person WHERE Age = {0}", 50) + + + + + Returns true if the Query returns any records that match the SqlExpression lambda, E.g: + db.Exists<Person>(q => q.Where(x => x.Age < 50)) + + + + + Returns results from a Stored Procedure using an SqlFormat query. E.g: + + + + + + Returns results from using an SqlFormat query. E.g: + db.SelectFmt<Person>("Age > {0}", 40) + db.SelectFmt<Person>("SELECT * FROM Person WHERE Age > {0}", 40) + + + + + Returns a partial subset of results from the specified tableType using a SqlFormat query. E.g: + db.SelectFmt<EntityWithId>(typeof(Person), "Age > {0}", 40) + + + + + Returns a lazyily loaded stream of results using an SqlFilter query. E.g: + db.SelectLazyFmt<Person>("Age > {0}", 40) + + + + + Returns the first result using a SqlFormat query. E.g: + db.SingleFmt<Person>("Age = {0}", 42) + + + + + Returns a single scalar value using an SqlFormat query. E.g: + db.ScalarFmt<int>("SELECT COUNT(*) FROM Person WHERE Age > {0}", 40) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.ColumnFmt<string>("SELECT LastName FROM Person WHERE Age = {0}", 27) + + + + + Returns the distinct first column values in a HashSet using an SqlFormat query. E.g: + db.ColumnDistinctFmt<int>("SELECT Age FROM Person WHERE Age < {0}", 50) + + + + + Returns an Dictionary<K, List<V>> grouping made from the first two columns using an SqlFormat query. E.g: + db.LookupFmt<int, string>("SELECT Age, LastName FROM Person WHERE Age < {0}", 50) + + + + + Returns a Dictionary from the first 2 columns: Column 1 (Keys), Column 2 (Values) using an SqlFormat query. E.g: + db.DictionaryFmt<int, string>("SELECT Id, LastName FROM Person WHERE Age < {0}", 50) + + + + + Returns true if the Query returns any records, using an SqlFormat query. E.g: + db.ExistsFmt<Person>("Age = {0}", 42) + db.ExistsFmt<Person>("SELECT * FROM Person WHERE Age = {0}", 50) + + + + + Returns true if the Query returns any records that match the SqlExpression lambda, E.g: + db.Exists<Person>(q => q.Where(x => x.Age < 50)) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.Select<Person>(q => q.Where(x => x.Age > 40)) + + + + + Project results from a number of joined tables into a different model + + + + + Returns a single result from using an SqlExpression lambda. E.g: + db.Single<Person>(q => q.Where(x => x.Age == 42)) + + + + + Returns the first result using a SqlFormat query. E.g: + db.SingleFmt<Person>("Age = {0}", 42) + + + + + Returns the count of rows that match the SqlExpression lambda, E.g: + db.Count<Person>(q => q.Where(x => x.Age < 50)) + + + + + Returns results with references from using an SqlExpression lambda. E.g: + db.LoadSelectAsync<Person>(q => q.Where(x => x.Age > 40)) + + + + + Create a new SqlExpression builder allowing typed LINQ-like queries. + + + + + Returns results from using an SqlExpression lambda. E.g: + db.Select<Person>(q => q.Where(x => x.Age > 40)) + + + + + Project results from a number of joined tables into a different model + + + + + Project results from a number of joined tables into a different model + + + + + Returns a single result from using an SqlExpression lambda. E.g: + db.Single<Person>(q => q.Where(x => x.Age == 42)) + + + + + Returns the count of rows that match the SqlExpression lambda, E.g: + db.Count<Person>(q => q.Where(x => x.Age < 50)) + + + + + Returns results with references from using an SqlExpression lambda. E.g: + db.LoadSelect<Person>(q => q.Where(x => x.Age > 40)) + + + + + Returns results with references from using an SqlExpression lambda. E.g: + db.LoadSelect<Person>(q => q.Where(x => x.Age > 40), include: x => new { x.PrimaryAddress }) + + + + + Delete rows using a SqlFormat filter. E.g: + + number of rows deleted + + + + Delete rows from the runtime table type using a SqlFormat filter. E.g: + + db.DeleteFmt(typeof(Person), "Age = {0}", 27) + number of rows deleted + + + + Delete rows using a SqlFormat filter. E.g: + db.Delete<Person>("Age > {0}", 42) + + number of rows deleted + + + + Delete rows from the runtime table type using a SqlFormat filter. E.g: + + db.DeleteFmt(typeof(Person), "Age = {0}", 27) + number of rows deleted + + + + Insert only fields in POCO specified by the SqlExpression lambda. E.g: + db.InsertOnly(new Person { FirstName = "Amy", Age = 27 }, q => q.Insert(p => new { p.FirstName, p.Age })) + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnly(new Person { FirstName = "Amy" }, q => q.Insert(p => new { p.FirstName })); + INSERT INTO "Person" ("FirstName") VALUES ('Amy'); + + + + + Use an SqlExpression to select which fields to update and construct the where expression, E.g: + + db.UpdateOnly(new Person { FirstName = "JJ" }, ev => ev.Update(p => p.FirstName).Where(x => x.FirstName == "Jimi")); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("FirstName" = 'Jimi') + + What's not in the update expression doesn't get updated. No where expression updates all rows. E.g: + + db.UpdateOnly(new Person { FirstName = "JJ", LastName = "Hendo" }, ev => ev.Update(p => p.FirstName)); + UPDATE "Person" SET "FirstName" = 'JJ' + + + + + Flexible Update method to succinctly execute a free-text update statement using optional params. E.g: + + db.Update<Person>(set:"FirstName = {0}".Params("JJ"), where:"LastName = {0}".Params("Hendrix")); + UPDATE "Person" SET FirstName = 'JJ' WHERE LastName = 'Hendrix' + + + + + Flexible Update method to succinctly execute a free-text update statement using optional params. E.g. + + db.Update(table:"Person", set: "FirstName = {0}".Params("JJ"), where: "LastName = {0}".Params("Hendrix")); + UPDATE "Person" SET FirstName = 'JJ' WHERE LastName = 'Hendrix' + + + + + Flexible Delete method to succinctly execute a delete statement using free-text where expression. E.g. + + db.Delete<Person>(where:"Age = {0}".Params(27)); + DELETE FROM "Person" WHERE Age = 27 + + + + + Flexible Delete method to succinctly execute a delete statement using free-text where expression. E.g. + + db.Delete(table:"Person", where: "Age = {0}".Params(27)); + DELETE FROM "Person" WHERE Age = 27 + + + + + Delete the rows that matches the where expression, e.g: + + db.Delete<Person>(ev => ev.Where(p => p.Age == 27)); + DELETE FROM "Person" WHERE ("Age" = 27) + + + + + Insert only fields in POCO specified by the SqlExpression lambda. E.g: + db.InsertOnly(new Person { FirstName = "Amy", Age = 27 }, q => q.Insert(p => new { p.FirstName, p.Age })) + + + + + Use an SqlExpression to select which fields to update and construct the where expression, E.g: + + db.UpdateOnly(new Person { FirstName = "JJ" }, ev => ev.Update(p => p.FirstName).Where(x => x.FirstName == "Jimi")); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("FirstName" = 'Jimi') + + What's not in the update expression doesn't get updated. No where expression updates all rows. E.g: + + db.UpdateOnly(new Person { FirstName = "JJ", LastName = "Hendo" }, ev => ev.Update(p => p.FirstName)); + UPDATE "Person" SET "FirstName" = 'JJ' + + + + + Flexible Update method to succinctly execute a free-text update statement using optional params. E.g: + + db.Update<Person>(set:"FirstName = {0}".Params("JJ"), where:"LastName = {0}".Params("Hendrix")); + UPDATE "Person" SET FirstName = 'JJ' WHERE LastName = 'Hendrix' + + + + + Flexible Update method to succinctly execute a free-text update statement using optional params. E.g. + + db.Update(table:"Person", set: "FirstName = {0}".Params("JJ"), where: "LastName = {0}".Params("Hendrix")); + UPDATE "Person" SET FirstName = 'JJ' WHERE LastName = 'Hendrix' + + + + + Flexible Delete method to succinctly execute a delete statement using free-text where expression. E.g. + + db.Delete<Person>(where:"Age = {0}".Params(27)); + DELETE FROM "Person" WHERE Age = 27 + + + + + Flexible Delete method to succinctly execute a delete statement using free-text where expression. E.g. + + db.Delete(table:"Person", where: "Age = {0}".Params(27)); + DELETE FROM "Person" WHERE Age = 27 + + + + + Delete the rows that matches the where expression, e.g: + + db.Delete<Person>(ev => ev.Where(p => p.Age == 27)); + DELETE FROM "Person" WHERE ("Age" = 27) + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnly(new Person { FirstName = "Amy" }, q => q.Insert(p => new { p.FirstName })); + INSERT INTO "Person" ("FirstName") VALUES ('Amy'); + + + + + Wrapper IDbConnection class to allow for connection sharing, mocking, etc. + + + + + Allow for mocking and unit testing by providing non-disposing + connection factory with injectable IDbCommand and IDbTransaction proxies + + + + + Force the IDbConnection to always return this IDbCommand + + + + + Force the IDbConnection to always return this IDbTransaction + + + + + Alias for OpenDbConnection + + + + + Alias for OpenDbConnectionAsync + + + + + Alias for OpenDbConnection + + + + + Alias for OpenDbConnection + + + + + Alias for OpenDbConnection + + + + + Tell ServiceStack to use ThreadStatic Items Collection for Context Scoped items. + Warning: ThreadStatic Items aren't pinned to the same request in async services which callback on different threads. + + + + + Gets a list of items for this context. + + + + + Allow for code-sharing between OrmLite, IPersistenceProvider and ICacheClient + + + + + Returns results from the active connection. + + + + + Returns results from using sql. E.g: + db.Select<Person>("Age > 40") + db.Select<Person>("SELECT * FROM Person WHERE Age > 40") + + + + + Returns results from using sql. E.g: + db.Select<Person>("SELECT * FROM Person WHERE Age > @age", new[] { db.CreateParam("age", 40) }) + + + + + Returns results from using a parameterized query. E.g: + db.Select<Person>("Age > @age", new { age = 40}) + db.Select<Person>("SELECT * FROM Person WHERE Age > @age", new { age = 40}) + + + + + Returns results from using a parameterized query. E.g: + db.Select<Person>("Age > @age", new Dictionary<string, object> { { "age", 40 } }) + db.Select<Person>("SELECT * FROM Person WHERE Age > @age", new Dictionary<string, object> { { "age", 40 } }) + + + + + Returns a partial subset of results from the specified tableType. E.g: + db.Select<EntityWithId>(typeof(Person)) + + + + + + Returns a partial subset of results from the specified tableType. E.g: + db.Select<EntityWithId>(typeof(Person)) + + + + + + Returns results from using a single name, value filter. E.g: + db.Where<Person>("Age", 27) + + + + + Returns results from using an anonymous type filter. E.g: + db.Where<Person>(new { Age = 27 }) + + + + + Returns results using the supplied primary key ids. E.g: + db.SelectByIds<Person>(new[] { 1, 2, 3 }) + + + + + Query results using the non-default values in the supplied partially populated POCO example. E.g: + db.SelectNonDefaults(new Person { Id = 1 }) + + + + + Query results using the non-default values in the supplied partially populated POCO example. E.g: + db.SelectNonDefaults("Age > @Age", new Person { Age = 42 }) + + + + + Returns a lazyily loaded stream of results. E.g: + db.SelectLazy<Person>() + + + + + Returns a lazyily loaded stream of results using a parameterized query. E.g: + db.SelectLazy<Person>("Age > @age", new { age = 40 }) + + + + + Returns a lazyily loaded stream of results using a parameterized query. E.g: + db.SelectLazy(db.From<Person>().Where(x => x == 40)) + + + + + Returns a stream of results that are lazily loaded using a parameterized query. E.g: + db.WhereLazy<Person>(new { Age = 27 }) + + + + + Returns the first result using a parameterized query. E.g: + db.Single<Person>(new { Age = 42 }) + + + + + Returns results from using a single name, value filter. E.g: + db.Single<Person>("Age = @age", new[] { db.CreateParam("age",40) }) + + + + + Returns results from using a single name, value filter. E.g: + db.Single<Person>("Age = @age", new { age = 42 }) + + + + + Returns the first result using a primary key id. E.g: + db.SingleById<Person>(1) + + + + + Returns the first result using a name, value filter. E.g: + db.SingleWhere<Person>("Age", 42) + + + + + Returns a single scalar value using an SqlExpression. E.g: + db.Column<int>(db.From<Persion>().Select(x => Sql.Count("*")).Where(q => q.Age > 40)) + + + + + Returns a single scalar value using a parameterized query. E.g: + db.Scalar<int>("SELECT COUNT(*) FROM Person WHERE Age > @age", new[] { db.CreateParam("age",40) }) + + + + + Returns a single scalar value using a parameterized query. E.g: + db.Scalar<int>("SELECT COUNT(*) FROM Person WHERE Age > @age", new { age = 40 }) + + + + + Returns the distinct first column values in a HashSet using an SqlExpression. E.g: + db.Column<int>(db.From<Persion>().Select(x => x.LastName).Where(q => q.Age == 27)) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.Column<string>("SELECT LastName FROM Person WHERE Age = @age", new[] { db.CreateParam("age",27) }) + + + + + Returns the distinct first column values in a HashSet using an SqlExpression. E.g: + db.ColumnLazy<int>(db.From<Persion>().Select(x => x.LastName).Where(q => q.Age == 27)) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.ColumnLazy<string>("SELECT LastName FROM Person WHERE Age = @age", new[] { db.CreateParam("age",27) }) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.ColumnLazy<string>("SELECT LastName FROM Person WHERE Age = @age", new { age = 27 }) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.Column<string>("SELECT LastName FROM Person WHERE Age = @age", new { age = 27 }) + + + + + + Returns the distinct first column values in a HashSet using an SqlFormat query. E.g: + db.ColumnDistinct<int>("SELECT Age FROM Person WHERE Age < @age", new { age = 50 }) + + + + + Returns the distinct first column values in a HashSet using an SqlFormat query. E.g: + db.ColumnDistinct<int>("SELECT Age FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + + Returns an Dictionary<K, List<V>> grouping made from the first two columns using an parameterized query. E.g: + db.Lookup<int, string>("SELECT Age, LastName FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + Returns an Dictionary<K, List<V>> grouping made from the first two columns using an parameterized query. E.g: + db.Lookup<int, string>("SELECT Age, LastName FROM Person WHERE Age < @age", new { age = 50 }) + + + + + + Returns a Dictionary from the first 2 columns: Column 1 (Keys), Column 2 (Values) using sql. E.g: + db.Dictionary<int, string>("SELECT Id, LastName FROM Person WHERE Age < @age", new { age = 50 }) + + + + + Returns true if the Query returns any records that match the LINQ expression, E.g: + db.Exists<Person>(x => x.Age < 50) + + + + + Returns true if the Query returns any records that match the supplied SqlExpression, E.g: + db.Exists(db.From<Person>().Where(x => x.Age < 50)) + + + + + Returns true if the Query returns any records, using an SqlFormat query. E.g: + db.Exists<Person>(new { Age = 42 }) + + + + + Returns true if the Query returns any records, using a parameterized query. E.g: + db.Exists<Person>("Age = @age", new { age = 42 }) + db.Exists<Person>("SELECT * FROM Person WHERE Age = @age", new { age = 42 }) + + + + + Returns results from an arbitrary SqlExpression. E.g: + db.SqlList<Person>(db.From<Person>().Select("*").Where(q => q.Age < 50)) + + + + + Returns results from an arbitrary parameterized raw sql query. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", new[] { db.CreateParam("age",50) }) + + + + + Returns results from an arbitrary parameterized raw sql query. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", new { age = 50 }) + + + + + Returns results from an arbitrary parameterized raw sql query. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", new Dictionary<string, object> { { "age", 42 } }) + + + + + Returns results from an arbitrary parameterized raw sql query with a dbCmd filter. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", dbCmd => ...) + + + + + Prepare Stored Procedure with Input parameters, optionally populated with Input Params. E.g: + var cmd = db.SqlProc("GetRockstarsAged", new { age = 42 }) + + + + + + Returns the first column in a List using a parameterized query. E.g: + db.SqlColumn<string>("SELECT LastName FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + Returns the first column in a List using a parameterized query. E.g: + db.SqlColumn<string>("SELECT LastName FROM Person WHERE Age < @age", new { age = 50 }) + + + + + Returns the first column in a List using a parameterized query. E.g: + db.SqlColumn<string>("SELECT LastName FROM Person WHERE Age < @age", new Dictionary<string, object> { { "age", 50 } }) + + + + + Returns a single Scalar value using an SqlExpression. E.g: + db.SqlScalar<int>(db.From<Person>().Select(Sql.Count("*")).Where(q => q.Age < 50)) + + + + + Returns a single Scalar value using a parameterized query. E.g: + db.SqlScalar<int>("SELECT COUNT(*) FROM Person WHERE Age < @age", new[]{ db.CreateParam("age",50) }) + + + + + Returns a single Scalar value using a parameterized query. E.g: + db.SqlScalar<int>("SELECT COUNT(*) FROM Person WHERE Age < @age", new { age = 50 }) + + + + + Returns a single Scalar value using a parameterized query. E.g: + db.SqlScalar<int>("SELECT COUNT(*) FROM Person WHERE Age < @age", new Dictionary<string, object> { { "age", 50 } }) + + + + + Returns the last insert Id made from this connection. + + + + + Executes a raw sql non-query using sql. E.g: + var rowsAffected = db.ExecuteNonQuery("UPDATE Person SET LastName={0} WHERE Id={1}".SqlFormat("WaterHouse", 7)) + + number of rows affected + + + + Executes a raw sql non-query using a parameterized query. E.g: + var rowsAffected = db.ExecuteNonQuery("UPDATE Person SET LastName=@name WHERE Id=@id", new { name = "WaterHouse", id = 7 }) + + number of rows affected + + + + Executes a raw sql non-query using a parameterized query. + + number of rows affected + + + + Executes a raw sql non-query using a parameterized query with a dbCmd filter. E.g: + + number of rows affected + + + + Returns results from a Stored Procedure, using a parameterized query. + + + + + Returns results from a Stored Procedure using an SqlFormat query. E.g: + + + + + + Returns the scalar result as a long. + + + + + Returns the first result with all its references loaded, using a primary key id. E.g: + db.LoadSingleById<Person>(1, include = new[]{ "Address" }) + + + + + Returns the first result with all its references loaded, using a primary key id. E.g: + db.LoadSingleById<Person>(1, include = x => new{ x.Address }) + + + + + Loads all the related references onto the instance. E.g: + db.LoadReferences(customer) + + + + + Returns results from the active connection. + + + + + Returns results from using sql. E.g: + db.Select<Person>("Age > 40") + db.Select<Person>("SELECT * FROM Person WHERE Age > 40") + + + + + Returns results from using a parameterized query. E.g: + db.Select<Person>("Age > @age", new { age = 40}) + db.Select<Person>("SELECT * FROM Person WHERE Age > @age", new[] { db.CreateParam("age",40) }) + + + + + Returns results from using a parameterized query. E.g: + db.Select<Person>("Age > @age", new { age = 40}) + db.Select<Person>("SELECT * FROM Person WHERE Age > @age", new { age = 40}) + + + + + Returns results from using a parameterized query. E.g: + db.Select<Person>("Age > @age", new Dictionary<string, object> { { "age", 40 } }) + db.Select<Person>("SELECT * FROM Person WHERE Age > @age", new Dictionary<string, object> { { "age", 40 } }) + + + + + Returns a partial subset of results from the specified tableType. E.g: + db.Select<EntityWithId>(typeof(Person)) + + + + + + Returns a partial subset of results from the specified tableType. E.g: + db.Select<EntityWithId>(typeof(Person), "Age = @age", new { age = 27 }) + + + + + + Returns results from using a single name, value filter. E.g: + db.Where<Person>("Age", 27) + + + + + Returns results from using an anonymous type filter. E.g: + db.Where<Person>(new { Age = 27 }) + + + + + Returns results using the supplied primary key ids. E.g: + db.SelectByIds<Person>(new[] { 1, 2, 3 }) + + + + + Query results using the non-default values in the supplied partially populated POCO example. E.g: + db.SelectNonDefaults(new Person { Id = 1 }) + + + + + Query results using the non-default values in the supplied partially populated POCO example. E.g: + db.SelectNonDefaults("Age > @Age", new Person { Age = 42 }) + + + + + Returns the first result using a parameterized query. E.g: + db.Single<Person>(new { Age = 42 }) + + + + + Returns results from using a single name, value filter. E.g: + db.Single<Person>("Age = @age", new[] { db.CreateParam("age",42) }) + + + + + Returns results from using a single name, value filter. E.g: + db.Single<Person>("Age = @age", new { age = 42 }) + + + + + Returns the first result using a primary key id. E.g: + db.SingleById<Person>(1) + + + + + Returns the first result using a name, value filter. E.g: + db.SingleWhere<Person>("Age", 42) + + + + + Returns a single scalar value using an SqlExpression. E.g: + db.Column<int>(db.From<Persion>().Select(x => Sql.Count("*")).Where(q => q.Age > 40)) + + + + + Returns a single scalar value using a parameterized query. E.g: + db.Scalar<int>("SELECT COUNT(*) FROM Person WHERE Age > @age", new[] { db.CreateParam("age",40) }) + + + + + Returns a single scalar value using a parameterized query. E.g: + db.Scalar<int>("SELECT COUNT(*) FROM Person WHERE Age > @age", new { age = 40 }) + + + + + Returns the distinct first column values in a HashSet using an SqlExpression. E.g: + db.Column<int>(db.From<Persion>().Select(x => x.LastName).Where(q => q.Age == 27)) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.Column<string>("SELECT LastName FROM Person WHERE Age = @age", new[] { db.CreateParam("age",27) }) + + + + + Returns the first column in a List using a SqlFormat query. E.g: + db.Column<string>("SELECT LastName FROM Person WHERE Age = @age", new { age = 27 }) + + + + + + Returns the distinct first column values in a HashSet using an SqlFormat query. E.g: + db.ColumnDistinct<int>("SELECT Age FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + Returns the distinct first column values in a HashSet using an SqlFormat query. E.g: + db.ColumnDistinct<int>("SELECT Age FROM Person WHERE Age < @age", new { age = 50 }) + + + + + + Returns an Dictionary<K, List<V>> grouping made from the first two columns using an parameterized query. E.g: + db.Lookup<int, string>("SELECT Age, LastName FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + Returns an Dictionary<K, List<V>> grouping made from the first two columns using an parameterized query. E.g: + db.Lookup<int, string>("SELECT Age, LastName FROM Person WHERE Age < @age", new { age = 50 }) + + + + + + Returns a Dictionary from the first 2 columns: Column 1 (Keys), Column 2 (Values) using sql. E.g: + db.Dictionary<int, string>("SELECT Id, LastName FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + Returns a Dictionary from the first 2 columns: Column 1 (Keys), Column 2 (Values) using sql. E.g: + db.Dictionary<int, string>("SELECT Id, LastName FROM Person WHERE Age < @age", new { age = 50 }) + + + + + Returns true if the Query returns any records that match the LINQ expression, E.g: + db.Exists<Person>(x => x.Age < 50) + + + + + Returns true if the Query returns any records that match the supplied SqlExpression, E.g: + db.Exists(db.From<Person>().Where(x => x.Age < 50)) + + + + + Returns true if the Query returns any records, using an SqlFormat query. E.g: + db.Exists<Person>(new { Age = 42 }) + + + + + Returns true if the Query returns any records, using a parameterized query. E.g: + db.Exists<Person>("Age = @age", new { age = 42 }) + db.Exists<Person>("SELECT * FROM Person WHERE Age = @age", new { age = 42 }) + + + + + Returns results from an arbitrary SqlExpression. E.g: + db.SqlList<Person>(db.From<Person>().Select("*").Where(q => q.Age < 50)) + + + + + Returns results from an arbitrary parameterized raw sql query. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", new { age = 50 }) + + + + + Returns results from an arbitrary parameterized raw sql query. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", new { age = 50 }) + + + + + Returns results from an arbitrary parameterized raw sql query. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", new Dictionary<string, object> { { "age", 42 } }) + + + + + Returns results from an arbitrary parameterized raw sql query with a dbCmd filter. E.g: + db.SqlList<Person>("EXEC GetRockstarsAged @age", dbCmd => ...) + + + + + + Returns the first column in a List using a parameterized query. E.g: + db.SqlColumn<string>("SELECT LastName FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + Returns the first column in a List using a parameterized query. E.g: + db.SqlColumn<string>("SELECT LastName FROM Person WHERE Age < @age", new { age = 50 }) + + + + + Returns the first column in a List using a parameterized query. E.g: + db.SqlColumn<string>("SELECT LastName FROM Person WHERE Age < @age", new Dictionary<string, object> { { "age", 50 } }) + + + + + Returns a single Scalar value using an SqlExpression. E.g: + db.SqlScalar<int>(db.From<Person>().Select(Sql.Count("*")).Where(q => q.Age < 50)) + + + + + Returns a single Scalar value using a parameterized query. E.g: + db.SqlScalar<int>("SELECT COUNT(*) FROM Person WHERE Age < @age", new[] { db.CreateParam("age",50) }) + + + + + Returns a single Scalar value using a parameterized query. E.g: + db.SqlScalar<int>("SELECT COUNT(*) FROM Person WHERE Age < @age", new { age = 50 }) + + + + + Returns a single Scalar value using a parameterized query. E.g: + db.SqlScalar<int>("SELECT COUNT(*) FROM Person WHERE Age < @age", new Dictionary<string, object> { { "age", 50 } }) + + + + + Executes a raw sql non-query using sql. E.g: + var rowsAffected = db.ExecuteNonQueryAsync("UPDATE Person SET LastName={0} WHERE Id={1}".SqlFormat("WaterHouse", 7)) + + number of rows affected + + + + Executes a raw sql non-query using a parameterized query. E.g: + var rowsAffected = db.ExecuteNonQueryAsync("UPDATE Person SET LastName=@name WHERE Id=@id", new { name = "WaterHouse", id = 7 }) + + number of rows affected + + + + Executes a raw sql non-query using a parameterized query. + + number of rows affected + + + + Returns results from a Stored Procedure, using a parameterized query. + + + + + Returns the scalar result as a long. + + + + + Returns the first result with all its references loaded, using a primary key id. E.g: + db.LoadSingleById<Person>(1) + + + + + Returns the first result with all its references loaded, using a primary key id. E.g: + db.LoadSingleById<Person>(1, include = x => new { x.Address }) + + + + + Loads all the related references onto the instance. E.g: + db.LoadReferencesAsync(customer) + + + + + Creates a new SqlExpression builder allowing typed LINQ-like queries. + Alias for SqlExpression. + + + + + Creates a new SqlExpression builder for the specified type using a user-defined FROM sql expression. + + + + + Open a Transaction in OrmLite + + + + + Open a Transaction in OrmLite + + + + + Create a managed OrmLite IDbCommand + + + + + Returns results from using a LINQ Expression. E.g: + db.Select<Person>(x => x.Age > 40) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.Select(db.From<Person>().Where(x => x.Age > 40)) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.Select(db.From<Person>().Where(x => x.Age > 40)) + + + + + Returns a single result from using a LINQ Expression. E.g: + db.Single<Person>(x => x.Age == 42) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.Select<Person>(x => x.Age > 40) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.Single(db.From<Person>().Where(x => x.Age > 40)) + + + + + Returns a scalar result from using an SqlExpression lambda. E.g: + db.Scalar<Person, int>(x => Sql.Max(x.Age)) + + + + + Returns a scalar result from using an SqlExpression lambda. E.g: + db.Scalar<Person, int>(x => Sql.Max(x.Age), , x => x.Age < 50) + + + + + Returns the count of rows that match the LINQ expression, E.g: + db.Count<Person>(x => x.Age < 50) + + + + + Returns the count of rows that match the supplied SqlExpression, E.g: + db.Count(db.From<Person>().Where(x => x.Age < 50)) + + + + + Return the number of rows returned by the supplied expression + + + + + Return the number of rows returned by the supplied sql + + + + + Return the number of rows returned by the supplied sql and db params + + + + + Returns results with references from using a LINQ Expression. E.g: + db.LoadSelect<Person>(x => x.Age > 40) + + + + + Returns results with references from using a LINQ Expression. E.g: + db.LoadSelect<Person>(x => x.Age > 40, include: x => new { x.PrimaryAddress }) + + + + + Returns results with references from using an SqlExpression lambda. E.g: + db.LoadSelect(db.From<Person>().Where(x => x.Age > 40)) + + + + + Returns results with references from using an SqlExpression lambda. E.g: + db.LoadSelect(db.From<Person>().Where(x => x.Age > 40), include:q.OnlyFields) + + + + + Returns results with references from using an SqlExpression lambda. E.g: + db.LoadSelect(db.From<Person>().Where(x => x.Age > 40), include: x => new { x.PrimaryAddress }) + + + + + Project results with references from a number of joined tables into a different model + + + + + Project results with references from a number of joined tables into a different model + + + + + Project results with references from a number of joined tables into a different model + + + + + Returns results from using a LINQ Expression. E.g: + db.Select<Person>(x => x.Age > 40) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.Select(db.From<Person>().Where(x => x.Age > 40)) + + + + + Project results from a number of joined tables into a different model + + + + + Returns results from using an SqlExpression lambda. E.g: + db.SelectAsync(db.From<Person>().Where(x => x.Age > 40)) + + + + + Returns a single result from using a LINQ Expression. E.g: + db.Single<Person>(x => x.Age == 42) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.SingleAsync<Person>(x => x.Age > 40) + + + + + Returns results from using an SqlExpression lambda. E.g: + db.SingleAsync(db.From<Person>().Where(x => x.Age > 40)) + + + + + Returns a scalar result from using an SqlExpression lambda. E.g: + db.Scalar<Person, int>(x => Sql.Max(x.Age)) + + + + + Returns a scalar result from using an SqlExpression lambda. E.g: + db.Scalar<Person, int>(x => Sql.Max(x.Age), , x => x.Age < 50) + + + + + Returns the count of rows that match the LINQ expression, E.g: + db.Count<Person>(x => x.Age < 50) + + + + + Returns the count of rows that match the supplied SqlExpression, E.g: + db.Count(db.From<Person>().Where(x => x.Age < 50)) + + + + + Return the number of rows returned by the supplied expression + + + + + Return the number of rows returned by the supplied sql + + + + + Returns results with references from using a LINQ Expression. E.g: + db.LoadSelectAsync<Person>(x => x.Age > 40) + + + + + Returns results with references from using an SqlExpression lambda. E.g: + db.LoadSelectAsync(db.From<Person>().Where(x => x.Age > 40)) + + + + + Project results with references from a number of joined tables into a different model + + + + + Checks whether a Table Exists. E.g: + db.TableExists("Person") + + + + + Checks whether a Table Exists. E.g: + db.TableExists<Person>() + + + + + Checks whether a Table Column Exists. E.g: + db.ColumnExists("Age", "Person") + + + + + Checks whether a Table Column Exists. E.g: + db.ColumnExists<Person>(x => x.Age) + + + + + Create DB Tables from the schemas of runtime types. E.g: + db.CreateTables(typeof(Table1), typeof(Table2)) + + + + + Create DB Table from the schema of the runtime type. Use overwrite to drop existing Table. E.g: + db.CreateTable(true, typeof(Table)) + + + + + Only Create new DB Tables from the schemas of runtime types if they don't already exist. E.g: + db.CreateTableIfNotExists(typeof(Table1), typeof(Table2)) + + + + + Drop existing DB Tables and re-create them from the schemas of runtime types. E.g: + db.DropAndCreateTables(typeof(Table1), typeof(Table2)) + + + + + Create a DB Table from the generic type. Use overwrite to drop the existing table or not. E.g: + db.CreateTable<Person>(overwrite=false) //default + db.CreateTable<Person>(overwrite=true) + + + + + Only create a DB Table from the generic type if it doesn't already exist. E.g: + db.CreateTableIfNotExists<Person>() + + + + + Only create a DB Table from the runtime type if it doesn't already exist. E.g: + db.CreateTableIfNotExists(typeof(Person)) + + + + + Drop existing table if exists and re-create a DB Table from the generic type. E.g: + db.DropAndCreateTable<Person>() + + + + + Drop existing table if exists and re-create a DB Table from the runtime type. E.g: + db.DropAndCreateTable(typeof(Person)) + + + + + Drop any existing tables from their runtime types. E.g: + db.DropTables(typeof(Table1),typeof(Table2)) + + + + + Drop any existing tables from the runtime type. E.g: + db.DropTable(typeof(Person)) + + + + + Drop any existing tables from the generic type. E.g: + db.DropTable<Person>() + + + + + Get the last SQL statement that was executed. + + + + + Execute any arbitrary raw SQL. + + number of rows affected + + + + Execute any arbitrary raw SQL with db params. + + number of rows affected + + + + Execute any arbitrary raw SQL with db params. + + number of rows affected + + + + Insert 1 POCO, use selectIdentity to retrieve the last insert AutoIncrement id (if any). E.g: + var id = db.Insert(new Person { Id = 1, FirstName = "Jimi }, selectIdentity:true) + + + + + Insert 1 POCO and modify populated IDbCommand with a commandFilter. E.g: + var id = db.Insert(new Person { Id = 1, FirstName = "Jimi }, dbCmd => applyFilter(dbCmd)) + + + + + Insert 1 or more POCOs in a transaction using Table default values when defined. E.g: + db.InsertUsingDefaults(new Person { FirstName = "Tupac", LastName = "Shakur" }, + new Person { FirstName = "Biggie", LastName = "Smalls" }) + + + + + Insert a collection of POCOs in a transaction. E.g: + db.InsertAll(new[] { new Person { Id = 9, FirstName = "Biggie", LastName = "Smalls", Age = 24 } }) + + + + + Insert a collection of POCOs in a transaction and modify populated IDbCommand with a commandFilter. E.g: + db.InsertAll(new[] { new Person { Id = 9, FirstName = "Biggie", LastName = "Smalls", Age = 24 } }, + dbCmd => applyFilter(dbCmd)) + + + + + Insert 1 or more POCOs in a transaction. E.g: + db.Insert(new Person { Id = 1, FirstName = "Tupac", LastName = "Shakur", Age = 25 }, + new Person { Id = 2, FirstName = "Biggie", LastName = "Smalls", Age = 24 }) + + + + + Insert 1 or more POCOs in a transaction and modify populated IDbCommand with a commandFilter. E.g: + db.Insert(dbCmd => applyFilter(dbCmd), + new Person { Id = 1, FirstName = "Tupac", LastName = "Shakur", Age = 25 }, + new Person { Id = 2, FirstName = "Biggie", LastName = "Smalls", Age = 24 }) + + + + + Updates 1 POCO. All fields are updated except for the PrimaryKey which is used as the identity selector. E.g: + db.Update(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 }) + + + + + Updates 1 or more POCOs in a transaction. E.g: + db.Update(new Person { Id = 1, FirstName = "Tupac", LastName = "Shakur", Age = 25 }, + new Person { Id = 2, FirstName = "Biggie", LastName = "Smalls", Age = 24 }) + + + + + Updates 1 or more POCOs in a transaction. E.g: + db.UpdateAll(new[] { new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 } }) + + + + + Delete rows using an anonymous type filter. E.g: + db.Delete<Person>(new { FirstName = "Jimi", Age = 27 }) + + number of rows deleted + + + + Delete 1 row using all fields in the filter. E.g: + db.Delete(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 }) + + number of rows deleted + + + + Delete 1 or more rows in a transaction using all fields in the filter. E.g: + db.Delete(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 }) + + + + + Delete 1 or more rows using only field with non-default values in the filter. E.g: + db.DeleteNonDefaults(new Person { FirstName = "Jimi", Age = 27 }) + + number of rows deleted + + + + Delete 1 or more rows in a transaction using only field with non-default values in the filter. E.g: + db.DeleteNonDefaults(new Person { FirstName = "Jimi", Age = 27 }, + new Person { FirstName = "Janis", Age = 27 }) + + number of rows deleted + + + + Delete 1 row by the PrimaryKey. E.g: + db.DeleteById<Person>(1) + + number of rows deleted + + + + Delete 1 row by the PrimaryKey where the rowVersion matches the optimistic concurrency field. + Will throw RowModefiedExeption if the + row does not exist or has a different row version. + E.g: db.DeleteById<Person>(1) + + + + + Delete all rows identified by the PrimaryKeys. E.g: + db.DeleteById<Person>(new[] { 1, 2, 3 }) + + number of rows deleted + + + + Delete all rows in the generic table type. E.g: + db.DeleteAll<Person>() + + number of rows deleted + + + + Delete all rows provided. E.g: + db.DeleteAll<Person>(people) + + number of rows deleted + + + + Delete all rows in the runtime table type. E.g: + db.DeleteAll(typeof(Person)) + + number of rows deleted + + + + Delete rows using a SqlFormat filter. E.g: + db.Delete<Person>("Age > @age", new { age = 42 }) + + number of rows deleted + + + + Delete rows using a SqlFormat filter. E.g: + db.Delete<Person>("Age > @age", new { age = 42 }) + + number of rows deleted + + + + Insert a new row or update existing row. Returns true if a new row was inserted. + Optional references param decides whether to save all related references as well. E.g: + db.Save(customer, references:true) + + true if a row was inserted; false if it was updated + + + + Insert new rows or update existing rows. Return number of rows added E.g: + db.Save(new Person { Id = 10, FirstName = "Amy", LastName = "Winehouse", Age = 27 }) + + number of rows added + + + + Insert new rows or update existing rows. Return number of rows added E.g: + db.SaveAll(new [] { new Person { Id = 10, FirstName = "Amy", LastName = "Winehouse", Age = 27 } }) + + number of rows added + + + + Populates all related references on the instance with its primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveAllReferences(customer) + + + + + Populates the related references with the instance primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveReference(customer, customer.Orders) + + + + + Populates the related references with the instance primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveReference(customer, customer.Orders) + + + + + Populates the related references with the instance primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveReferences(customer, customer.Orders) + + + + + Generates inline UPDATE SQL Statement + + + + + Generates inline INSERT SQL Statement + + + + + Execute any arbitrary raw SQL. + + number of rows affected + + + + Execute any arbitrary raw SQL with db params. + + number of rows affected + + + + Insert 1 POCO, use selectIdentity to retrieve the last insert AutoIncrement id (if any). E.g: + var id = db.Insert(new Person { Id = 1, FirstName = "Jimi }, selectIdentity:true) + + + + + Insert 1 POCO, use selectIdentity to retrieve the last insert AutoIncrement id (if any). E.g: + var id = db.Insert(new Person { Id = 1, FirstName = "Jimi }, selectIdentity:true) + + + + + Insert 1 or more POCOs in a transaction. E.g: + db.InsertAsync(new Person { Id = 1, FirstName = "Tupac", LastName = "Shakur", Age = 25 }, + new Person { Id = 2, FirstName = "Biggie", LastName = "Smalls", Age = 24 }) + + + + + Insert 1 or more POCOs in a transaction and modify populated IDbCommand with a commandFilter. E.g: + db.InsertAsync(dbCmd => applyFilter(dbCmd), token, + new Person { Id = 1, FirstName = "Tupac", LastName = "Shakur", Age = 25 }, + new Person { Id = 2, FirstName = "Biggie", LastName = "Smalls", Age = 24 }) + + + + + Insert a collection of POCOs in a transaction. E.g: + db.InsertAllAsync(new[] { new Person { Id = 9, FirstName = "Biggie", LastName = "Smalls", Age = 24 } }) + + + + + Insert a collection of POCOs in a transaction and modify populated IDbCommand with a commandFilter. E.g: + db.InsertAllAsync(new[] { new Person { Id = 9, FirstName = "Biggie", LastName = "Smalls", Age = 24 } }, + dbCmd => applyFilter(dbCmd)) + + + + + Updates 1 POCO. All fields are updated except for the PrimaryKey which is used as the identity selector. E.g: + db.Update(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 }) + + + + + Updates 1 or more POCOs in a transaction. E.g: + db.Update(new Person { Id = 1, FirstName = "Tupac", LastName = "Shakur", Age = 25 }, + new Person { Id = 2, FirstName = "Biggie", LastName = "Smalls", Age = 24 }) + + + + + Updates 1 or more POCOs in a transaction. E.g: + db.UpdateAll(new[] { new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 } }) + + + + + Delete rows using an anonymous type commandFilter. E.g: + db.Delete<Person>(new { FirstName = "Jimi", Age = 27 }) + + number of rows deleted + + + + Delete 1 row using all fields in the commandFilter. E.g: + db.Delete(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 }) + + number of rows deleted + + + + Delete 1 or more rows in a transaction using all fields in the commandFilter. E.g: + db.Delete(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27 }) + + + + + Delete 1 or more rows using only field with non-default values in the commandFilter. E.g: + db.DeleteNonDefaults(new Person { FirstName = "Jimi", Age = 27 }) + + number of rows deleted + + + + Delete 1 or more rows in a transaction using only field with non-default values in the commandFilter. E.g: + db.DeleteNonDefaults(new Person { FirstName = "Jimi", Age = 27 }, + new Person { FirstName = "Janis", Age = 27 }) + + number of rows deleted + + + + Delete 1 row by the PrimaryKey. E.g: + db.DeleteById<Person>(1) + + number of rows deleted + + + + Delete 1 row by the PrimaryKey where the rowVersion matches the optimistic concurrency field. + Will throw RowModefiedExeption if the + row does not exist or has a different row version. + E.g: db.DeleteById<Person>(1) + + + + + Delete all rows identified by the PrimaryKeys. E.g: + db.DeleteById<Person>(new[] { 1, 2, 3 }) + + number of rows deleted + + + + Delete all rows in the generic table type. E.g: + db.DeleteAll<Person>() + + number of rows deleted + + + + Delete all rows in the runtime table type. E.g: + db.DeleteAll(typeof(Person)) + + number of rows deleted + + + + Insert a new row or update existing row. Returns true if a new row was inserted. + Optional references param decides whether to save all related references as well. E.g: + db.SaveAsync(customer, references:true) + + true if a row was inserted; false if it was updated + + + + Insert new rows or update existing rows. Return number of rows added E.g: + db.SaveAsync(new Person { Id = 10, FirstName = "Amy", LastName = "Winehouse", Age = 27 }) + + number of rows added + + + + Insert new rows or update existing rows. Return number of rows added E.g: + db.SaveAllAsync(new [] { new Person { Id = 10, FirstName = "Amy", LastName = "Winehouse", Age = 27 } }) + + number of rows added + + + + Populates all related references on the instance with its primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveAllReferences(customer) + + + + + Populates the related references with the instance primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveReference(customer, customer.Orders) + + + + + Populates the related references with the instance primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveReference(customer, customer.Orders) + + + + + Populates the related references with the instance primary key and saves them. Uses '(T)Id' naming convention. E.g: + db.SaveReferences(customer, customer.Orders) + + + + + Use an SqlExpression to select which fields to update and construct the where expression, E.g: + + var q = db.From>Person<()); + db.UpdateOnly(new Person { FirstName = "JJ" }, q.Update(p => p.FirstName).Where(x => x.FirstName == "Jimi")); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("FirstName" = 'Jimi') + + What's not in the update expression doesn't get updated. No where expression updates all rows. E.g: + + db.UpdateOnly(new Person { FirstName = "JJ", LastName = "Hendo" }, ev.Update(p => p.FirstName)); + UPDATE "Person" SET "FirstName" = 'JJ' + + + + + Update only fields in the specified expression that matches the where condition (if any), E.g: + + db.UpdateOnly(() => new Person { FirstName = "JJ" }, where: p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + db.UpdateOnly(() => new Person { FirstName = "JJ" }); + UPDATE "Person" SET "FirstName" = 'JJ' + + + + + Update only fields in the specified expression that matches the where condition (if any), E.g: + + db.UpdateOnly(() => new Person { FirstName = "JJ" }, db.From>Person<().Where(p => p.LastName == "Hendrix")); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + + db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName); + UPDATE "Person" SET "FirstName" = 'JJ' + + db.UpdateOnly(new Person { FirstName = "JJ", Age = 27 }, p => new { p.FirstName, p.Age ); + UPDATE "Person" SET "FirstName" = 'JJ', "Age" = 27 + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + + db.UpdateOnly(new Person { FirstName = "JJ" }, new[]{ "FirstName" }, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + Numeric fields generates an increment sql which is useful to increment counters, etc... + avoiding concurrency conflicts + + db.UpdateAdd(() => new Person { Age = 5 }, where: p => p.LastName == "Hendrix"); + UPDATE "Person" SET "Age" = "Age" + 5 WHERE ("LastName" = 'Hendrix') + + db.UpdateAdd(() => new Person { Age = 5 }); + UPDATE "Person" SET "Age" = "Age" + 5 + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + Numeric fields generates an increment sql which is useful to increment counters, etc... + avoiding concurrency conflicts + + db.UpdateAdd(() => new Person { Age = 5 }, db.From<Person>().Where(p => p.LastName == "Hendrix")); + UPDATE "Person" SET "Age" = "Age" + 5 WHERE ("LastName" = 'Hendrix') + + + + + Updates all non-default values set on item matching the where condition (if any). E.g + + db.UpdateNonDefaults(new Person { FirstName = "JJ" }, p => p.FirstName == "Jimi"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("FirstName" = 'Jimi') + + + + + Updates all values set on item matching the where condition (if any). E.g + + db.Update(new Person { Id = 1, FirstName = "JJ" }, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "Id" = 1,"FirstName" = 'JJ',"LastName" = NULL,"Age" = 0 WHERE ("LastName" = 'Hendrix') + + + + + Updates all matching fields populated on anonymousType that matches where condition (if any). E.g: + + db.Update<Person>(new { FirstName = "JJ" }, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnly(new Person { FirstName = "Amy" }, p => p.FirstName)); + INSERT INTO "Person" ("FirstName") VALUES ('Amy'); + + db.InsertOnly(new Person { Id =1 , FirstName="Amy" }, p => new { p.Id, p.FirstName })); + INSERT INTO "Person" ("Id", "FirstName") VALUES (1, 'Amy'); + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnly(new Person { FirstName = "Amy" }, new[]{ "FirstName" })); + INSERT INTO "Person" ("FirstName") VALUES ('Amy'); + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnly(() => new Person { FirstName = "Amy" })); + INSERT INTO "Person" ("FirstName") VALUES (@FirstName); + + + + + Delete the rows that matches the where expression, e.g: + + db.Delete<Person>(p => p.Age == 27); + DELETE FROM "Person" WHERE ("Age" = 27) + + + + + Delete the rows that matches the where expression, e.g: + + var q = db.From<Person>()); + db.Delete<Person>(q.Where(p => p.Age == 27)); + DELETE FROM "Person" WHERE ("Age" = 27) + + + + + Use an SqlExpression to select which fields to update and construct the where expression, E.g: + + var q = db.From>Person<()); + db.UpdateOnly(new Person { FirstName = "JJ" }, q.Update(p => p.FirstName).Where(x => x.FirstName == "Jimi")); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("FirstName" = 'Jimi') + + What's not in the update expression doesn't get updated. No where expression updates all rows. E.g: + + db.UpdateOnly(new Person { FirstName = "JJ", LastName = "Hendo" }, ev.Update(p => p.FirstName)); + UPDATE "Person" SET "FirstName" = 'JJ' + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + + db.UpdateOnlyAsync(() => new Person { FirstName = "JJ" }, where: p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + db.UpdateOnlyAsync(() => new Person { FirstName = "JJ" }); + UPDATE "Person" SET "FirstName" = 'JJ' + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + + db.UpdateOnlyAsync(() => new Person { FirstName = "JJ" }, db.From<Person>().Where(p => p.LastName == "Hendrix")); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + + db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + db.UpdateOnly(new Person { FirstName = "JJ" }, p => p.FirstName); + UPDATE "Person" SET "FirstName" = 'JJ' + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + Numeric fields generates an increment sql which is useful to increment counters, etc... + avoiding concurrency conflicts + + db.UpdateAddAsync(() => new Person { Age = 5 }, where: p => p.LastName == "Hendrix"); + UPDATE "Person" SET "Age" = "Age" + 5 WHERE ("LastName" = 'Hendrix') + + db.UpdateAddAsync(() => new Person { Age = 5 }); + UPDATE "Person" SET "Age" = "Age" + 5 + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + + db.UpdateOnly(new Person { FirstName = "JJ" }, new[]{ "FirstName" }, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + + + + Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g: + Numeric fields generates an increment sql which is useful to increment counters, etc... + avoiding concurrency conflicts + + db.UpdateAddAsync(() => new Person { Age = 5 }, db.From<Person>().Where(p => p.LastName == "Hendrix")); + UPDATE "Person" SET "Age" = "Age" + 5 WHERE ("LastName" = 'Hendrix') + + + + + Updates all non-default values set on item matching the where condition (if any). E.g + + db.UpdateNonDefaults(new Person { FirstName = "JJ" }, p => p.FirstName == "Jimi"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("FirstName" = 'Jimi') + + + + + Updates all values set on item matching the where condition (if any). E.g + + db.Update(new Person { Id = 1, FirstName = "JJ" }, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "Id" = 1,"FirstName" = 'JJ',"LastName" = NULL,"Age" = 0 WHERE ("LastName" = 'Hendrix') + + + + + Updates all matching fields populated on anonymousType that matches where condition (if any). E.g: + + db.Update<Person>(new { FirstName = "JJ" }, p => p.LastName == "Hendrix"); + UPDATE "Person" SET "FirstName" = 'JJ' WHERE ("LastName" = 'Hendrix') + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnlyAsync(new Person { FirstName = "Amy" }, p => p.FirstName)); + INSERT INTO "Person" ("FirstName") VALUES ('Amy'); + + db.InsertOnlyAsync(new Person { Id =1 , FirstName="Amy" }, p => new { p.Id, p.FirstName })); + INSERT INTO "Person" ("Id", "FirstName") VALUES (1, 'Amy'); + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnly(new Person { FirstName = "Amy" }, new[]{ "FirstName" })); + INSERT INTO "Person" ("FirstName") VALUES ('Amy'); + + + + + Using an SqlExpression to only Insert the fields specified, e.g: + + db.InsertOnlyAsync(() => new Person { FirstName = "Amy" })); + INSERT INTO "Person" ("FirstName") VALUES (@FirstName); + + + + + Delete the rows that matches the where expression, e.g: + + db.Delete<Person>(p => p.Age == 27); + DELETE FROM "Person" WHERE ("Age" = 27) + + + + + Delete the rows that matches the where expression, e.g: + + var q = db.From>Person<()); + db.Delete<Person>(q.Where(p => p.Age == 27)); + DELETE FROM "Person" WHERE ("Age" = 27) + + + + + Nice SqlBuilder class by @samsaffron from Dapper.Contrib: + http://samsaffron.com/archive/2011/09/05/Digging+ourselves+out+of+the+mess+Linq-2-SQL+created + Modified to work in .NET 3.5 + + +
+
diff --git a/lib/ServiceStack.Razor.dll b/lib/ServiceStack.Razor.dll new file mode 100644 index 00000000..c71560cb Binary files /dev/null and b/lib/ServiceStack.Razor.dll differ diff --git a/lib/ServiceStack.Razor.xml b/lib/ServiceStack.Razor.xml new file mode 100644 index 00000000..40a64f8e --- /dev/null +++ b/lib/ServiceStack.Razor.xml @@ -0,0 +1,684 @@ + + + + ServiceStack.Razor + + + + + Provides service methods for compilation. + + + + + Determines if the specified type is an anonymous type. + + The type to check. + True if the type is an anonymous type, otherwise false. + + + + Determines if the specified type is a dynamic type. + + The type to check. + True if the type is an anonymous type, otherwise false. + + + + Gets the public or protected constructors of the specified type. + + The target type. + An enumerable of constructors. + + + + Gets an enumerable of all assemblies loaded in the current domain. + + An enumerable of loaded assemblies. + + + + Attempts to locate the nearest global directive file by + + + + + Gets or sets the root namespace used when the full namespace is inferred from the VirtualPath. + + + + + The purpose of the FileSystemWatcher is to ensure razor pages are + consistent with the code generated by the razor engine. The file + system watcher will invalidate pages and queue them for recompilation. + + + + + Avoid throwing unhandled exception when shutting down ASP.NET host + + + + + A common hook into ServiceStack and the hosting infrastructure used to resolve requests. + + + + + This is called by the hosting environment via CatchAll usually for content pages. + + + + + Called by the HtmlFormat:IPlugin who checks to see if any registered view engines can handle the response DTO. + If this view engine can handle the response DTO, then process it, otherwise, returning false will + allow another view engine to attempt to process it. If no view engines can process the DTO, + HtmlFormat will simply handle it itself. + + + + + This view manager is responsible for keeping track of all the + available Razor views and states of Razor pages. + + + + + Class to represent attribute values and, more importantly, + decipher them from tuple madness slightly. + + + + + Render Markdown for text/markdown and text/plain ContentTypes + + + + + Provides access to the anti-forgery system, which provides protection against + Cross-site Request Forgery (XSRF, also called CSRF) attacks. + + + + + Generates an anti-forgery token for this request. This token can + be validated by calling the Validate() method. + + An HTML string corresponding to an <input type="hidden"> + element. This element should be put inside a <form>. + + This method has a side effect: it may set a response cookie. + + + + + Generates an anti-forgery token pair (cookie and form token) for this request. + This method is similar to GetHtml(), but this method gives the caller control + over how to persist the returned values. To validate these tokens, call the + appropriate overload of Validate. + + The anti-forgery token - if any - that already existed + for this request. May be null. The anti-forgery system will try to reuse this cookie + value when generating a matching form token. + Will contain a new cookie value if the old cookie token + was null or invalid. If this value is non-null when the method completes, the caller + must persist this value in the form of a response cookie, and the existing cookie value + should be discarded. If this value is null when the method completes, the existing + cookie value was valid and needn't be modified. + The value that should be stored in the <form>. The caller + should take care not to accidentally swap the cookie and form tokens. + + Unlike the GetHtml() method, this method has no side effect. The caller + is responsible for setting the response cookie and injecting the returned + form token as appropriate. + + + + + Validates an anti-forgery token that was supplied for this request. + The anti-forgery token may be generated by calling GetHtml(). + + + Throws an HttpAntiForgeryException if validation fails. + + + + + Validates an anti-forgery token pair that was generated by the GetTokens method. + + The token that was supplied in the request cookie. + The token that was supplied in the request form body. + + Throws an HttpAntiForgeryException if validation fails. + + + + + Provides programmatic configuration for the anti-forgery token system. + + + + + Specifies an object that can provide additional data to put into all + generated tokens and that can validate additional data in incoming + tokens. + + + + + Specifies the name of the cookie that is used by the anti-forgery + system. + + + If an explicit name is not provided, the system will automatically + generate a name. + + + + + Specifies whether SSL is required for the anti-forgery system + to operate. If this setting is 'true' and a non-SSL request + comes into the system, all anti-forgery APIs will fail. + + + + + Specifies whether the anti-forgery system should skip checking + for conditions that might indicate misuse of the system. Please + use caution when setting this switch, as improper use could open + security holes in the application. + + + Setting this switch will disable several checks, including: + - Identity.IsAuthenticated = true without Identity.Name being set + - special-casing claims-based identities + + + + + If claims-based authorization is in use, specifies the claim + type from the identity that is used to uniquely identify the + user. If this property is set, all claims-based identities + must return unique values for this claim type. + + + If claims-based authorization is in use and this property has + not been set, the anti-forgery system will automatically look + for claim types "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" + and "http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider". + + + + + Allows providing or validating additional custom data for anti-forgery tokens. + For example, the developer could use this to supply a nonce when the token is + generated, then he could validate the nonce when the token is validated. + + + The anti-forgery system already embeds the client's username within the + generated tokens. This interface provides and consumes supplemental + data. If an incoming anti-forgery token contains supplemental data but no + additional data provider is configured, the supplemental data will not be + validated. + + + + + Provides additional data to be stored for the anti-forgery tokens generated + during this request. + + Information about the current request. + Supplemental data to embed within the anti-forgery token. + + + + Validates additional data that was embedded inside an incoming anti-forgery + token. + + Information about the current request. + Supplemental data that was embedded within the token. + True if the data is valid; false if the data is invalid. + + + + Initializes a new instance of the class. + + The base scope. + + The dictionary to use as a storage. Since the dictionary would be used as-is, we expect the implementer to + use the same key-value comparison logic as we do here. + + + + + Custom comparer for the context dictionaries + The comparer treats strings as a special case, performing case insesitive comparison. + This guaratees that we remain consistent throughout the chain of contexts since PageData dictionary + behaves in this manner. + + + + + Reference to MarkdownViewEngine + + + + + The AppHost so you can access configuration and resolve dependencies, etc. + + + + + This precompiled Markdown page with Metadata + + + + + ASP.NET MVC's HtmlHelper + + + + + All variables passed to and created by your page. + The Response DTO is stored and accessible via the 'Model' variable. + + All variables and outputs created are stored in ScopeArgs which is what's available + to your website template. The Generated page is stored in the 'Body' variable. + + + + + Whether HTML or Markdown output is requested + + + + + The Response DTO + + + + + Ensure the same instance is used for subclasses + + + + + Called before page is executed + + + + + Called after page is executed but before it's merged with the + website template if any. + + + + + Don't HTML encode safe output + + + + + + + Return the output of a different view with the specified name + using the supplied model + + + + + + + + Resolve registered Assemblies + + + + + + when true, (most) bare plain URLs are auto-hyperlinked + WARNING: this is a significant deviation from the markdown spec + + + + + when true, RETURN becomes a literal newline + WARNING: this is a significant deviation from the markdown spec + + + + + use ">" for HTML output, or " />" for XHTML output + + + + + when true, problematic URL characters like [, ], (, and so forth will be encoded + WARNING: this is a significant deviation from the markdown spec + + + + + when false, email addresses will never be auto-linked + WARNING: this is a significant deviation from the markdown spec + + + + + when true, bold and italic require non-word characters on either side + WARNING: this is a significant deviation from the markdown spec + + + + + Markdown is a text-to-HTML conversion tool for web writers. + Markdown allows you to write using an easy-to-read, easy-to-write plain text format, + then convert it to structurally valid XHTML (or HTML). + + + + + Create a new Markdown instance using default options + + + + + Create a new Markdown instance and optionally load options from a configuration + file. There they should be stored in the appSettings section, available options are: + + Markdown.StrictBoldItalic (true/false) + Markdown.EmptyElementSuffix (">" or " />" without the quotes) + Markdown.LinkEmails (true/false) + Markdown.AutoNewLines (true/false) + Markdown.AutoHyperlink (true/false) + Markdown.EncodeProblemUrlCharacters (true/false) + + + + + + Create a new Markdown instance and set the options from the MarkdownOptions object. + + + + + use ">" for HTML output, or " />" for XHTML output + + + + + when false, email addresses will never be auto-linked + WARNING: this is a significant deviation from the markdown spec + + + + + when true, bold and italic require non-word characters on either side + WARNING: this is a significant deviation from the markdown spec + + + + + when true, RETURN becomes a literal newline + WARNING: this is a significant deviation from the markdown spec + + + + + when true, (most) bare plain URLs are auto-hyperlinked + WARNING: this is a significant deviation from the markdown spec + + + + + when true, problematic URL characters like [, ], (, and so forth will be encoded + WARNING: this is a significant deviation from the markdown spec + + + + + maximum nested depth of [] and () supported by the transform; implementation detail + + + + + Tabs are automatically converted to spaces as part of the transform + this constant determines how "wide" those tabs become in spaces + + + + + In the static constuctor we'll initialize what stays the same across all transforms. + + + + + current version of MarkdownSharp; + see http://code.google.com/p/markdownsharp/ for the latest code or to contribute + + + + + Transforms the provided Markdown-formatted text to HTML; + see http://en.wikipedia.org/wiki/Markdown + + + The order in which other subs are called here is + essential. Link and image substitutions need to happen before + EscapeSpecialChars(), so that any *'s or _'s in the a + and img tags get encoded. + + + + + Perform transformations that form block-level tags like paragraphs, headers, and list items. + + + + + Perform transformations that occur *within* block-level tags like paragraphs, headers, and list items. + + + + + splits on two or more newlines, to form "paragraphs"; + each paragraph is then unhashed (if it is a hash and unhashing isn't turned off) or wrapped in HTML p tag + + + + + Reusable pattern to match balanced [brackets]. See Friedl's + "Mastering Regular Expressions", 2nd Ed., pp. 328-331. + + + + + Reusable pattern to match balanced (parens). See Friedl's + "Mastering Regular Expressions", 2nd Ed., pp. 328-331. + + + + + Strips link definitions from text, stores the URLs and titles in hash references. + + + ^[id]: url "optional title" + + + + + derived pretty much verbatim from PHP Markdown + + + + + replaces any block-level HTML blocks with hash entries + + + + + returns an array of HTML tokens comprising the input string. Each token is + either a tag (possibly with nested, tags contained therein, such + as <a href="<MTFoo>">, or a run of text between tags. Each element of the + array is a two-element array; the first is either 'tag' or 'text'; the second is + the actual value. + + + + + Turn Markdown link shortcuts into HTML anchor tags + + + [link text](url "title") + [link text][id] + [id] + + + + + Turn Markdown image shortcuts into HTML img tags. + + + ![alt text][id] + ![alt text](url "optional title") + + + + + Turn Markdown headers into HTML header tags + + + Header 1 + ======== + + Header 2 + -------- + + # Header 1 + ## Header 2 + ## Header 2 with closing hashes ## + ... + ###### Header 6 + + + + + Turn Markdown horizontal rules into HTML hr tags + + + *** + * * * + --- + - - - + + + + + Turn Markdown lists into HTML ul and ol and li tags + + + + + Process the contents of a single ordered or unordered list, splitting it + into individual list items. + + + + + /// Turn Markdown 4-space indented code into HTML pre code blocks + + + + + Turn Markdown `code spans` into HTML code tags + + + + + Turn Markdown *italics* and **bold** into HTML strong and em tags + + + + + Turn markdown line breaks (two space at end of line) into HTML break tags + + + + + Turn Markdown > quoted blocks into HTML blockquote blocks + + + + + Turn angle-delimited URLs into HTML anchor tags + + + <http://www.example.com> + + + + + Remove one level of line-leading spaces + + + + + encodes email address randomly + roughly 10% raw, 45% hex, 45% dec + note that @ is always encoded and : never is + + + + + Encode/escape certain Markdown characters inside code blocks and spans where they are literals + + + + + Encode any ampersands (that aren't part of an HTML entity) and left or right angle brackets + + + + + Encodes any escaped characters such as \`, \*, \[ etc + + + + + swap back in all the special characters we've hidden + + + + + escapes Bold [ * ] and Italic [ _ ] characters + + + + + hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems + + + + + Within tags -- meaning between < and > -- encode [\ ` * _] so they + don't conflict with their use in Markdown for code, italics and strong. + We're replacing each such character with its corresponding hash + value; this is likely overkill, but it should prevent us from colliding + with the escape values by accident. + + + + + convert all tabs to _tabWidth spaces; + standardizes line endings from DOS (CR LF) or Mac (CR) to UNIX (LF); + makes sure text ends with a couple of newlines; + removes any blank lines (only spaces) in the text + + + + + this is to emulate what's evailable in PHP + + + + diff --git a/lib/ServiceStack.Redis.dll b/lib/ServiceStack.Redis.dll new file mode 100644 index 00000000..122f5083 Binary files /dev/null and b/lib/ServiceStack.Redis.dll differ diff --git a/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.60/lib/net40/ServiceStack.Redis.XML b/lib/ServiceStack.Redis.xml similarity index 97% rename from src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.60/lib/net40/ServiceStack.Redis.XML rename to lib/ServiceStack.Redis.xml index bbb2a47b..9a33377b 100644 --- a/src/RedisStackOverflow/packages/ServiceStack.Redis.4.0.60/lib/net40/ServiceStack.Redis.XML +++ b/lib/ServiceStack.Redis.xml @@ -1,1600 +1,1624 @@ - - - - ServiceStack.Redis - - - - - Provides thread-safe retrievel of redis clients since each client is a new one. - Allows the configuration of different ReadWrite and ReadOnly hosts - - - BasicRedisClientManager for ICacheClient - - For more interoperabilty I'm also implementing the ICacheClient on - this cache client manager which has the affect of calling - GetCacheClient() for all write operations and GetReadOnlyCacheClient() - for the read ones. - - This works well for master-slave replication scenarios where you have - 1 master that replicates to multiple read slaves. - - - - - Hosts can be an IP Address or Hostname in the format: host[:port] - e.g. 127.0.0.1:6379 - default is: localhost:6379 - - The write hosts. - The read hosts. - - - - - Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts - - - - - - Returns a ReadOnly client using the hosts defined in ReadOnlyHosts. - - - - - - Gets or sets object key prefix. - - - - - Resolver strategy for resolving hosts and creating clients - - - - - Courtesy of @marcgravell - http://code.google.com/p/protobuf-net/source/browse/trunk/protobuf-net/BufferPool.cs - - - - - Provides thread-safe pooling of redis client connections. - - - - - Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts - - - - - - Called within a lock - - - - - - Disposes the write client. - - The client. - - - - The client wraps the native redis operations into a more readable c# API. - - Where possible these operations are also exposed in common c# interfaces, - e.g. RedisClient.Lists => IList[string] - RedisClient.Sets => ICollection[string] - - - - - This class contains all the common operations for the RedisClient. - The client contains a 1:1 mapping of c# methods to redis operations of the same name. - - Not threadsafe use a pooled manager - - - - - Used to manage connection pooling - - - - - Requires custom result parsing - - Number of results - - - - Command to set multuple binary safe arguments - - - - - - - Send command outside of managed Write Buffer - - - - - - reset buffer index in send buffer - - - - - Gets or sets object key prefix. - - - - - Creates a new instance of the Redis Client from NewFactoryFn. - - - - - Store object fields as a dictionary of values in a Hash value. - Conversion to Dictionary can be customized with RedisClient.ConvertToHashFn - - - - - Returns key with automatic object id detection in provided value with generic type. - - - - - - - Returns key with explicit object id. - - - - - - - Returns key with explicit object type and id. - - - - - - - - A complete redis command, with method to send command, receive response, and run callback on success or failure - - - - - Allows you to get Redis value operations to operate against POCO types. - - - - - - Use this to share the same redis connection with another - - The client. - - - - Pipeline for redis typed client - - - - - - Queue of commands for redis typed client - - - - - - Redis operation (transaction/pipeline) that allows queued commands to be completed - - - - - For interoperabilty GetCacheClient() and GetReadOnlyCacheClient() - return an ICacheClient wrapper around the redis manager which has the affect of calling - GetClient() for all write operations and GetReadOnlyClient() for the read ones. - - This works well for master-slave replication scenarios where you have - 1 master that replicates to multiple read slaves. - - - - - Ignore dispose on RedisClientsManager, which should be registered as a singleton - - - - - Useful wrapper IRedisClientsManager to cut down the boiler plate of most IRedisClient access - - - - - Creates a PubSubServer that uses a background thread to listen and process for - Redis Pub/Sub messages published to the specified channel. - Use optional callbacks to listen for message, error and life-cycle events. - Callbacks can be assigned later, then call Start() for PubSubServer to start listening for messages - - - - - A complete redis command, with method to send command, receive response, and run callback on success or failure - - - - - Redis command that does not get queued - - - - - Factory used to Create `RedisClient` instances - - - - - The default RedisClient Socket ConnectTimeout (default -1, None) - - - - - The default RedisClient Socket SendTimeout (default -1, None) - - - - - The default RedisClient Socket ReceiveTimeout (default -1, None) - - - - - Default Idle TimeOut before a connection is considered to be stale (default 240 secs) - - - - - The default RetryTimeout for auto retry of failed operations (default 3000ms) - - - - - Default Max Pool Size for Pooled Redis Client Managers (default none) - - - - - The BackOff multiplier failed Auto Retries starts from (default 10ms) - - - - - The Byte Buffer Size to combine Redis Operations within (default 1450 bytes) - - - - - The Byte Buffer Size for Operations to use a byte buffer pool (default 500kb) - - - - - Whether Connections to Master hosts should be verified they're still master instances (default true) - - - - - The ConnectTimeout on clients used to find the next available host (default 200ms) - - - - - Skip ServerVersion Checks by specifying Min Version number, e.g: 2.8.12 => 2812, 2.9.1 => 2910 - - - - - How long to hold deactivated clients for before disposing their connection (default 1 min) - Dispose of deactivated Clients immediately with TimeSpan.Zero - - - - - Whether Debug Logging should log detailed Redis operations (default false) - - - - - Resets Redis Config and Redis Stats back to default values - - - - - Initialize Sentinel Subscription and Configure Redis ClientsManager - - - - - Check if GetValidSentinel should try the next sentinel server - - - This will be true if the failures is less than either RedisSentinel.MaxFailures or the # of sentinels, whatever is greater - - - - Change to use a different IRedisClientsManager - - - - - Configure the Redis Connection String to use for a Redis Client Host - - - - - The configured Redis Client Manager this Sentinel managers - - - - - Fired when Sentinel fails over the Redis Client Manager to a new master - - - - - Fired when the Redis Sentinel Worker connection fails - - - - - Fired when the Sentinel worker receives a message from the Sentinel Subscription - - - - - Map the internal IP's returned by Sentinels to its external IP - - - - - Whether to routinely scan for other sentinel hosts (default true) - - - - - What interval to scan for other sentinel hosts (default 10 mins) - - - - - How long to wait after failing before connecting to next redis instance (default 250ms) - - - - - How long to retry connecting to hosts before throwing (default 60 secs) - - - - - How long to wait after consecutive failed connection attempts to master before forcing - a Sentinel to failover the current master (default 60 secs) - - - - - The Max Connection time for Sentinel Worker (default 100ms) - - - - - The Max TCP Socket Receive time for Sentinel Worker (default 100ms) - - - - - The Max TCP Socket Send time for Sentinel Worker (default 100ms) - - - - - Reset client connections when Sentinel reports redis instance is subjectively down (default true) - - - - - Reset client connections when Sentinel reports redis instance is objectively down (default true) - - - - - Event that is fired when the sentinel subscription raises an event - - - - - - - Don't immediately kill connections of active clients after failover to give them a chance to dispose gracefully. - Deactivating clients are automatically cleared from the pool. - - - - - Total number of commands sent - - - - - Number of times the Redis Client Managers have FailoverTo() either by sentinel or manually - - - - - Number of times a Client was deactivated from the pool, either by FailoverTo() or exceptions on client - - - - - Number of times connecting to a Sentinel has failed - - - - - Number of times we've forced Sentinel to failover to another master due to - consecutive errors beyond sentinel.WaitBeforeForcingMasterFailover - - - - - Number of times a connecting to a reported Master wasn't actually a Master - - - - - Number of times no Masters could be found in any of the configured hosts - - - - - Number of Redis Client instances created with RedisConfig.ClientFactory - - - - - Number of times a Redis Client was created outside of pool, either due to overflow or reserved slot was overridden - - - - - Number of times Redis Sentinel reported a Subjective Down (sdown) - - - - - Number of times Redis Sentinel reported an Objective Down (sdown) - - - - - Number of times a Redis Request was retried due to Socket or Retryable exception - - - - - Number of times a Request succeeded after it was retried - - - - - Number of times a Retry Request failed after exceeding RetryTimeout - - - - - Total number of deactivated clients that are pending being disposed - - - - - Redis-specific exception. Thrown if unable to connect to Redis server due to socket exception, for example. - - - - - Provides a redis connection pool that can be sharded - - - - - Provides thread-safe pooling of redis client connections. - Allows load-balancing of master-write and read-slave hosts, ideal for - 1 master and multiple replicated read slaves. - - - - - Hosts can be an IP Address or Hostname in the format: host[:port] - e.g. 127.0.0.1:6379 - default is: localhost:6379 - - The write hosts. - The read hosts. - The config. - - - - Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts - - - - - - Called within a lock - - - - - - Returns a ReadOnly client using the hosts defined in ReadOnlyHosts. - - - - - - Called within a lock - - - - - - Disposes the read only client. - - The client. - - - - Disposes the write client. - - The client. - - - - Gets or sets object key prefix. - - - - - Manage a client acquired from the PooledRedisClientManager - Dispose method will release the client back to the pool. - - - - - wrap the acquired client - - - - - - release the wrapped client back to the pool - - - - - access the wrapped client - - - - - logical name - - - - - An arbitrary weight relative to other nodes - - - - logical name - An arbitrary weight relative to other nodes - redis nodes - - - - Provides sharding of redis client connections. - uses consistent hashing to distribute keys across connection pools - - - - - maps a key to a redis connection pool - - key to map - a redis connection pool - - - - Adds a node and maps points across the circle - - node to add - An arbitrary number, specifies how often it occurs relative to other targets. - - - - A variation of Binary Search algorithm. Given a number, matches the next highest number from the sorted array. - If a higher number does not exist, then the first number in the array is returned. - - a sorted array to perform the search - number to find the next highest number against - next highest number - - - - Given a key, generates an unsigned 64 bit hash code using MD5 - - - - - - - Provides access to the method reflection data as part of the before/after event - - - - - Stores details about the context in which an IRedisClient is allocated. - - - - - - Tracks each IRedisClient instance allocated from the IRedisClientsManager logging when they are allocated and disposed. - Periodically writes the allocated instances to the log for diagnostic purposes. - - - - - Distributed lock interface - - - - - Optimized implementation. Primitive types are manually serialized, the rest are serialized using binary serializer />. - - - - - serialize/deserialize arbitrary objects - (objects must be serializable) - - - - - Serialize object to buffer - - serializable object - - - - - Deserialize buffer to object - - byte array to deserialize - - - - - - - - - - - - - - - - - - - serialize value and wrap with - - - - - - - Unwrap object wrapped in - - - - - - - pop numProcessed items from queue and unlock queue for work item id that dequeued - items are associated with - - - - - - A dequeued work item has been processed. When all of the dequeued items have been processed, - all items will be popped from the queue,and the queue unlocked for the work item id that - the dequeued items are associated with - - - - - Update first unprocessed item with new work item. - - - - - - - - - - - distributed work item queue. Each message must have an associated - work item id. For a given id, all work items are guaranteed to be processed - in the order in which they are received. - - - - - distributed work item queue. Each message must have an associated - work item id. For a given id, all work items are guaranteed to be processed - in the order in which they are received. - - - - - - - distributed work item queue - - - - - Enqueue item in priority queue corresponding to workItemId identifier - - - - - - - Preprare next work item id for dequeueing - - - - - Dequeue up to maxBatchSize items from queue corresponding to workItemId identifier. - Once this method is called, or will not - return any items for workItemId until the dequeue lock returned is unlocked. - - - - - - - - Replace existing work item in workItemId queue - - - - - - - - Queue incoming messages - - - - - - - Must call this periodically to move work items from priority queue to pending queue - - - - - Replace existing work item in workItemId queue - - - - - - - - Pop items from list - - - - - - - Force release of locks held by crashed servers - - - - - release lock held by crashed server - - - - true if lock is released, either by this method or by another client; false otherwise - - - - Unlock work item id, so other servers can process items for this id - - - - - - - - - - - - - - - - - - - - - - - - - - - pop remaining items that were returned by dequeue, and unlock queue - - - - - - indicate that an item has been processed by the caller - - - - - Update first unprocessed work item - - - - - - wraps a serialized representation of an object - - - - - - Initializes a new instance of . - - Custom item data. - The serialized item. - - - - The data representing the item being stored/retireved. - - - - - Flags set for this instance. - - - - - distributed lock class that follows the Resource Allocation Is Initialization pattern - - - - - Lock - - - - in seconds - in seconds - - - - unlock - - - - - Enqueue item - - - - - - Dequeue up to maxBatchSize items from queue - - - - - - - distributed work item queue. Messages are processed in chronological order - - - - - Enqueue incoming messages - - - - - - - - Dequeue next batch of work items - - - - - - - - - simple distributed work item queue - - - - - - - Queue incoming messages - - - - - - Dequeue next batch of work items for processing. After this method is called, - no other work items with same id will be available for - dequeuing until PostDequeue is called - - KeyValuePair: key is work item id, and value is list of dequeued items. - - - - - Serialize object to buffer - - serializable object - - - - - - - array of serializable objects - - - - - Deserialize buffer to object - - byte array to deserialize - - - - - - customize the client serializer - - - - - - - - - General purpose pipeline - - - - - - Flush send buffer, and read responses - - - - - Wrap the common redis set operations under a ICollection[string] interface. - - - - - Adds support for Redis Transactions (i.e. MULTI/EXEC/DISCARD operations). - - - - - Put "QUEUED" messages at back of queue - - - - - - Issue exec command (not queued) - - - - - callback for after result count is read in - - - - - - Wrap the common redis set operations under a ICollection[string] interface. - - - - - Wrap the common redis set operations under a ICollection[string] interface. - - - - - Wrap the common redis set operations under a ICollection[string] interface. - - - - - Adds support for Redis Transactions (i.e. MULTI/EXEC/DISCARD operations). - - - - - Put "QUEUED" messages at back of queue - - - - - - Issue exec command (not queued) - - - - - callback for after result count is read in - - - - - - Wrap the common redis set operations under a ICollection[string] interface. - - - - - Wrap the common redis set operations under a ICollection[string] interface. - - - - - Wrap the common redis list operations under a IList[string] interface. - - - - - Represents a generic collection of key/value pairs that are ordered independently of the key and value. - - The type of the keys in the dictionary - The type of the values in the dictionary - - - - Adds an entry with the specified key and value into the IOrderedDictionary<TKey,TValue> collection with the lowest available index. - - The key of the entry to add. - The value of the entry to add. - The index of the newly added entry - - You can also use the property to add new elements by setting the value of a key that does not exist in the IOrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the IOrderedDictionary<TKey,TValue>, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - An element with the same key already exists in the IOrderedDictionary<TKey,TValue> - The IOrderedDictionary<TKey,TValue> is read-only.
- -or-
- The IOrderedDictionary<TKey,TValue> has a fized size.
-
- - - Inserts a new entry into the IOrderedDictionary<TKey,TValue> collection with the specified key and value at the specified index. - - The zero-based index at which the element should be inserted. - The key of the entry to add. - The value of the entry to add. The value can be if the type of the values in the dictionary is a reference type. - is less than 0.
- -or-
- is greater than .
- An element with the same key already exists in the IOrderedDictionary<TKey,TValue>. - The IOrderedDictionary<TKey,TValue> is read-only.
- -or-
- The IOrderedDictionary<TKey,TValue> has a fized size.
-
- - - Gets or sets the value at the specified index. - - The zero-based index of the value to get or set. - The value of the item at the specified index. - is less than 0.
- -or-
- is equal to or greater than .
-
- - - Represents a generic collection of key/value pairs that are ordered independently of the key and value. - - The type of the keys in the dictionary - The type of the values in the dictionary - - - - Initializes a new instance of the OrderedDictionary<TKey,TValue> class. - - - - - Initializes a new instance of the OrderedDictionary<TKey,TValue> class using the specified initial capacity. - - The initial number of elements that the OrderedDictionary<TKey,TValue> can contain. - is less than 0 - - - - Initializes a new instance of the OrderedDictionary<TKey,TValue> class using the specified comparer. - - The IEqualityComparer<TKey> to use when comparing keys, or to use the default EqualityComparer<TKey> for the type of the key. - - - - Initializes a new instance of the OrderedDictionary<TKey,TValue> class using the specified initial capacity and comparer. - - The initial number of elements that the OrderedDictionary<TKey,TValue> collection can contain. - The IEqualityComparer<TKey> to use when comparing keys, or to use the default EqualityComparer<TKey> for the type of the key. - is less than 0 - - - - Converts the object passed as a key to the key type of the dictionary - - The key object to check - The key object, cast as the key type of the dictionary - is . - The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . - - - - Converts the object passed as a value to the value type of the dictionary - - The object to convert to the value type of the dictionary - The value object, converted to the value type of the dictionary - is , and the value type of the OrderedDictionary<TKey,TValue> is a value type. - The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . - - - - Inserts a new entry into the OrderedDictionary<TKey,TValue> collection with the specified key and value at the specified index. - - The zero-based index at which the element should be inserted. - The key of the entry to add. - The value of the entry to add. The value can be if the type of the values in the dictionary is a reference type. - is less than 0.
- -or-
- is greater than .
- is . - An element with the same key already exists in the OrderedDictionary<TKey,TValue>. -
- - - Inserts a new entry into the OrderedDictionary<TKey,TValue> collection with the specified key and value at the specified index. - - The zero-based index at which the element should be inserted. - The key of the entry to add. - The value of the entry to add. The value can be if the type of the values in the dictionary is a reference type. - is less than 0.
- -or-
- is greater than .
- is .
- -or-
- is , and the value type of the OrderedDictionary<TKey,TValue> is a value type.
- The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
- -or-
- The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
- -or-
- An element with the same key already exists in the OrderedDictionary<TKey,TValue>.
-
- - - Removes the entry at the specified index from the OrderedDictionary<TKey,TValue> collection. - - The zero-based index of the entry to remove. - is less than 0.
- -or-
- index is equal to or greater than .
-
- - - Adds an entry with the specified key and value into the OrderedDictionary<TKey,TValue> collection with the lowest available index. - - The key of the entry to add. - The value of the entry to add. This value can be . - A key cannot be , but a value can be. - You can also use the property to add new elements by setting the value of a key that does not exist in the OrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the OrderedDictionary<TKey,TValue>, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - is - An element with the same key already exists in the OrderedDictionary<TKey,TValue> - - - - Adds an entry with the specified key and value into the OrderedDictionary<TKey,TValue> collection with the lowest available index. - - The key of the entry to add. - The value of the entry to add. This value can be . - The index of the newly added entry - A key cannot be , but a value can be. - You can also use the property to add new elements by setting the value of a key that does not exist in the OrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the OrderedDictionary<TKey,TValue>, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - is - An element with the same key already exists in the OrderedDictionary<TKey,TValue> - - - - Adds an entry with the specified key and value into the OrderedDictionary<TKey,TValue> collection with the lowest available index. - - The key of the entry to add. - The value of the entry to add. This value can be . - is .
- -or-
- is , and the value type of the OrderedDictionary<TKey,TValue> is a value type.
- The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
- -or-
- The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
-
- - - Removes all elements from the OrderedDictionary<TKey,TValue> collection. - - The capacity is not changed as a result of calling this method. - - - - Determines whether the OrderedDictionary<TKey,TValue> collection contains a specific key. - - The key to locate in the OrderedDictionary<TKey,TValue> collection. - if the OrderedDictionary<TKey,TValue> collection contains an element with the specified key; otherwise, . - is - - - - Determines whether the OrderedDictionary<TKey,TValue> collection contains a specific key. - - The key to locate in the OrderedDictionary<TKey,TValue> collection. - if the OrderedDictionary<TKey,TValue> collection contains an element with the specified key; otherwise, . - is - The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . - - - - Returns the zero-based index of the specified key in the OrderedDictionary<TKey,TValue> - - The key to locate in the OrderedDictionary<TKey,TValue> - The zero-based index of , if is found in the OrderedDictionary<TKey,TValue>; otherwise, -1 - This method performs a linear search; therefore it has a cost of O(n) at worst. - - - - Removes the entry with the specified key from the OrderedDictionary<TKey,TValue> collection. - - The key of the entry to remove - if the key was found and the corresponding element was removed; otherwise, - - - - Removes the entry with the specified key from the OrderedDictionary<TKey,TValue> collection. - - The key of the entry to remove - - - - Copies the elements of the OrderedDictionary<TKey,TValue> elements to a one-dimensional Array object at the specified index. - - The one-dimensional object that is the destination of the objects copied from the OrderedDictionary<TKey,TValue>. The must have zero-based indexing. - The zero-based index in at which copying begins. - The method preserves the order of the elements in the OrderedDictionary<TKey,TValue> - - - - Gets the value associated with the specified key. - - The key of the value to get. - When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of . This parameter can be passed uninitialized. - if the OrderedDictionary<TKey,TValue> contains an element with the specified key; otherwise, . - - - - Adds the specified value to the OrderedDictionary<TKey,TValue> with the specified key. - - The KeyValuePair<TKey,TValue> structure representing the key and value to add to the OrderedDictionary<TKey,TValue>. - - - - Determines whether the OrderedDictionary<TKey,TValue> contains a specific key and value. - - The KeyValuePair<TKey,TValue> structure to locate in the OrderedDictionary<TKey,TValue>. - if is found in the OrderedDictionary<TKey,TValue>; otherwise, . - - - - Copies the elements of the OrderedDictionary<TKey,TValue> to an array of type , starting at the specified index. - - The one-dimensional array of type KeyValuePair<TKey,TValue> that is the destination of the KeyValuePair<TKey,TValue> elements copied from the OrderedDictionary<TKey,TValue>. The array must have zero-based indexing. - The zero-based index in at which copying begins. - - - - Removes a key and value from the dictionary. - - The KeyValuePair<TKey,TValue> structure representing the key and value to remove from the OrderedDictionary<TKey,TValue>. - if the key and value represented by is successfully found and removed; otherwise, . This method returns if is not found in the OrderedDictionary<TKey,TValue>. - - - - Gets the dictionary object that stores the keys and values - - The dictionary object that stores the keys and values for the OrderedDictionary<TKey,TValue> - Accessing this property will create the dictionary object if necessary - - - - Gets the list object that stores the key/value pairs. - - The list object that stores the key/value pairs for the OrderedDictionary<TKey,TValue> - Accessing this property will create the list object if necessary. - - - - Gets or sets the value at the specified index. - - The zero-based index of the value to get or set. - The value of the item at the specified index. - is less than 0.
- -or-
- index is equal to or greater than .
-
- - - Gets or sets the value at the specified index. - - The zero-based index of the value to get or set. - The value of the item at the specified index. - is less than 0.
- -or-
- index is equal to or greater than .
- is a null reference, and the value type of the OrderedDictionary<TKey,TValue> is a value type. - The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . -
- - - Gets a value indicating whether the OrderedDictionary<TKey,TValue> has a fixed size. - - if the OrderedDictionary<TKey,TValue> has a fixed size; otherwise, . The default is . - - - - Gets a value indicating whether the OrderedDictionary<TKey,TValue> collection is read-only. - - if the OrderedDictionary<TKey,TValue> is read-only; otherwise, . The default is . - - A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created. - A collection that is read-only is simply a collection with a wrapper that prevents modification of the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes. - - - - - Gets an object containing the keys in the OrderedDictionary<TKey,TValue>. - - An object containing the keys in the OrderedDictionary<TKey,TValue>. - The returned object is not a static copy; instead, the collection refers back to the keys in the original OrderedDictionary<TKey,TValue>. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the key collection. - - - - Gets an object containing the values in the OrderedDictionary<TKey,TValue> collection. - - An object containing the values in the OrderedDictionary<TKey,TValue> collection. - The returned object is not a static copy; instead, the refers back to the values in the original OrderedDictionary<TKey,TValue> collection. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the . - - - - Gets or sets the value with the specified key. - - The key of the value to get or set. - The value associated with the specified key. If the specified key is not found, attempting to get it returns , and attempting to set it creates a new element using the specified key. - - - - Gets or sets the value with the specified key. - - The key of the value to get or set. - The value associated with the specified key. If the specified key is not found, attempting to get it returns , and attempting to set it creates a new element using the specified key. - - - - Gets the number of key/values pairs contained in the OrderedDictionary<TKey,TValue> collection. - - The number of key/value pairs contained in the OrderedDictionary<TKey,TValue> collection. - - - - Gets a value indicating whether access to the OrderedDictionary<TKey,TValue> object is synchronized (thread-safe). - - This method always returns false. - - - - Gets an object that can be used to synchronize access to the OrderedDictionary<TKey,TValue> object. - - An object that can be used to synchronize access to the OrderedDictionary<TKey,TValue> object. - - - - Gets an ICollection<TKey> object containing the keys in the OrderedDictionary<TKey,TValue>. - - An ICollection<TKey> object containing the keys in the OrderedDictionary<TKey,TValue>. - The returned ICollection<TKey> object is not a static copy; instead, the collection refers back to the keys in the original OrderedDictionary<TKey,TValue>. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the key collection. - - - - Gets an ICollection<TValue> object containing the values in the OrderedDictionary<TKey,TValue>. - - An ICollection<TValue> object containing the values in the OrderedDictionary<TKey,TValue>. - The returned ICollection<TKey> object is not a static copy; instead, the collection refers back to the values in the original OrderedDictionary<TKey,TValue>. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the value collection. - - - - acquire distributed, non-reentrant lock on key - - global key for this lock - timeout for acquiring lock - timeout for lock, in seconds (stored as value against lock key) - - - - - - unlock key - - - - - - - - - - - - - Locking strategy interface - - - - - This class manages a read lock for a local readers/writer lock, - using the Resource Acquisition Is Initialization pattern - - - - - RAII initialization - - - - - - RAII disposal - - - - - This class manages a write lock for a local readers/writer lock, - using the Resource Acquisition Is Initialization pattern - - - - - - RAII disposal - - - - - manages a "region" in the redis key space - namespace can be cleared by incrementing the generation - - - - - get current generation - - - - - - set new generation - - - - - - redis key for generation - - - - - - get redis key that holds all namespace keys - - - - - - get global cache key - - - - - - - get global key inside of this namespace - - - prefixes can be added for name deconfliction - - - - - replace UniqueCharacter with its double, to avoid name clash - - - - - - - - - - - - - - get locking strategy - - -
-
+ + + + ServiceStack.Redis + + + + + Provides thread-safe retrievel of redis clients since each client is a new one. + Allows the configuration of different ReadWrite and ReadOnly hosts + + + BasicRedisClientManager for ICacheClient + + For more interoperabilty I'm also implementing the ICacheClient on + this cache client manager which has the affect of calling + GetCacheClient() for all write operations and GetReadOnlyCacheClient() + for the read ones. + + This works well for master-slave replication scenarios where you have + 1 master that replicates to multiple read slaves. + + + + + Gets or sets object key prefix. + + + + + Hosts can be an IP Address or Hostname in the format: host[:port] + e.g. 127.0.0.1:6379 + default is: localhost:6379 + + The write hosts. + The read hosts. + + + + + Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts + + + + + + Returns a ReadOnly client using the hosts defined in ReadOnlyHosts. + + + + + + Courtesy of @marcgravell + http://code.google.com/p/protobuf-net/source/browse/trunk/protobuf-net/BufferPool.cs + + + + + A complete redis command, with method to send command, receive response, and run callback on success or failure + + + + + Wrap the common redis set operations under a ICollection[string] interface. + + + + + Wrap the common redis set operations under a ICollection[string] interface. + + + + + Wrap the common redis set operations under a ICollection[string] interface. + + + + + Allows you to get Redis value operations to operate against POCO types. + + + + + + Use this to share the same redis connection with another + + The client. + + + + Queue of commands for redis typed client + + + + + + Adds support for Redis Transactions (i.e. MULTI/EXEC/DISCARD operations). + + + + + Put "QUEUED" messages at back of queue + + + + + + Issue exec command (not queued) + + + + + callback for after result count is read in + + + + + + Pipeline for redis typed client + + + + + + Resolver strategy for resolving hosts and creating clients + + + + + A complete redis command, with method to send command, receive response, and run callback on success or failure + + + + + General purpose pipeline + + + + + + Flush send buffer, and read responses + + + + + Redis command that does not get queued + + + + + + + + + Redis operation (transaction/pipeline) that allows queued commands to be completed + + + + + Provides thread-safe pooling of redis client connections. + Allows load-balancing of master-write and read-slave hosts, ideal for + 1 master and multiple replicated read slaves. + + + + + Gets or sets object key prefix. + + + + + Hosts can be an IP Address or Hostname in the format: host[:port] + e.g. 127.0.0.1:6379 + default is: localhost:6379 + + The write hosts. + The read hosts. + The config. + + + + Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts + + + + + + Called within a lock + + + + + + Returns a ReadOnly client using the hosts defined in ReadOnlyHosts. + + + + + + Called within a lock + + + + + + Disposes the read only client. + + The client. + + + + Disposes the write client. + + The client. + + + + Manage a client acquired from the PooledRedisClientManager + Dispose method will release the client back to the pool. + + + + + wrap the acquired client + + + + + + access the wrapped client + + + + + release the wrapped client back to the pool + + + + + The client wraps the native redis operations into a more readable c# API. + + Where possible these operations are also exposed in common c# interfaces, + e.g. RedisClient.Lists => IList[string] + RedisClient.Sets => ICollection[string] + + + + + Creates a new instance of the Redis Client from NewFactoryFn. + + + + + Store object fields as a dictionary of values in a Hash value. + Conversion to Dictionary can be customized with RedisClient.ConvertToHashFn + + + + + Returns key with automatic object id detection in provided value with generic type. + + + + + + + Returns key with explicit object id. + + + + + + + Returns key with explicit object type and id. + + + + + + + + Wrap the common redis set operations under a ICollection[string] interface. + + + + + Wrap the common redis list operations under a IList[string] interface. + + + + + For interoperabilty GetCacheClient() and GetReadOnlyCacheClient() + return an ICacheClient wrapper around the redis manager which has the affect of calling + GetClient() for all write operations and GetReadOnlyClient() for the read ones. + + This works well for master-slave replication scenarios where you have + 1 master that replicates to multiple read slaves. + + + + + Ignore dispose on RedisClientsManager, which should be registered as a singleton + + + + + Wrap the common redis set operations under a ICollection[string] interface. + + + + + Useful wrapper IRedisClientsManager to cut down the boiler plate of most IRedisClient access + + + + + Creates a PubSubServer that uses a background thread to listen and process for + Redis Pub/Sub messages published to the specified channel. + Use optional callbacks to listen for message, error and life-cycle events. + Callbacks can be assigned later, then call Start() for PubSubServer to start listening for messages + + + + + Wrap the common redis set operations under a ICollection[string] interface. + + + + + Factory used to Create `RedisClient` instances + + + + + The default RedisClient Socket ConnectTimeout (default -1, None) + + + + + The default RedisClient Socket SendTimeout (default -1, None) + + + + + The default RedisClient Socket ReceiveTimeout (default -1, None) + + + + + Default Idle TimeOut before a connection is considered to be stale (default 240 secs) + + + + + The default RetryTimeout for auto retry of failed operations (default 10,000ms) + + + + + Default Max Pool Size for Pooled Redis Client Managers (default none) + + + + + The BackOff multiplier failed Auto Retries starts from (default 10ms) + + + + + The Byte Buffer Size to combine Redis Operations within (default 1450 bytes) + + + + + The Byte Buffer Size for Operations to use a byte buffer pool (default 500kb) + + + + + Whether Connections to Master hosts should be verified they're still master instances (default true) + + + + + The ConnectTimeout on clients used to find the next available host (default 200ms) + + + + + Skip ServerVersion Checks by specifying Min Version number, e.g: 2.8.12 => 2812, 2.9.1 => 2910 + + + + + How long to hold deactivated clients for before disposing their connection (default 1 min) + Dispose of deactivated Clients immediately with TimeSpan.Zero + + + + + Whether Debug Logging should log detailed Redis operations (default false) + + + + + Resets Redis Config and Redis Stats back to default values + + + + + Redis-specific exception. Thrown if unable to connect to Redis server due to socket exception, for example. + + + + + Configuration class for the RedisManagerPool + + + + + Default pool size used by every new instance of . (default: 40) + + + + + Maximum ammount of s created by the . + + + + + Provides thread-safe pooling of redis client connections. All connections are treaded as read and write hosts. + + + + + Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts + + + + + + Called within a lock + + + + + + Disposes the write client. + + The client. + + + + This class contains all the common operations for the RedisClient. + The client contains a 1:1 mapping of c# methods to redis operations of the same name. + + Not threadsafe, use a pooled manager! + All redis calls on a single instances write to the same Socket. + If used in multiple threads (or async Tasks) at the same time you will find + that commands are not executed properly by redis and Servicestack wont be able to (json) serialize + the data that comes back. + + + + + Used to manage connection pooling + + + + + Gets or sets object key prefix. + + + + + Requires custom result parsing + + Number of results + + + + Command to set multuple binary safe arguments + + + + + + + Send command outside of managed Write Buffer + + + + + + reset buffer index in send buffer + + + + + Callback fired on each message received, handle with (channel, msg) => ... + + + + + Change to use a different IRedisClientsManager + + + + + Configure the Redis Connection String to use for a Redis Client Host + + + + + The configured Redis Client Manager this Sentinel managers + + + + + Fired when Sentinel fails over the Redis Client Manager to a new master + + + + + Fired when the Redis Sentinel Worker connection fails + + + + + Fired when the Sentinel worker receives a message from the Sentinel Subscription + + + + + Map the internal IP's returned by Sentinels to its external IP + + + + + Whether to routinely scan for other sentinel hosts (default true) + + + + + What interval to scan for other sentinel hosts (default 10 mins) + + + + + How long to wait after failing before connecting to next redis instance (default 250ms) + + + + + How long to retry connecting to hosts before throwing (default 60 secs) + + + + + How long to wait after consecutive failed connection attempts to master before forcing + a Sentinel to failover the current master (default 60 secs) + + + + + The Max Connection time for Sentinel Worker (default 100ms) + + + + + The Max TCP Socket Receive time for Sentinel Worker (default 100ms) + + + + + The Max TCP Socket Send time for Sentinel Worker (default 100ms) + + + + + Reset client connections when Sentinel reports redis instance is subjectively down (default true) + + + + + Reset client connections when Sentinel reports redis instance is objectively down (default true) + + + + + Initialize Sentinel Subscription and Configure Redis ClientsManager + + + + + Check if GetValidSentinel should try the next sentinel server + + + This will be true if the failures is less than either RedisSentinel.MaxFailures or the # of sentinels, whatever is greater + + + + Event that is fired when the sentinel subscription raises an event + + + + + + + Don't immediately kill connections of active clients after failover to give them a chance to dispose gracefully. + Deactivating clients are automatically cleared from the pool. + + + + + Total number of commands sent + + + + + Number of times the Redis Client Managers have FailoverTo() either by sentinel or manually + + + + + Number of times a Client was deactivated from the pool, either by FailoverTo() or exceptions on client + + + + + Number of times connecting to a Sentinel has failed + + + + + Number of times we've forced Sentinel to failover to another master due to + consecutive errors beyond sentinel.WaitBeforeForcingMasterFailover + + + + + Number of times a connecting to a reported Master wasn't actually a Master + + + + + Number of times no Masters could be found in any of the configured hosts + + + + + Number of Redis Client instances created with RedisConfig.ClientFactory + + + + + Number of times a Redis Client was created outside of pool, either due to overflow or reserved slot was overridden + + + + + Number of times Redis Sentinel reported a Subjective Down (sdown) + + + + + Number of times Redis Sentinel reported an Objective Down (sdown) + + + + + Number of times a Redis Request was retried due to Socket or Retryable exception + + + + + Number of times a Request succeeded after it was retried + + + + + Number of times a Retry Request failed after exceeding RetryTimeout + + + + + Total number of deactivated clients that are pending being disposed + + + + + Provides a redis connection pool that can be sharded + + + + + logical name + + + + + An arbitrary weight relative to other nodes + + + + logical name + An arbitrary weight relative to other nodes + redis nodes + + + + Provides sharding of redis client connections. + uses consistent hashing to distribute keys across connection pools + + + + + maps a key to a redis connection pool + + key to map + a redis connection pool + + + + Adds a node and maps points across the circle + + node to add + An arbitrary number, specifies how often it occurs relative to other targets. + + + + A variation of Binary Search algorithm. Given a number, matches the next highest number from the sorted array. + If a higher number does not exist, then the first number in the array is returned. + + a sorted array to perform the search + number to find the next highest number against + next highest number + + + + Given a key, generates an unsigned 64 bit hash code using MD5 + + + + + + + Provides access to the method reflection data as part of the before/after event + + + + + Stores details about the context in which an IRedisClient is allocated. + + + + + + Tracks each IRedisClient instance allocated from the IRedisClientsManager logging when they are allocated and disposed. + Periodically writes the allocated instances to the log for diagnostic purposes. + + + + + Represents a generic collection of key/value pairs that are ordered independently of the key and value. + + The type of the keys in the dictionary + The type of the values in the dictionary + + + + Adds an entry with the specified key and value into the IOrderedDictionary<TKey,TValue> collection with the lowest available index. + + The key of the entry to add. + The value of the entry to add. + The index of the newly added entry + + You can also use the property to add new elements by setting the value of a key that does not exist in the IOrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the IOrderedDictionary<TKey,TValue>, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + An element with the same key already exists in the IOrderedDictionary<TKey,TValue> + The IOrderedDictionary<TKey,TValue> is read-only.
+ -or-
+ The IOrderedDictionary<TKey,TValue> has a fized size.
+
+ + + Inserts a new entry into the IOrderedDictionary<TKey,TValue> collection with the specified key and value at the specified index. + + The zero-based index at which the element should be inserted. + The key of the entry to add. + The value of the entry to add. The value can be if the type of the values in the dictionary is a reference type. + is less than 0.
+ -or-
+ is greater than .
+ An element with the same key already exists in the IOrderedDictionary<TKey,TValue>. + The IOrderedDictionary<TKey,TValue> is read-only.
+ -or-
+ The IOrderedDictionary<TKey,TValue> has a fized size.
+
+ + + Gets or sets the value at the specified index. + + The zero-based index of the value to get or set. + The value of the item at the specified index. + is less than 0.
+ -or-
+ is equal to or greater than .
+
+ + + distributed lock class that follows the Resource Allocation Is Initialization pattern + + + + + Lock + + + + in seconds + in seconds + + + + unlock + + + + + acquire distributed, non-reentrant lock on key + + global key for this lock + timeout for acquiring lock + timeout for lock, in seconds (stored as value against lock key) + + + + + + unlock key + + + + + + + + + + + + + Distributed lock interface + + + + + Locking strategy interface + + + + + This class manages a read lock for a local readers/writer lock, + using the Resource Acquisition Is Initialization pattern + + + + + RAII initialization + + + + + + RAII disposal + + + + + This class manages a write lock for a local readers/writer lock, + using the Resource Acquisition Is Initialization pattern + + + + + + RAII disposal + + + + + serialize/deserialize arbitrary objects + (objects must be serializable) + + + + + Serialize object to buffer + + serializable object + + + + + Deserialize buffer to object + + byte array to deserialize + + + + + Optimized implementation. Primitive types are manually serialized, the rest are serialized using binary serializer />. + + + + + + + + + + + + + + + + + + + serialize value and wrap with + + + + + + + Unwrap object wrapped in + + + + + + + Represents a generic collection of key/value pairs that are ordered independently of the key and value. + + The type of the keys in the dictionary + The type of the values in the dictionary + + + + Initializes a new instance of the OrderedDictionary<TKey,TValue> class. + + + + + Initializes a new instance of the OrderedDictionary<TKey,TValue> class using the specified initial capacity. + + The initial number of elements that the OrderedDictionary<TKey,TValue> can contain. + is less than 0 + + + + Initializes a new instance of the OrderedDictionary<TKey,TValue> class using the specified comparer. + + The IEqualityComparer<TKey> to use when comparing keys, or to use the default EqualityComparer<TKey> for the type of the key. + + + + Initializes a new instance of the OrderedDictionary<TKey,TValue> class using the specified initial capacity and comparer. + + The initial number of elements that the OrderedDictionary<TKey,TValue> collection can contain. + The IEqualityComparer<TKey> to use when comparing keys, or to use the default EqualityComparer<TKey> for the type of the key. + is less than 0 + + + + Converts the object passed as a key to the key type of the dictionary + + The key object to check + The key object, cast as the key type of the dictionary + is . + The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . + + + + Converts the object passed as a value to the value type of the dictionary + + The object to convert to the value type of the dictionary + The value object, converted to the value type of the dictionary + is , and the value type of the OrderedDictionary<TKey,TValue> is a value type. + The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . + + + + Gets the dictionary object that stores the keys and values + + The dictionary object that stores the keys and values for the OrderedDictionary<TKey,TValue> + Accessing this property will create the dictionary object if necessary + + + + Gets the list object that stores the key/value pairs. + + The list object that stores the key/value pairs for the OrderedDictionary<TKey,TValue> + Accessing this property will create the list object if necessary. + + + + Inserts a new entry into the OrderedDictionary<TKey,TValue> collection with the specified key and value at the specified index. + + The zero-based index at which the element should be inserted. + The key of the entry to add. + The value of the entry to add. The value can be if the type of the values in the dictionary is a reference type. + is less than 0.
+ -or-
+ is greater than .
+ is . + An element with the same key already exists in the OrderedDictionary<TKey,TValue>. +
+ + + Inserts a new entry into the OrderedDictionary<TKey,TValue> collection with the specified key and value at the specified index. + + The zero-based index at which the element should be inserted. + The key of the entry to add. + The value of the entry to add. The value can be if the type of the values in the dictionary is a reference type. + is less than 0.
+ -or-
+ is greater than .
+ is .
+ -or-
+ is , and the value type of the OrderedDictionary<TKey,TValue> is a value type.
+ The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
+ -or-
+ The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
+ -or-
+ An element with the same key already exists in the OrderedDictionary<TKey,TValue>.
+
+ + + Removes the entry at the specified index from the OrderedDictionary<TKey,TValue> collection. + + The zero-based index of the entry to remove. + is less than 0.
+ -or-
+ index is equal to or greater than .
+
+ + + Gets or sets the value at the specified index. + + The zero-based index of the value to get or set. + The value of the item at the specified index. + is less than 0.
+ -or-
+ index is equal to or greater than .
+
+ + + Gets or sets the value at the specified index. + + The zero-based index of the value to get or set. + The value of the item at the specified index. + is less than 0.
+ -or-
+ index is equal to or greater than .
+ is a null reference, and the value type of the OrderedDictionary<TKey,TValue> is a value type. + The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . +
+ + + Adds an entry with the specified key and value into the OrderedDictionary<TKey,TValue> collection with the lowest available index. + + The key of the entry to add. + The value of the entry to add. This value can be . + A key cannot be , but a value can be. + You can also use the property to add new elements by setting the value of a key that does not exist in the OrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the OrderedDictionary<TKey,TValue>, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + is + An element with the same key already exists in the OrderedDictionary<TKey,TValue> + + + + Adds an entry with the specified key and value into the OrderedDictionary<TKey,TValue> collection with the lowest available index. + + The key of the entry to add. + The value of the entry to add. This value can be . + The index of the newly added entry + A key cannot be , but a value can be. + You can also use the property to add new elements by setting the value of a key that does not exist in the OrderedDictionary<TKey,TValue> collection; however, if the specified key already exists in the OrderedDictionary<TKey,TValue>, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + is + An element with the same key already exists in the OrderedDictionary<TKey,TValue> + + + + Adds an entry with the specified key and value into the OrderedDictionary<TKey,TValue> collection with the lowest available index. + + The key of the entry to add. + The value of the entry to add. This value can be . + is .
+ -or-
+ is , and the value type of the OrderedDictionary<TKey,TValue> is a value type.
+ The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
+ -or-
+ The value type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of .
+
+ + + Removes all elements from the OrderedDictionary<TKey,TValue> collection. + + The capacity is not changed as a result of calling this method. + + + + Determines whether the OrderedDictionary<TKey,TValue> collection contains a specific key. + + The key to locate in the OrderedDictionary<TKey,TValue> collection. + if the OrderedDictionary<TKey,TValue> collection contains an element with the specified key; otherwise, . + is + + + + Determines whether the OrderedDictionary<TKey,TValue> collection contains a specific key. + + The key to locate in the OrderedDictionary<TKey,TValue> collection. + if the OrderedDictionary<TKey,TValue> collection contains an element with the specified key; otherwise, . + is + The key type of the OrderedDictionary<TKey,TValue> is not in the inheritance hierarchy of . + + + + Gets a value indicating whether the OrderedDictionary<TKey,TValue> has a fixed size. + + if the OrderedDictionary<TKey,TValue> has a fixed size; otherwise, . The default is . + + + + Gets a value indicating whether the OrderedDictionary<TKey,TValue> collection is read-only. + + if the OrderedDictionary<TKey,TValue> is read-only; otherwise, . The default is . + + A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created. + A collection that is read-only is simply a collection with a wrapper that prevents modification of the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes. + + + + + Gets an object containing the keys in the OrderedDictionary<TKey,TValue>. + + An object containing the keys in the OrderedDictionary<TKey,TValue>. + The returned object is not a static copy; instead, the collection refers back to the keys in the original OrderedDictionary<TKey,TValue>. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the key collection. + + + + Returns the zero-based index of the specified key in the OrderedDictionary<TKey,TValue> + + The key to locate in the OrderedDictionary<TKey,TValue> + The zero-based index of , if is found in the OrderedDictionary<TKey,TValue>; otherwise, -1 + This method performs a linear search; therefore it has a cost of O(n) at worst. + + + + Removes the entry with the specified key from the OrderedDictionary<TKey,TValue> collection. + + The key of the entry to remove + if the key was found and the corresponding element was removed; otherwise, + + + + Removes the entry with the specified key from the OrderedDictionary<TKey,TValue> collection. + + The key of the entry to remove + + + + Gets an object containing the values in the OrderedDictionary<TKey,TValue> collection. + + An object containing the values in the OrderedDictionary<TKey,TValue> collection. + The returned object is not a static copy; instead, the refers back to the values in the original OrderedDictionary<TKey,TValue> collection. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the . + + + + Gets or sets the value with the specified key. + + The key of the value to get or set. + The value associated with the specified key. If the specified key is not found, attempting to get it returns , and attempting to set it creates a new element using the specified key. + + + + Gets or sets the value with the specified key. + + The key of the value to get or set. + The value associated with the specified key. If the specified key is not found, attempting to get it returns , and attempting to set it creates a new element using the specified key. + + + + Copies the elements of the OrderedDictionary<TKey,TValue> elements to a one-dimensional Array object at the specified index. + + The one-dimensional object that is the destination of the objects copied from the OrderedDictionary<TKey,TValue>. The must have zero-based indexing. + The zero-based index in at which copying begins. + The method preserves the order of the elements in the OrderedDictionary<TKey,TValue> + + + + Gets the number of key/values pairs contained in the OrderedDictionary<TKey,TValue> collection. + + The number of key/value pairs contained in the OrderedDictionary<TKey,TValue> collection. + + + + Gets a value indicating whether access to the OrderedDictionary<TKey,TValue> object is synchronized (thread-safe). + + This method always returns false. + + + + Gets an object that can be used to synchronize access to the OrderedDictionary<TKey,TValue> object. + + An object that can be used to synchronize access to the OrderedDictionary<TKey,TValue> object. + + + + Gets an ICollection<TKey> object containing the keys in the OrderedDictionary<TKey,TValue>. + + An ICollection<TKey> object containing the keys in the OrderedDictionary<TKey,TValue>. + The returned ICollection<TKey> object is not a static copy; instead, the collection refers back to the keys in the original OrderedDictionary<TKey,TValue>. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the key collection. + + + + Gets the value associated with the specified key. + + The key of the value to get. + When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of . This parameter can be passed uninitialized. + if the OrderedDictionary<TKey,TValue> contains an element with the specified key; otherwise, . + + + + Gets an ICollection<TValue> object containing the values in the OrderedDictionary<TKey,TValue>. + + An ICollection<TValue> object containing the values in the OrderedDictionary<TKey,TValue>. + The returned ICollection<TKey> object is not a static copy; instead, the collection refers back to the values in the original OrderedDictionary<TKey,TValue>. Therefore, changes to the OrderedDictionary<TKey,TValue> continue to be reflected in the value collection. + + + + Adds the specified value to the OrderedDictionary<TKey,TValue> with the specified key. + + The KeyValuePair<TKey,TValue> structure representing the key and value to add to the OrderedDictionary<TKey,TValue>. + + + + Determines whether the OrderedDictionary<TKey,TValue> contains a specific key and value. + + The KeyValuePair<TKey,TValue> structure to locate in the OrderedDictionary<TKey,TValue>. + if is found in the OrderedDictionary<TKey,TValue>; otherwise, . + + + + Copies the elements of the OrderedDictionary<TKey,TValue> to an array of type , starting at the specified index. + + The one-dimensional array of type KeyValuePair<TKey,TValue> that is the destination of the KeyValuePair<TKey,TValue> elements copied from the OrderedDictionary<TKey,TValue>. The array must have zero-based indexing. + The zero-based index in at which copying begins. + + + + Removes a key and value from the dictionary. + + The KeyValuePair<TKey,TValue> structure representing the key and value to remove from the OrderedDictionary<TKey,TValue>. + if the key and value represented by is successfully found and removed; otherwise, . This method returns if is not found in the OrderedDictionary<TKey,TValue>. + + + + distributed work item queue. Messages are processed in chronological order + + + + + Enqueue incoming messages + + + + + + + + Dequeue next batch of work items + + + + + + + + + distributed work item queue. Each message must have an associated + work item id. For a given id, all work items are guaranteed to be processed + in the order in which they are received. + + + + + distributed work item queue. Each message must have an associated + work item id. For a given id, all work items are guaranteed to be processed + in the order in which they are received. + + + + + + + Queue incoming messages + + + + + + + Must call this periodically to move work items from priority queue to pending queue + + + + + Replace existing work item in workItemId queue + + + + + + + + Pop items from list + + + + + + + Force release of locks held by crashed servers + + + + + release lock held by crashed server + + + + true if lock is released, either by this method or by another client; false otherwise + + + + Unlock work item id, so other servers can process items for this id + + + + + + + + + + + + + + + + + + + + + + + + + + + simple distributed work item queue + + + + + + + Queue incoming messages + + + + + + Dequeue next batch of work items for processing. After this method is called, + no other work items with same id will be available for + dequeuing until PostDequeue is called + + KeyValuePair: key is work item id, and value is list of dequeued items. + + + + + distributed work item queue + + + + + pop remaining items that were returned by dequeue, and unlock queue + + + + + + indicate that an item has been processed by the caller + + + + + Update first unprocessed work item + + + + + + customize the client serializer + + + + + Serialize object to buffer + + serializable object + + + + + + + array of serializable objects + + + + + Deserialize buffer to object + + byte array to deserialize + + + + + + + + + + + pop numProcessed items from queue and unlock queue for work item id that dequeued + items are associated with + + + + + + A dequeued work item has been processed. When all of the dequeued items have been processed, + all items will be popped from the queue,and the queue unlocked for the work item id that + the dequeued items are associated with + + + + + Update first unprocessed item with new work item. + + + + + + Enqueue item in priority queue corresponding to workItemId identifier + + + + + + + Preprare next work item id for dequeueing + + + + + Dequeue up to maxBatchSize items from queue corresponding to workItemId identifier. + Once this method is called, or will not + return any items for workItemId until the dequeue lock returned is unlocked. + + + + + + + + Replace existing work item in workItemId queue + + + + + + + + Enqueue item + + + + + + Dequeue up to maxBatchSize items from queue + + + + + + + manages a "region" in the redis key space + namespace can be cleared by incrementing the generation + + + + + get locking strategy + + + + + get current generation + + + + + + set new generation + + + + + + redis key for generation + + + + + + get redis key that holds all namespace keys + + + + + + get global cache key + + + + + + + get global key inside of this namespace + + + prefixes can be added for name deconfliction + + + + + replace UniqueCharacter with its double, to avoid name clash + + + + + + + + + + + + + + wraps a serialized representation of an object + + + + + + Initializes a new instance of . + + Custom item data. + The serialized item. + + + + The data representing the item being stored/retireved. + + + + + Flags set for this instance. + + + + + Adds support for Redis Transactions (i.e. MULTI/EXEC/DISCARD operations). + + + + + Put "QUEUED" messages at back of queue + + + + + + Issue exec command (not queued) + + + + + callback for after result count is read in + + + +
+
diff --git a/lib/ServiceStack.Text.dll b/lib/ServiceStack.Text.dll new file mode 100644 index 00000000..7bc8876d Binary files /dev/null and b/lib/ServiceStack.Text.dll differ diff --git a/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/net40/ServiceStack.Text.xml b/lib/ServiceStack.Text.xml similarity index 58% rename from src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/net40/ServiceStack.Text.xml rename to lib/ServiceStack.Text.xml index 55441d99..1f526711 100644 --- a/src/RedisStackOverflow/packages/ServiceStack.Text.4.0.60/lib/net40/ServiceStack.Text.xml +++ b/lib/ServiceStack.Text.xml @@ -1,1400 +1,2054 @@ - - - - ServiceStack.Text - - - - - Utils to load types - - - - - Find the type from the name supplied - - [typeName] or [typeName, assemblyName] - - - - - The top-most interface of the given type, if any. - - - - - Find type if it exists - - - - The type if it exists - - - - Populate an object with Example data. - - - - - - - Populates the object with example data. - - - Tracks how deeply nested we are - - - - - If AlwaysUseUtc is set to true then convert all DateTime to UTC. If PreserveUtc is set to true then UTC dates will not convert to local - - - - - - - Repairs an out-of-spec XML date/time string which incorrectly uses a space instead of a 'T' to separate the date from the time. - These string are occasionally generated by SQLite and can cause errors in OrmLite when reading these columns from the DB. - - The XML date/time string to repair - The repaired string. If no repairs were made, the original string is returned. - - - - WCF Json format: /Date(unixts+0000)/ - - - - - - - WCF Json format: /Date(unixts+0000)/ - - - - - - - Get the type(string) constructor if exists - - The type. - - - - - micro optimizations: using flags instead of value.IndexOfAny(EscapeChars) - - - - - - - Class to hold - - - - - - A fast, standards-based, serialization-issue free DateTime serailizer. - - - - - Determines whether this serializer can create the specified type from a string. - - The type. - - true if this instance [can create from string] the specified type; otherwise, false. - - - - - Parses the specified value. - - The value. - - - - - Deserializes from reader. - - The reader. - - - - - Serializes to string. - - The value. - - - - - Serializes to writer. - - The value. - The writer. - - - - Sets which format to use when serializing TimeSpans - - - - - if the is configured - to take advantage of specification, - to support user-friendly serialized formats, ie emitting camelCasing for JSON - and parsing member names and enum values in a case-insensitive manner. - - - - - if the is configured - to support web-friendly serialized formats, ie emitting lowercase_underscore_casing for JSON - - - - - Define how property names are mapped during deserialization - - - - - Gets or sets a value indicating if the framework should throw serialization exceptions - or continue regardless of deserialization errors. If the framework - will throw; otherwise, it will parse as many fields as possible. The default is . - - - - - Gets or sets a value indicating if the framework should always convert to UTC format instead of local time. - - - - - Gets or sets a value indicating if the framework should skip automatic conversions. - Dates will be handled literally, any included timezone encoding will be lost and the date will be treaded as DateTimeKind.Local - Utc formatted input will result in DateTimeKind.Utc output. Any input without TZ data will be set DateTimeKind.Unspecified - This will take precedence over other flags like AlwaysUseUtc - JsConfig.DateHandler = DateHandler.ISO8601 should be used when set true for consistent de/serialization. - - - - - Gets or sets a value indicating if the framework should always assume is in UTC format if Kind is Unspecified. - - - - - Gets or sets whether we should append the Utc offset when we serialize Utc dates. Defaults to no. - Only supported for when the JsConfig.DateHandler == JsonDateHandler.TimestampOffset - - - - - Gets or sets a value indicating if unicode symbols should be serialized as "\uXXXX". - - - - - Gets or sets a value indicating if the framework should call an error handler when - an exception happens during the deserialization. - - Parameters have following meaning in order: deserialized entity, property name, parsed value, property type, caught exception. - - - - If set to true, Interface types will be prefered over concrete types when serializing. - - - - - Sets the maximum depth to avoid circular dependencies - - - - - Set this to enable your own type construction provider. - This is helpful for integration with IoC containers where you need to call the container constructor. - Return null if you don't know how to construct the type and the parameterless constructor will be used. - - - - - If set to true, Interface types will be prefered over concrete types when serializing. - - - - - Always emit type info for this type. Takes precedence over ExcludeTypeInfo - - - - - Never emit type info for this type - - - - - if the is configured - to take advantage of specification, - to support user-friendly serialized formats, ie emitting camelCasing for JSON - and parsing member names and enum values in a case-insensitive manner. - - - - - Define custom serialization fn for BCL Structs - - - - - Define custom raw serialization fn - - - - - Define custom serialization hook - - - - - Define custom after serialization hook - - - - - Define custom deserialization fn for BCL Structs - - - - - Define custom raw deserialization fn for objects - - - - - Exclude specific properties of this type from being serialized - - - - - Opt-in flag to set some Value Types to be treated as a Ref Type - - - - - Whether there is a fn (raw or otherwise) - - - - - The property names on target types must match property names in the JSON source - - - - - The property names on target types may not match the property names in the JSON source - - - - - Uses the xsd format like PT15H10M20S - - - - - Uses the standard .net ToString method of the TimeSpan class - - - - - Get JSON string value converted to T - - - - - Get JSON string value - - - - - Get unescaped string value - - - - - Get unescaped string value - - - - - Write JSON Array, Object, bool or number values as raw string - - - - - Get JSON string value - - - - - Creates an instance of a Type from a string value - - - - - Parses the specified value. - - The value. - - - - - Shortcut escape when we're sure value doesn't contain any escaped chars - - - - - - - Given a character as utf32, returns the equivalent string provided that the character - is legal json. - - - - - - - Micro-optimization keep pre-built char arrays saving a .ToCharArray() + function call (see .net implementation of .Write(string)) - - - - - Searches the string for one or more non-printable characters. - - The string to search. - True if there are any characters that require escaping. False if the value can be written verbatim. - - Micro optimizations: since quote and backslash are the only printable characters requiring escaping, removed previous optimization - (using flags instead of value.IndexOfAny(EscapeChars)) in favor of two equality operations saving both memory and CPU time. - Also slightly reduced code size by re-arranging conditions. - TODO: Possible Linq-only solution requires profiling: return value.Any(c => !c.IsPrintable() || c == QuoteChar || c == EscapeChar); - - - - - Implement the serializer using a more static approach - - - - - - Implement the serializer using a more static approach - - - - - - Public Code API to register commercial license for ServiceStack. - - - - - Internal Utilities to verify licensing - - - - - Pretty Thread-Safe cache class from: - http://code.google.com/p/dapper-dot-net/source/browse/Dapper/SqlMapper.cs - - This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), - and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** - equality. The type is fully thread-safe. - - - - - Represents an individual object, allowing access to members by-name - - - - - Use the target types definition of equality - - - - - Obtain the hash of the target object - - - - - Use the target's definition of a string representation - - - - - Wraps an individual object, allowing by-name access to that instance - - - - - Get or Set the value of a named member for the underlying object - - - - - The object represented by this instance - - - - - Provides by-name member-access to objects of a given type - - - - - Create a new instance of this type - - - - - Provides a type-specific accessor, allowing by-name access for all objects of that type - - The accessor is cached internally; a pre-existing accessor may be returned - - - - Does this type support new instances via a parameterless constructor? - - - - - Get or set the value of a named member on the target instance - - - - - Maps the path of a file in the context of a VS project - - the relative path - the absolute path - Assumes static content is two directories above the /bin/ directory, - eg. in a unit test scenario the assembly would be in /bin/Debug/. - - - - Maps the path of a file in a self-hosted scenario - - the relative path - the absolute path - Assumes static content is copied to /bin/ folder with the assemblies - - - - Maps the path of a file in an Asp.Net hosted scenario - - the relative path - the absolute path - Assumes static content is in the parent folder of the /bin/ directory - - - - Generic implementation of object pooling pattern with predefined pool size limit. The main - purpose is that limited number of frequently used objects can be kept in the pool for - further recycling. - - Notes: - 1) it is not the goal to keep all returned objects. Pool is not meant for storage. If there - is no space in the pool, extra returned objects will be dropped. - - 2) it is implied that if object was obtained from a pool, the caller will return it back in - a relatively short time. Keeping checked out objects for long durations is ok, but - reduces usefulness of pooling. Just new up your own. - - Not returning objects to the pool in not detrimental to the pool's work, but is a bad practice. - Rationale: - If there is no intent for reusing the object, do not use pool - just use "new". - - - - - Produces an instance. - - - Search strategy is a simple linear probing which is chosen for it cache-friendliness. - Note that Free will try to store recycled objects close to the start thus statistically - reducing how far we will typically search. - - - - - Returns objects to the pool. - - - Search strategy is a simple linear probing which is chosen for it cache-friendliness. - Note that Free will try to store recycled objects close to the start thus statistically - reducing how far we will typically search in Allocate. - - - - - Removes an object from leak tracking. - - This is called when an object is returned to the pool. It may also be explicitly - called if an object allocated from the pool is intentionally not being returned - to the pool. This can be of use with pooled arrays if the consumer wants to - return a larger array to the pool than was originally allocated. - - - - - Not using System.Func{T} because this file is linked into the (debugger) Formatter, - which does not have that type (since it compiles against .NET 2.0). - - - - - this is RAII object to automatically release pooled object when its owning pool - - - - - Shared object pool for roslyn - - Use this shared pool if only concern is reducing object allocations. - if perf of an object pool itself is also a concern, use ObjectPool directly. - - For example, if you want to create a million of small objects within a second, - use the ObjectPool directly. it should have much less overhead than using this. - - - - pooled memory : 4K * 512 = 4MB - - - - pool that uses default constructor with 100 elements pooled - - - - - pool that uses default constructor with 20 elements pooled - - - - - pool that uses string as key with StringComparer.OrdinalIgnoreCase as key comparer - - - - - pool that uses string as element with StringComparer.OrdinalIgnoreCase as element comparer - - - - - pool that uses string as element with StringComparer.Ordinal as element comparer - - - - - Used to reduce the # of temporary byte[]s created to satisfy serialization and - other I/O requests - - - - - Reusable StringBuilder ThreadStatic Cache - - - - - Alternative Reusable StringBuilder ThreadStatic Cache - - - - - Reusable StringWriter ThreadStatic Cache - - - - - Alternative Reusable StringWriter ThreadStatic Cache - - - - - Implement the serializer using a more static approach - - - - - - Manages pools of RecyclableMemoryStream objects. - - - There are two pools managed in here. The small pool contains same-sized buffers that are handed to streams - as they write more data. - - For scenarios that need to call GetBuffer(), the large pool contains buffers of various sizes, all - multiples of LargeBufferMultiple (1 MB by default). They are split by size to avoid overly-wasteful buffer - usage. There should be far fewer 8 MB buffers than 1 MB buffers, for example. - - - - - pools[0] = 1x largeBufferMultiple buffers - pools[1] = 2x largeBufferMultiple buffers - etc., up to maximumBufferSize - - - - - Initializes the memory manager with the default block/buffer specifications. - - - - - Initializes the memory manager with the given block requiredSize. - - Size of each block that is pooled. Must be > 0. - Each large buffer will be a multiple of this value. - Buffers larger than this are not pooled - blockSize is not a positive number, or largeBufferMultiple is not a positive number, or maximumBufferSize is less than blockSize. - maximumBufferSize is not a multiple of largeBufferMultiple - - - - Removes and returns a single block from the pool. - - A byte[] array - - - - Returns a buffer of arbitrary size from the large buffer pool. This buffer - will be at least the requiredSize and always be a multiple of largeBufferMultiple. - - The minimum length of the buffer - The tag of the stream returning this buffer, for logging if necessary. - A buffer of at least the required size. - - - - Returns the buffer to the large pool - - The buffer to return. - The tag of the stream returning this buffer, for logging if necessary. - buffer is null - buffer.Length is not a multiple of LargeBufferMultiple (it did not originate from this pool) - - - - Returns the blocks to the pool - - Collection of blocks to return to the pool - The tag of the stream returning these blocks, for logging if necessary. - blocks is null - blocks contains buffers that are the wrong size (or null) for this memory manager - - - - Retrieve a new MemoryStream object with no tag and a default initial capacity. - - A MemoryStream. - - - - Retrieve a new MemoryStream object with the given tag and a default initial capacity. - - A tag which can be used to track the source of the stream. - A MemoryStream. - - - - Retrieve a new MemoryStream object with the given tag and at least the given capacity. - - A tag which can be used to track the source of the stream. - The minimum desired capacity for the stream. - A MemoryStream. - - - - Retrieve a new MemoryStream object with the given tag and at least the given capacity, possibly using - a single continugous underlying buffer. - - Retrieving a MemoryStream which provides a single contiguous buffer can be useful in situations - where the initial size is known and it is desirable to avoid copying data between the smaller underlying - buffers to a single large one. This is most helpful when you know that you will always call GetBuffer - on the underlying stream. - A tag which can be used to track the source of the stream. - The minimum desired capacity for the stream. - Whether to attempt to use a single contiguous buffer. - A MemoryStream. - - - - Retrieve a new MemoryStream object with the given tag and with contents copied from the provided - buffer. The provided buffer is not wrapped or used after construction. - - The new stream's position is set to the beginning of the stream when returned. - A tag which can be used to track the source of the stream. - The byte buffer to copy data from. - The offset from the start of the buffer to copy from. - The number of bytes to copy from the buffer. - A MemoryStream. - - - - The size of each block. It must be set at creation and cannot be changed. - - - - - All buffers are multiples of this number. It must be set at creation and cannot be changed. - - - - - Gets or sets the maximum buffer size. - - Any buffer that is returned to the pool that is larger than this will be - discarded and garbage collected. - - - - Number of bytes in small pool not currently in use - - - - - Number of bytes currently in use by stream from the small pool - - - - - Number of bytes in large pool not currently in use - - - - - Number of bytes currently in use by streams from the large pool - - - - - How many blocks are in the small pool - - - - - How many buffers are in the large pool - - - - - How many bytes of small free blocks to allow before we start dropping - those returned to us. - - - - - How many bytes of large free buffers to allow before we start dropping - those returned to us. - - - - - Maximum stream capacity in bytes. Attempts to set a larger capacity will - result in an exception. - - A value of 0 indicates no limit. - - - - Whether to save callstacks for stream allocations. This can help in debugging. - It should NEVER be turned on generally in production. - - - - - Whether dirty buffers can be immediately returned to the buffer pool. E.g. when GetBuffer() is called on - a stream and creates a single large buffer, if this setting is enabled, the other blocks will be returned - to the buffer pool immediately. - Note when enabling this setting that the user is responsible for ensuring that any buffer previously - retrieved from a stream which is subsequently modified is not used after modification (as it may no longer - be valid). - - - - - Triggered when a new block is created. - - - - - Triggered when a new block is created. - - - - - Triggered when a new large buffer is created. - - - - - Triggered when a new stream is created. - - - - - Triggered when a stream is disposed. - - - - - Triggered when a stream is finalized. - - - - - Triggered when a stream is finalized. - - - - - Triggered when a user converts a stream to array. - - - - - Triggered when a large buffer is discarded, along with the reason for the discard. - - - - - Periodically triggered to report usage statistics. - - - - - Generic delegate for handling events without any arguments. - - - - - Delegate for handling large buffer discard reports. - - Reason the buffer was discarded. - - - - Delegate for handling reports of stream size when streams are allocated - - Bytes allocated. - - - - Delegate for handling periodic reporting of memory use statistics. - - Bytes currently in use in the small pool. - Bytes currently free in the small pool. - Bytes currently in use in the large pool. - Bytes currently free in the large pool. - - - - MemoryStream implementation that deals with pooling and managing memory streams which use potentially large - buffers. - - - This class works in tandem with the RecylableMemoryStreamManager to supply MemoryStream - objects to callers, while avoiding these specific problems: - 1. LOH allocations - since all large buffers are pooled, they will never incur a Gen2 GC - 2. Memory waste - A standard memory stream doubles its size when it runs out of room. This - leads to continual memory growth as each stream approaches the maximum allowed size. - 3. Memory copying - Each time a MemoryStream grows, all the bytes are copied into new buffers. - This implementation only copies the bytes when GetBuffer is called. - 4. Memory fragmentation - By using homogeneous buffer sizes, it ensures that blocks of memory - can be easily reused. - - The stream is implemented on top of a series of uniformly-sized blocks. As the stream's length grows, - additional blocks are retrieved from the memory manager. It is these blocks that are pooled, not the stream - object itself. - - The biggest wrinkle in this implementation is when GetBuffer() is called. This requires a single - contiguous buffer. If only a single block is in use, then that block is returned. If multiple blocks - are in use, we retrieve a larger buffer from the memory manager. These large buffers are also pooled, - split by size--they are multiples of a chunk size (1 MB by default). - - Once a large buffer is assigned to the stream the blocks are NEVER again used for this stream. All operations take place on the - large buffer. The large buffer can be replaced by a larger buffer from the pool as needed. All blocks and large buffers - are maintained in the stream until the stream is disposed (unless AggressiveBufferReturn is enabled in the stream manager). - - - - - - All of these blocks must be the same size - - - - - This is only set by GetBuffer() if the necessary buffer is larger than a single block size, or on - construction if the caller immediately requests a single large buffer. - - If this field is non-null, it contains the concatenation of the bytes found in the individual - blocks. Once it is created, this (or a larger) largeBuffer will be used for the life of the stream. - - - - - This list is used to store buffers once they're replaced by something larger. - This is for the cases where you have users of this class that may hold onto the buffers longer - than they should and you want to prevent race conditions which could corrupt the data. - - - - - This buffer exists so that WriteByte can forward all of its calls to Write - without creating a new byte[] buffer on every call. - - - - - Allocate a new RecyclableMemoryStream object. - - The memory manager - - - - Allocate a new RecyclableMemoryStream object - - The memory manager - A string identifying this stream for logging and debugging purposes - - - - Allocate a new RecyclableMemoryStream object - - The memory manager - A string identifying this stream for logging and debugging purposes - The initial requested size to prevent future allocations - - - - Allocate a new RecyclableMemoryStream object - - The memory manager - A string identifying this stream for logging and debugging purposes - The initial requested size to prevent future allocations - An initial buffer to use. This buffer will be owned by the stream and returned to the memory manager upon Dispose. - - - - Returns the memory used by this stream back to the pool. - - Whether we're disposing (true), or being called by the finalizer (false) - This method is not thread safe and it may not be called more than once. - - - - Equivalent to Dispose - - - - - Returns a single buffer containing the contents of the stream. - The buffer may be longer than the stream length. - - A byte[] buffer - IMPORTANT: Doing a Write() after calling GetBuffer() invalidates the buffer. The old buffer is held onto - until Dispose is called, but the next time GetBuffer() is called, a new buffer from the pool will be required. - Object has been disposed - - - - Returns a new array with a copy of the buffer's contents. You should almost certainly be using GetBuffer combined with the Length to - access the bytes in this stream. Calling ToArray will destroy the benefits of pooled buffers, but it is included - for the sake of completeness. - - Object has been disposed - - - - Reads from the current position into the provided buffer - - Destination buffer - Offset into buffer at which to start placing the read bytes. - Number of bytes to read. - The number of bytes read - buffer is null - offset or count is less than 0 - offset subtracted from the buffer length is less than count - Object has been disposed - - - - Writes the buffer to the stream - - Source buffer - Start position - Number of bytes to write - buffer is null - offset or count is negative - buffer.Length - offset is not less than count - Object has been disposed - - - - Returns a useful string for debugging. This should not normally be called in actual production code. - - - - - Writes a single byte to the current position in the stream. - - byte value to write - Object has been disposed - - - - Reads a single byte from the current position in the stream. - - The byte at the current position, or -1 if the position is at the end of the stream. - Object has been disposed - - - - Sets the length of the stream - - value is negative or larger than MaxStreamLength - Object has been disposed - - - - Sets the position to the offset from the seek location - - How many bytes to move - From where - The new position - Object has been disposed - offset is larger than MaxStreamLength - Invalid seek origin - Attempt to set negative position - - - - Synchronously writes this stream's bytes to the parameter stream. - - Destination stream - Important: This does a synchronous write, which may not be desired in some situations - - - - Release the large buffer (either stores it for eventual release or returns it immediately). - - - - - Unique identifier for this stream across it's entire lifetime - - Object has been disposed - - - - A temporary identifier for the current usage of this stream. - - Object has been disposed - - - - Gets the memory manager being used by this stream. - - Object has been disposed - - - - Callstack of the constructor. It is only set if MemoryManager.GenerateCallStacks is true, - which should only be in debugging situations. - - - - - Callstack of the Dispose call. It is only set if MemoryManager.GenerateCallStacks is true, - which should only be in debugging situations. - - - - - Gets or sets the capacity - - Capacity is always in multiples of the memory manager's block size, unless - the large buffer is in use. Capacity never decreases during a stream's lifetime. - Explicitly setting the capacity to a lower value than the current value will have no effect. - This is because the buffers are all pooled by chunks and there's little reason to - allow stream truncation. - - Object has been disposed - - - - Gets the number of bytes written to this stream. - - Object has been disposed - - - - Gets the current position in the stream - - Object has been disposed - - - - Whether the stream can currently read - - - - - Whether the stream can currently seek - - - - - Always false - - - - - Whether the stream can currently write - - - - - Creates a new instance of type. - First looks at JsConfig.ModelFactory before falling back to CreateInstance - - - - - Creates a new instance of type. - First looks at JsConfig.ModelFactory before falling back to CreateInstance - - - - - Creates a new instance from the default constructor of type - - - - - Add a Property attribute at runtime. - Not threadsafe, should only add attributes on Startup. - - - - - Add a Property attribute at runtime. - Not threadsafe, should only add attributes on Startup. - - - - - @jonskeet: Collection of utility methods which operate on streams. - r285, February 26th 2009: http://www.yoda.arachsys.com/csharp/miscutil/ - - - - - Reads the given stream up to the end, returning the data as a byte - array. - - - - - Reads the given stream up to the end, returning the data as a byte - array, using the given buffer size. - - - - - Reads the given stream up to the end, returning the data as a byte - array, using the given buffer for transferring data. Note that the - current contents of the buffer is ignored, so the buffer needn't - be cleared beforehand. - - - - - Copies all the data from one stream into another. - - - - - Copies all the data from one stream into another, using a buffer - of the given size. - - - - - Copies all the data from one stream into another, using the given - buffer for transferring data. Note that the current contents of - the buffer is ignored, so the buffer needn't be cleared beforehand. - - - - - Reads exactly the given number of bytes from the specified stream. - If the end of the stream is reached before the specified amount - of data is read, an exception is thrown. - - - - - Reads into a buffer, filling it completely. - - - - - Reads exactly the given number of bytes from the specified stream, - into the given buffer, starting at position 0 of the array. - - - - - Reads exactly the given number of bytes from the specified stream, - into the given buffer, starting at position 0 of the array. - - - - - Same as ReadExactly, but without the argument checks. - - - - - Converts from base: 0 - 62 - - The source. - From. - To. - - - - - Skip the encoding process for 'safe strings' - - - - - - - A class to allow the conversion of doubles to string representations of - their exact decimal values. The implementation aims for readability over - efficiency. - - Courtesy of @JonSkeet - http://www.yoda.arachsys.com/csharp/DoubleConverter.cs - - - - - - - - How many digits are *after* the decimal point - - - - - Constructs an arbitrary decimal expansion from the given long. - The long must not be negative. - - - - - Multiplies the current expansion by the given amount, which should - only be 2 or 5. - - - - - Shifts the decimal point; a negative value makes - the decimal expansion bigger (as fewer digits come after the - decimal place) and a positive value makes the decimal - expansion smaller. - - - - - Removes leading/trailing zeroes from the expansion. - - - - - Converts the value to a proper decimal string representation. - - - - - Creates an instance of a Type from a string value - - - - - Determines whether the specified type is convertible from string. - - The type. - - true if the specified type is convertible from string; otherwise, false. - - - - - Parses the specified value. - - The value. - - - - - Parses the specified type. - - The type. - The value. - - - - - Useful extension method to get the Dictionary[string,string] representation of any POCO type. - - - - - - Recursively prints the contents of any POCO object in a human-friendly, readable format - - - - - - Print Dump to Console.WriteLine - - - - - Print string.Format to Console.WriteLine - - - - - Parses the specified value. - - The value. - - - - + + + + ServiceStack.Text + + + + + Utils to load types + + + + + Find the type from the name supplied + + [typeName] or [typeName, assemblyName] + + + + + The top-most interface of the given type, if any. + + + + + Find type if it exists + + + + The type if it exists + + + + If AlwaysUseUtc is set to true then convert all DateTime to UTC. If PreserveUtc is set to true then UTC dates will not convert to local + + + + + + + Repairs an out-of-spec XML date/time string which incorrectly uses a space instead of a 'T' to separate the date from the time. + These string are occasionally generated by SQLite and can cause errors in OrmLite when reading these columns from the DB. + + The XML date/time string to repair + The repaired string. If no repairs were made, the original string is returned. + + + + WCF Json format: /Date(unixts+0000)/ + + + + + + + WCF Json format: /Date(unixts+0000)/ + + + + + + + Get the type(string) constructor if exists + + The type. + + + + + micro optimizations: using flags instead of value.IndexOfAny(EscapeChars) + + + + + + + Class to hold + + + + + + Gets or sets the default character encoding using in A system.IO.Stream + to write data or read data. The default value is PclExport.Instance.GetUseEncoding(false). + + + + + A fast, standards-based, serialization-issue free DateTime serailizer. + + + + + Determines whether this serializer can create the specified type from a string. + + The type. + + true if this instance [can create from string] the specified type; otherwise, false. + + + + + Parses the specified value. + + The value. + + + + + Deserializes from reader. + + The reader. + + + + + Serializes to string. + + The value. + + + + + Serializes to writer. + + The value. + The writer. + + + + Sets which format to use when serializing TimeSpans + + + + + if the is configured + to take advantage of specification, + to support user-friendly serialized formats, ie emitting camelCasing for JSON + and parsing member names and enum values in a case-insensitive manner. + + + + + if the is configured + to support web-friendly serialized formats, ie emitting lowercase_underscore_casing for JSON + + + + + Define how property names are mapped during deserialization + + + + + Gets or sets a value indicating if the framework should throw serialization exceptions + or continue regardless of deserialization errors. If the framework + will throw; otherwise, it will parse as many fields as possible. The default is . + + + + + Gets or sets a value indicating if the framework should always convert to UTC format instead of local time. + + + + + Gets or sets a value indicating if the framework should skip automatic conversions. + Dates will be handled literally, any included timezone encoding will be lost and the date will be treaded as DateTimeKind.Local + Utc formatted input will result in DateTimeKind.Utc output. Any input without TZ data will be set DateTimeKind.Unspecified + This will take precedence over other flags like AlwaysUseUtc + JsConfig.DateHandler = DateHandler.ISO8601 should be used when set true for consistent de/serialization. + + + + + Gets or sets a value indicating if the framework should always assume is in UTC format if Kind is Unspecified. + + + + + Gets or sets whether we should append the Utc offset when we serialize Utc dates. Defaults to no. + Only supported for when the JsConfig.DateHandler == JsonDateHandler.TimestampOffset + + + + + Gets or sets a value indicating if unicode symbols should be serialized as "\uXXXX". + + + + + Gets or sets a value indicating if HTML entity chars [> < & = '] should be escaped as "\uXXXX". + + + + + Gets or sets a value indicating if the framework should call an error handler when + an exception happens during the deserialization. + + Parameters have following meaning in order: deserialized entity, property name, parsed value, property type, caught exception. + + + + If set to true, Interface types will be prefered over concrete types when serializing. + + + + + If set to true, Interface types will be prefered over concrete types when serializing. + + + + + Sets the maximum depth to avoid circular dependencies + + + + + Set this to enable your own type construction provider. + This is helpful for integration with IoC containers where you need to call the container constructor. + Return null if you don't know how to construct the type and the parameterless constructor will be used. + + + + + Always emit type info for this type. Takes precedence over ExcludeTypeInfo + + + + + Never emit type info for this type + + + + + if the is configured + to take advantage of specification, + to support user-friendly serialized formats, ie emitting camelCasing for JSON + and parsing member names and enum values in a case-insensitive manner. + + + + + Define custom serialization fn for BCL Structs + + + + + Opt-in flag to set some Value Types to be treated as a Ref Type + + + + + Whether there is a fn (raw or otherwise) + + + + + Define custom raw serialization fn + + + + + Define custom serialization hook + + + + + Define custom after serialization hook + + + + + Define custom deserialization fn for BCL Structs + + + + + Define custom raw deserialization fn for objects + + + + + Exclude specific properties of this type from being serialized + + + + + The property names on target types must match property names in the JSON source + + + + + The property names on target types may not match the property names in the JSON source + + + + + Uses the xsd format like PT15H10M20S + + + + + Uses the standard .net ToString method of the TimeSpan class + + + + + Get JSON string value converted to T + + + + + Get JSON string value + + + + + Get JSON string value + + + + + Get unescaped string value + + + + + Get unescaped string value + + + + + Write JSON Array, Object, bool or number values as raw string + + + + + Creates an instance of a Type from a string value + + + + + Gets or sets the default character encoding using in A system.IO.Stream to write data or read data. + The default value is PclExport.Instance.GetUseEncoding(false). + + + + + Parses the specified value. + + The value. + + + + + Shortcut escape when we're sure value doesn't contain any escaped chars + + + + + + + Given a character as utf32, returns the equivalent string provided that the character + is legal json. + + + + + + + Micro-optimization keep pre-built char arrays saving a .ToCharArray() + function call (see .net implementation of .Write(string)) + + + + + Searches the string for one or more non-printable characters. + + The string to search. + + True if there are any characters that require escaping. False if the value can be written verbatim. + + Micro optimizations: since quote and backslash are the only printable characters requiring escaping, removed previous optimization + (using flags instead of value.IndexOfAny(EscapeChars)) in favor of two equality operations saving both memory and CPU time. + Also slightly reduced code size by re-arranging conditions. + TODO: Possible Linq-only solution requires profiling: return value.Any(c => !c.IsPrintable() || c == QuoteChar || c == EscapeChar); + + + + + Implement the serializer using a more static approach + + + + + + Implement the serializer using a more static approach + + + + + + Pretty Thread-Safe cache class from: + http://code.google.com/p/dapper-dot-net/source/browse/Dapper/SqlMapper.cs + + This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), + and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** + equality. The type is fully thread-safe. + + + + + Represents an individual object, allowing access to members by-name + + + + + Get or Set the value of a named member for the underlying object + + + + + The object represented by this instance + + + + + Use the target types definition of equality + + + + + Obtain the hash of the target object + + + + + Use the target's definition of a string representation + + + + + Wraps an individual object, allowing by-name access to that instance + + + + + Provides by-name member-access to objects of a given type + + + + + Does this type support new instances via a parameterless constructor? + + + + + Create a new instance of this type + + + + + Provides a type-specific accessor, allowing by-name access for all objects of that type + + The accessor is cached internally; a pre-existing accessor may be returned + + + + Get or set the value of a named member on the target instance + + + + + Generic implementation of object pooling pattern with predefined pool size limit. The main + purpose is that limited number of frequently used objects can be kept in the pool for + further recycling. + + Notes: + 1) it is not the goal to keep all returned objects. Pool is not meant for storage. If there + is no space in the pool, extra returned objects will be dropped. + + 2) it is implied that if object was obtained from a pool, the caller will return it back in + a relatively short time. Keeping checked out objects for long durations is ok, but + reduces usefulness of pooling. Just new up your own. + + Not returning objects to the pool in not detrimental to the pool's work, but is a bad practice. + Rationale: + If there is no intent for reusing the object, do not use pool - just use "new". + + + + + Not using System.Func{T} because this file is linked into the (debugger) Formatter, + which does not have that type (since it compiles against .NET 2.0). + + + + + Produces an instance. + + + Search strategy is a simple linear probing which is chosen for it cache-friendliness. + Note that Free will try to store recycled objects close to the start thus statistically + reducing how far we will typically search. + + + + + Returns objects to the pool. + + + Search strategy is a simple linear probing which is chosen for it cache-friendliness. + Note that Free will try to store recycled objects close to the start thus statistically + reducing how far we will typically search in Allocate. + + + + + Removes an object from leak tracking. + + This is called when an object is returned to the pool. It may also be explicitly + called if an object allocated from the pool is intentionally not being returned + to the pool. This can be of use with pooled arrays if the consumer wants to + return a larger array to the pool than was originally allocated. + + + + + this is RAII object to automatically release pooled object when its owning pool + + + + + Shared object pool for roslyn + + Use this shared pool if only concern is reducing object allocations. + if perf of an object pool itself is also a concern, use ObjectPool directly. + + For example, if you want to create a million of small objects within a second, + use the ObjectPool directly. it should have much less overhead than using this. + + + + + pool that uses default constructor with 100 elements pooled + + + + + pool that uses default constructor with 20 elements pooled + + + + + pool that uses string as key with StringComparer.OrdinalIgnoreCase as key comparer + + + + + pool that uses string as element with StringComparer.OrdinalIgnoreCase as element comparer + + + + + pool that uses string as element with StringComparer.Ordinal as element comparer + + + + + Used to reduce the # of temporary byte[]s created to satisfy serialization and + other I/O requests + + + + pooled memory : 4K * 512 = 4MB + + + + Manages pools of RecyclableMemoryStream objects. + + + There are two pools managed in here. The small pool contains same-sized buffers that are handed to streams + as they write more data. + + For scenarios that need to call GetBuffer(), the large pool contains buffers of various sizes, all + multiples of LargeBufferMultiple (1 MB by default). They are split by size to avoid overly-wasteful buffer + usage. There should be far fewer 8 MB buffers than 1 MB buffers, for example. + + + + + Generic delegate for handling events without any arguments. + + + + + Delegate for handling large buffer discard reports. + + Reason the buffer was discarded. + + + + Delegate for handling reports of stream size when streams are allocated + + Bytes allocated. + + + + Delegate for handling periodic reporting of memory use statistics. + + Bytes currently in use in the small pool. + Bytes currently free in the small pool. + Bytes currently in use in the large pool. + Bytes currently free in the large pool. + + + + pools[0] = 1x largeBufferMultiple buffers + pools[1] = 2x largeBufferMultiple buffers + etc., up to maximumBufferSize + + + + + Initializes the memory manager with the default block/buffer specifications. + + + + + Initializes the memory manager with the given block requiredSize. + + Size of each block that is pooled. Must be > 0. + Each large buffer will be a multiple of this value. + Buffers larger than this are not pooled + blockSize is not a positive number, or largeBufferMultiple is not a positive number, or maximumBufferSize is less than blockSize. + maximumBufferSize is not a multiple of largeBufferMultiple + + + + The size of each block. It must be set at creation and cannot be changed. + + + + + All buffers are multiples of this number. It must be set at creation and cannot be changed. + + + + + Gets or sets the maximum buffer size. + + Any buffer that is returned to the pool that is larger than this will be + discarded and garbage collected. + + + + Number of bytes in small pool not currently in use + + + + + Number of bytes currently in use by stream from the small pool + + + + + Number of bytes in large pool not currently in use + + + + + Number of bytes currently in use by streams from the large pool + + + + + How many blocks are in the small pool + + + + + How many buffers are in the large pool + + + + + How many bytes of small free blocks to allow before we start dropping + those returned to us. + + + + + How many bytes of large free buffers to allow before we start dropping + those returned to us. + + + + + Maximum stream capacity in bytes. Attempts to set a larger capacity will + result in an exception. + + A value of 0 indicates no limit. + + + + Whether to save callstacks for stream allocations. This can help in debugging. + It should NEVER be turned on generally in production. + + + + + Whether dirty buffers can be immediately returned to the buffer pool. E.g. when GetBuffer() is called on + a stream and creates a single large buffer, if this setting is enabled, the other blocks will be returned + to the buffer pool immediately. + Note when enabling this setting that the user is responsible for ensuring that any buffer previously + retrieved from a stream which is subsequently modified is not used after modification (as it may no longer + be valid). + + + + + Removes and returns a single block from the pool. + + A byte[] array + + + + Returns a buffer of arbitrary size from the large buffer pool. This buffer + will be at least the requiredSize and always be a multiple of largeBufferMultiple. + + The minimum length of the buffer + The tag of the stream returning this buffer, for logging if necessary. + A buffer of at least the required size. + + + + Returns the buffer to the large pool + + The buffer to return. + The tag of the stream returning this buffer, for logging if necessary. + buffer is null + buffer.Length is not a multiple of LargeBufferMultiple (it did not originate from this pool) + + + + Returns the blocks to the pool + + Collection of blocks to return to the pool + The tag of the stream returning these blocks, for logging if necessary. + blocks is null + blocks contains buffers that are the wrong size (or null) for this memory manager + + + + Retrieve a new MemoryStream object with no tag and a default initial capacity. + + A MemoryStream. + + + + Retrieve a new MemoryStream object with the given tag and a default initial capacity. + + A tag which can be used to track the source of the stream. + A MemoryStream. + + + + Retrieve a new MemoryStream object with the given tag and at least the given capacity. + + A tag which can be used to track the source of the stream. + The minimum desired capacity for the stream. + A MemoryStream. + + + + Retrieve a new MemoryStream object with the given tag and at least the given capacity, possibly using + a single continugous underlying buffer. + + Retrieving a MemoryStream which provides a single contiguous buffer can be useful in situations + where the initial size is known and it is desirable to avoid copying data between the smaller underlying + buffers to a single large one. This is most helpful when you know that you will always call GetBuffer + on the underlying stream. + A tag which can be used to track the source of the stream. + The minimum desired capacity for the stream. + Whether to attempt to use a single contiguous buffer. + A MemoryStream. + + + + Retrieve a new MemoryStream object with the given tag and with contents copied from the provided + buffer. The provided buffer is not wrapped or used after construction. + + The new stream's position is set to the beginning of the stream when returned. + A tag which can be used to track the source of the stream. + The byte buffer to copy data from. + The offset from the start of the buffer to copy from. + The number of bytes to copy from the buffer. + A MemoryStream. + + + + Triggered when a new block is created. + + + + + Triggered when a new block is created. + + + + + Triggered when a new large buffer is created. + + + + + Triggered when a new stream is created. + + + + + Triggered when a stream is disposed. + + + + + Triggered when a stream is finalized. + + + + + Triggered when a stream is finalized. + + + + + Triggered when a user converts a stream to array. + + + + + Triggered when a large buffer is discarded, along with the reason for the discard. + + + + + Periodically triggered to report usage statistics. + + + + + MemoryStream implementation that deals with pooling and managing memory streams which use potentially large + buffers. + + + This class works in tandem with the RecylableMemoryStreamManager to supply MemoryStream + objects to callers, while avoiding these specific problems: + 1. LOH allocations - since all large buffers are pooled, they will never incur a Gen2 GC + 2. Memory waste - A standard memory stream doubles its size when it runs out of room. This + leads to continual memory growth as each stream approaches the maximum allowed size. + 3. Memory copying - Each time a MemoryStream grows, all the bytes are copied into new buffers. + This implementation only copies the bytes when GetBuffer is called. + 4. Memory fragmentation - By using homogeneous buffer sizes, it ensures that blocks of memory + can be easily reused. + + The stream is implemented on top of a series of uniformly-sized blocks. As the stream's length grows, + additional blocks are retrieved from the memory manager. It is these blocks that are pooled, not the stream + object itself. + + The biggest wrinkle in this implementation is when GetBuffer() is called. This requires a single + contiguous buffer. If only a single block is in use, then that block is returned. If multiple blocks + are in use, we retrieve a larger buffer from the memory manager. These large buffers are also pooled, + split by size--they are multiples of a chunk size (1 MB by default). + + Once a large buffer is assigned to the stream the blocks are NEVER again used for this stream. All operations take place on the + large buffer. The large buffer can be replaced by a larger buffer from the pool as needed. All blocks and large buffers + are maintained in the stream until the stream is disposed (unless AggressiveBufferReturn is enabled in the stream manager). + + + + + + All of these blocks must be the same size + + + + + This is only set by GetBuffer() if the necessary buffer is larger than a single block size, or on + construction if the caller immediately requests a single large buffer. + + If this field is non-null, it contains the concatenation of the bytes found in the individual + blocks. Once it is created, this (or a larger) largeBuffer will be used for the life of the stream. + + + + + This list is used to store buffers once they're replaced by something larger. + This is for the cases where you have users of this class that may hold onto the buffers longer + than they should and you want to prevent race conditions which could corrupt the data. + + + + + Unique identifier for this stream across it's entire lifetime + + Object has been disposed + + + + A temporary identifier for the current usage of this stream. + + Object has been disposed + + + + Gets the memory manager being used by this stream. + + Object has been disposed + + + + Callstack of the constructor. It is only set if MemoryManager.GenerateCallStacks is true, + which should only be in debugging situations. + + + + + Callstack of the Dispose call. It is only set if MemoryManager.GenerateCallStacks is true, + which should only be in debugging situations. + + + + + This buffer exists so that WriteByte can forward all of its calls to Write + without creating a new byte[] buffer on every call. + + + + + Allocate a new RecyclableMemoryStream object. + + The memory manager + + + + Allocate a new RecyclableMemoryStream object + + The memory manager + A string identifying this stream for logging and debugging purposes + + + + Allocate a new RecyclableMemoryStream object + + The memory manager + A string identifying this stream for logging and debugging purposes + The initial requested size to prevent future allocations + + + + Allocate a new RecyclableMemoryStream object + + The memory manager + A string identifying this stream for logging and debugging purposes + The initial requested size to prevent future allocations + An initial buffer to use. This buffer will be owned by the stream and returned to the memory manager upon Dispose. + + + + Returns the memory used by this stream back to the pool. + + Whether we're disposing (true), or being called by the finalizer (false) + This method is not thread safe and it may not be called more than once. + + + + Equivalent to Dispose + + + + + Gets or sets the capacity + + Capacity is always in multiples of the memory manager's block size, unless + the large buffer is in use. Capacity never decreases during a stream's lifetime. + Explicitly setting the capacity to a lower value than the current value will have no effect. + This is because the buffers are all pooled by chunks and there's little reason to + allow stream truncation. + + Object has been disposed + + + + Gets the number of bytes written to this stream. + + Object has been disposed + + + + Gets the current position in the stream + + Object has been disposed + + + + Whether the stream can currently read + + + + + Whether the stream can currently seek + + + + + Always false + + + + + Whether the stream can currently write + + + + + Returns a single buffer containing the contents of the stream. + The buffer may be longer than the stream length. + + A byte[] buffer + IMPORTANT: Doing a Write() after calling GetBuffer() invalidates the buffer. The old buffer is held onto + until Dispose is called, but the next time GetBuffer() is called, a new buffer from the pool will be required. + Object has been disposed + + + + Returns a new array with a copy of the buffer's contents. You should almost certainly be using GetBuffer combined with the Length to + access the bytes in this stream. Calling ToArray will destroy the benefits of pooled buffers, but it is included + for the sake of completeness. + + Object has been disposed + + + + Reads from the current position into the provided buffer + + Destination buffer + Offset into buffer at which to start placing the read bytes. + Number of bytes to read. + The number of bytes read + buffer is null + offset or count is less than 0 + offset subtracted from the buffer length is less than count + Object has been disposed + + + + Writes the buffer to the stream + + Source buffer + Start position + Number of bytes to write + buffer is null + offset or count is negative + buffer.Length - offset is not less than count + Object has been disposed + + + + Returns a useful string for debugging. This should not normally be called in actual production code. + + + + + Writes a single byte to the current position in the stream. + + byte value to write + Object has been disposed + + + + Reads a single byte from the current position in the stream. + + The byte at the current position, or -1 if the position is at the end of the stream. + Object has been disposed + + + + Sets the length of the stream + + value is negative or larger than MaxStreamLength + Object has been disposed + + + + Sets the position to the offset from the seek location + + How many bytes to move + From where + The new position + Object has been disposed + offset is larger than MaxStreamLength + Invalid seek origin + Attempt to set negative position + + + + Synchronously writes this stream's bytes to the parameter stream. + + Destination stream + Important: This does a synchronous write, which may not be desired in some situations + + + + Release the large buffer (either stores it for eventual release or returns it immediately). + + + + + Allow Type to be deserialized into late-bould object Types using __type info + + + + + Allow Type to be deserialized into late-bould object Types using __type info + + + + + An optimized representation of a substring. + + + + + Initializes an instance of the struct. + + + The original . The includes the whole . + + + + + Initializes an instance of the struct. + + The original used as buffer. + The offset of the segment within the . + The length of the segment. + + + + Gets the buffer for this . + + + + + Gets the offset within the buffer for this . + + + + + Gets the length of this . + + + + + Gets the value of this segment as a . + + + + + Gets whether or not this contains a valid value. + + + + + + + + Indicates whether the current object is equal to another object of the same type. + + An object to compare with this object. + true if the current object is equal to the other parameter; otherwise, false. + + + + Indicates whether the current object is equal to another object of the same type. + + An object to compare with this object. + One of the enumeration values that specifies the rules to use in the comparison. + true if the current object is equal to the other parameter; otherwise, false. + + + + Checks if the specified is equal to the current . + + The to compare with the current . + true if the specified is equal to the current ; otherwise, false. + + + + Checks if the specified is equal to the current . + + The to compare with the current . + One of the enumeration values that specifies the rules to use in the comparison. + true if the specified is equal to the current ; otherwise, false. + + + + + This GetHashCode is expensive since it allocates on every call. + However this is required to ensure we retain any behavior (such as hash code randomization) that + string.GetHashCode has. + + + + + Checks if two specified have the same value. + + The first to compare, or null. + The second to compare, or null. + true if the value of is the same as the value of ; otherwise, false. + + + + Checks if two specified have different values. + + The first to compare, or null. + The second to compare, or null. + true if the value of is different from the value of ; otherwise, false. + + + + Checks if the beginning of this matches the specified when compared using the specified . + + The to compare. + One of the enumeration values that specifies the rules to use in the comparison. + true if matches the beginning of this ; otherwise, false. + + + + Checks if the end of this matches the specified when compared using the specified . + + The to compare. + One of the enumeration values that specifies the rules to use in the comparison. + true if matches the end of this ; otherwise, false. + + + + Retrieves a substring from this . + The substring starts at the position specified by and has the specified . + + The zero-based starting character position of a substring in this . + The number of characters in the substring. + A that is equivalent to the substring of length that begins at in this + + + + Retrieves a that represents a substring from this . + The starts at the position specified by and has the specified . + + The zero-based starting character position of a substring in this . + The number of characters in the substring. + A that is equivalent to the substring of length that begins at in this + + + + Gets the zero-based index of the first occurrence of the character in this . + The search starts at and examines a specified number of character positions. + + The Unicode character to seek. + The zero-based index position at which the search starts. + The number of characters to examine. + The zero-based index position of from the beginning of the if that character is found, or -1 if it is not. + + + + Gets the zero-based index of the first occurrence of the character in this . + The search starts at . + + The Unicode character to seek. + The zero-based index position at which the search starts. + The zero-based index position of from the beginning of the if that character is found, or -1 if it is not. + + + + Gets the zero-based index of the first occurrence of the character in this . + + The Unicode character to seek. + The zero-based index position of from the beginning of the if that character is found, or -1 if it is not. + + + + Removes all leading and trailing whitespaces. + + The trimmed . + + + + Removes all leading whitespaces. + + The trimmed . + + + + Removes all trailing whitespaces. + + The trimmed . + + + + Returns the represented by this or String.Empty if the does not contain a value. + + The represented by this or String.Empty if the does not contain a value. + + + + Reusable StringWriter ThreadStatic Cache + + + + + Alternative Reusable StringWriter ThreadStatic Cache + + + + + A class to allow the conversion of doubles to string representations of + their exact decimal values. The implementation aims for readability over + efficiency. + + Courtesy of @JonSkeet + http://www.yoda.arachsys.com/csharp/DoubleConverter.cs + + + + + + + + How many digits are *after* the decimal point + + + + + Constructs an arbitrary decimal expansion from the given long. + The long must not be negative. + + + + + Multiplies the current expansion by the given amount, which should + only be 2 or 5. + + + + + Shifts the decimal point; a negative value makes + the decimal expansion bigger (as fewer digits come after the + decimal place) and a positive value makes the decimal + expansion smaller. + + + + + Removes leading/trailing zeroes from the expansion. + + + + + Converts the value to a proper decimal string representation. + + + + + Creates an instance of a Type from a string value + + + + + Determines whether the specified type is convertible from string. + + The type. + + true if the specified type is convertible from string; otherwise, false. + + + + + Parses the specified value. + + The value. + + + + + Parses the specified type. + + The type. + The value. + + + + + Useful extension method to get the Dictionary[string,string] representation of any POCO type. + + + + + + Recursively prints the contents of any POCO object in a human-friendly, readable format + + + + + + Print Dump to Console.WriteLine + + + + + Parses the specified value. + + The value. + + + + + Serializes and deserializes objects into and from XML strings. ServiceStack.Text.XmlSerializer enables you to control + how objects are encoded into XML. + + + + + Gets an default System.Xml.XmlWriterSettings instance providing a set of features to support on the System.Xml.XmlWriter object + created by the Overload:System.Xml.XmlWriter.Create method. + + + + + Gets an System.Xml.XmlReaderSettings instance providing a set of features to support on the System.Xml.XmlReader object + created by the Overload:System.Xml.XmlReader.Create method. + + + + + Deserializes the XML string with an System.IO.TextReader into an instance of object. + + The System.IO.TextReader used to read the XML string. + The supplied data contract type of the object that are deserialized. + The settings for the new System.Xml.XmlReader, if the value is null use the default + . + The deserialized object. + + + + Deserializes the XML string with an System.IO.TextReader into an instance of the specified type. + + The supplied data contract type of the instance that are deserialized. + The System.IO.TextReader used to read the XML string. + The settings for the new System.Xml.XmlReader, if the value is null use the default + . + The deserialized instance of the specified type. + + + + Deserializes the XML string into an instance of object. + + The XML string to deserialize. + The supplied data contract type of the object that are deserialized. + The settings for the new System.Xml.XmlReader, if the value is null use the default + . + The deserialized object. + + + + Deserializes the XML string into an instance of the specified type. + + The supplied data contract type of the instance that are deserialized. + The XML string to deserialize. + The settings for the new System.Xml.XmlReader, if the value is null use the default + . + The deserialized instance of the specified type. + + + + Deserializes the XML stream with an System.IO.Stream into an instance of object. + + The System.IO.Stream used to read the XML stream. + The supplied data contract type of the object that are deserialized. + The settings for the new System.Xml.XmlReader, if the value is null use the default + . + The deserialized object. + + + + Deserializes the XML stream with an System.IO.Stream into an instance of the specified type. + + The supplied data contract type of the instance that are deserialized. + The System.IO.Stream used to read the XML stream. + The settings for the new System.Xml.XmlReader, if the value is null use the default + . + The deserialized instance of the specified type. + + + + Serializes the specified System.Object and writes the XML string to a instance of System.IO.TextWriter. + + The supplied data contract object that contains the data to write to the stream. + The System.IO.Writer used to write the XML string. + The settings for the new System.Xml.XmlWriter, if the value is null use the default + . + + + + Serializes the specified System.Object and writes the XML string to a instance of System.IO.Stream. + + The supplied data contract object that contains the data to write to the stream. + The System.IO.Stream used to write the XML string. + The settings for the new System.Xml.XmlWriter, if the value is null use the default + . + + + + Serializes the specified System.Object into the XML string. + + The supplied data contract object that are serialized. + The settings for the new System.Xml.XmlWriter, if the value is null use the default + . + The XML string of the serialized object. + + + + Populate an object with Example data. + + + + + + + Populates the object with example data. + + + Tracks how deeply nested we are + + + + + Provides methods for the HTTP-specific request to a Uniform Resource Identifier (URI). + + + + + Gets the string representation response from the Internet resource to an HTTP-specific request, whose + Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + The string representation response to the HTTP-specific request. + The URL specified in urlString is not a valid URL. + System.Net.HttpWebRequest.Abort was previously called.-or- The time-out period + for the request expired.-or- An error occurred while processing the request. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request as an asynchronous operation, + whose Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + Returns System.Threading.Tasks`1. The task object representing the asynchronous operation. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request, whose + Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + The string representation response to the HTTP-specific request. + The URL specified in urlString is not a valid URL. + System.Net.HttpWebRequest.Abort was previously called.-or- The time-out period + for the request expired.-or- An error occurred while processing the request. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request as an asynchronous operation, + whose Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + Returns System.Threading.Tasks`1. The task object representing the asynchronous operation. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request, whose + Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + The string representation response to the HTTP-specific request. + The URL specified in urlString is not a valid URL. + System.Net.HttpWebRequest.Abort was previously called.-or- The time-out period + for the request expired.-or- An error occurred while processing the request. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request as an asynchronous operation, + whose Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + Returns System.Threading.Tasks`1. The task object representing the asynchronous operation. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request, whose + Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + The string representation response to the HTTP-specific request. + The URL specified in urlString is not a valid URL. + System.Net.HttpWebRequest.Abort was previously called.-or- The time-out period + for the request expired.-or- An error occurred while processing the request. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request as an asynchronous operation, + whose Accept HTTP header is . + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + Returns System.Threading.Tasks`1. The task object representing the asynchronous operation. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request using the specified request options. + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The value of the Accept HTTP header. The default value is "*/*". + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + The string representation response to the HTTP-specific request. + The URL specified in urlString is not a valid URL. + System.Net.HttpWebRequest.Abort was previously called.-or- The time-out period + for the request expired.-or- An error occurred while processing the request. + + + + Gets the string representation response from the Internet resource to an HTTP-specific request as an asynchronous operation using the specified request options. + + A URL string that identifies the Internet resource. + The request method to use to contact the Internet resource. The default value is GET. + The optional request body associated with the Http-specific request. + The value of the Content-type HTTP header. The default value is null. + The value of the Accept HTTP header. The default value is "*/*". + The method to filter the HTTP-specific request. + The method to filter the response to the HTTP-specific request. + Returns System.Threading.Tasks`1. The task object representing the asynchronous operation. + + + + Reads all characters from the current position to the end of the data stream from the Internet response. + + The response from an Uniform Resource Identifier (URI). + The rest of the data stream from the Internet response as a string. If + the current position is at the end of the stream, returns an empty string. + + + + Reads all lines of characters from the current position to the end of the data stream from the Internet response. + + The response from an Uniform Resource Identifier (URI). + An System.Collections.Generic.IEnumerable`1 that contains System.String elements from the Internet response. + + + + Gets a response from the Internet resource to an HTTP-specific request. + + A URL string that identifies the Internet resource. + A containing the response to the Internet request. + The URL specified in urlString is not a valid URL. + System.Net.HttpWebRequest.Abort was previously called.-or- The time-out period + for the request expired.-or- An error occurred while processing the request. + + + + Gets a response from the Internet resource to an HTTP-specific request as an asynchronous operation. + + A URL string that identifies the Internet resource. + Returns System.Threading.Tasks`1. The task object representing the asynchronous operation. + + + + Public Code API to register commercial license for ServiceStack. + + + + + Internal Utilities to verify licensing + + + + + Provides extension methods on System.String instances that contain file or directory path information or uri. + + + + + Maps the path of a file in the context of a VS project in a Console App + + the relative path + the absolute path + Assumes static content is two directories above the /bin/ directory, + eg. in a unit test scenario the assembly would be in /bin/Debug/. + + + + Maps the path of a file in the context of a VS 2017+ multi-platform project in a Console App + + the relative path + the absolute path + Assumes static content is two directories above the /bin/ directory, + eg. in a unit test scenario the assembly would be in /bin/Debug/net45 + + + + Maps the path of a file in the bin\ folder of a self-hosted scenario + + the relative path + the absolute path + Assumes static content is copied to /bin/ folder with the assemblies + + + + Maps the path of a file in an ASP.NET hosted scenario + + the relative path + the absolute path + Assumes static content is in the parent folder of the /bin/ directory + + + + Combines the path elements in a specified System.String array into an base path. + + The base path to combine. + An string array that contains the path elements to combine. + The combined paths string. + + + + Combines the path elements in a specified System.String array. + + An string array that contains the path elements to combine. + The combined paths string. + + + + When overridden in a descendant class, writes a message followed by a line terminator, to the platform-specific output stream. + The default is . + + A message to write. + + + + When overridden in a descendant class, writes a formatted message followed by a line terminator, to the platform-specific output stream. + The default is . + + A composite format string (see Remarks) that contains text intermixed with zero or more format items, + which correspond to objects in the args array. + An object array that contains zero or more objects to format. + + + + When overridden in a descendant class, provides a instance of the class. A parameter + specifies whether to provide a Unicode byte order mark. + + true to specify that the method returns + a Unicode byte order mark; otherwise, false. See the Remarks section for more information. + A System.Text.Encoding instance. + + + + When overridden in a descendant class, Initializes a new System.Net.HttpWebRequest instance for the specified URI scheme. + + A URI string that identifies the Internet resource. + A System.Net.HttpWebRequest instance for the specific URI scheme. + The uriString is null. + The request scheme specified in uriString has not been registered. + The caller does not have permission to connect to the requested URI or a URI + that the request is redirected to. + The request scheme specified in uriString is the http or https scheme. + The URI specified in uriString is not a valid URI. + + + + + Writes a formatted message followed by a line terminator, to the Console output stream. + + A composite format string (see Remarks) that contains text intermixed with zero or more format items, + which correspond to objects in the args array. + An object array that contains zero or more objects to format. + An I/O error occurred. + The format or args is null. + The format specification in format is invalid. + + + + Add a Property attribute at runtime. + Not threadsafe, should only add attributes on Startup. + + + + + Add a Property attribute at runtime. + Not threadsafe, should only add attributes on Startup. + + + + + Implement the serializer using a more static approach + + + + + + Creates a new instance of type. + First looks at JsConfig.ModelFactory before falling back to CreateInstance + + + + + Creates a new instance of type. + First looks at JsConfig.ModelFactory before falling back to CreateInstance + + + + + Creates a new instance from the default constructor of type + + + + + @jonskeet: Collection of utility methods which operate on streams. + r285, February 26th 2009: http://www.yoda.arachsys.com/csharp/miscutil/ + + + + + Reads the given stream up to the end, returning the data as a byte + array. + + + + + Reads the given stream up to the end, returning the data as a byte + array, using the given buffer size. + + + + + Reads the given stream up to the end, returning the data as a byte + array, using the given buffer for transferring data. Note that the + current contents of the buffer is ignored, so the buffer needn't + be cleared beforehand. + + + + + Copies all the data from one stream into another. + + + + + Copies all the data from one stream into another, using a buffer + of the given size. + + + + + Copies all the data from one stream into another, using the given + buffer for transferring data. Note that the current contents of + the buffer is ignored, so the buffer needn't be cleared beforehand. + + + + + Reads exactly the given number of bytes from the specified stream. + If the end of the stream is reached before the specified amount + of data is read, an exception is thrown. + + + + + Reads into a buffer, filling it completely. + + + + + Reads exactly the given number of bytes from the specified stream, + into the given buffer, starting at position 0 of the array. + + + + + Reads exactly the given number of bytes from the specified stream, + into the given buffer, starting at position 0 of the array. + + + + + Same as ReadExactly, but without the argument checks. + + + + + Provides a set of static methods for object. + + + + + Converts from base: 0 - 62 + + The source. + From. + To. + + + + + Converts a uri component to its escaped representation using the specified upperCase. + + The uri component to escape. + true to perform an uppercase escaping, other then false. The default value is false. + A System.String that contains the escaped representation of uriComponent. + + + + Replaces the letter of the specified string with the letter 13 letters after it in the alphabet. + + A string to replace. + a Rot13 string. + + + + Appends a copy of the specified uriComponent without character escaping to the base URI. + + The base System.Uri, represented as a System.String. + The uri component to add to the base System.Uri. + A string representation for a System.Uri instance. + + + + Appends the uri component elements without character escaping in a specified System.String array to the base URI. + + The base System.Uri, represented as a System.String. + An string array that contains the uri component elements. + A string representation for a System.Uri instance. + + + + Appends the uri component elements in a specified System.String array to the base URI, with explicit control of character escaping. + + The base System.Uri, represented as a System.String. + An string array that contains the uri component elements. + true if escape the uri components; otherwise, false. + A string representation for a System.Uri instance. + + + + Skip the encoding process for 'safe strings' + + + + + + + Replaces the format item in a specified string with the string representation of a corresponding object in a specified array. + + A composite format string. + An object array that contains zero or more objects to format. + A copy of format in which the format items have been replaced by the string representation + of the corresponding objects in args. + format is invalid.-or- The index of a format item is less than zero, or greater + than or equal to the length of the args array. + + + + Indicates whether the specified string is null or an System.String.Empty string. + + The string to be tested. + true if the value parameter is null or an empty string (""); otherwise, false. + + + + Removes all leading occurrences of a set of characters specified in an array from the current System.String object. + + The string to be trimed. + An array of Unicode characters to remove, or null. + The string that remains after all occurrences of characters in the trimChars parameter are removed from the start of the current string. + If trimChars is null or an empty array, white-space characters are removed instead. + + + + Removes the leading occurrences of the first matched string specified in an array from the current System.String object. + + The string to be trimed. + An array of strings to match, or null. + The string that remains after the first matched string is removed from the start of the current string. + + + + Prints a formatted message. + + A composite format string (see Remarks) that contains format intermixed with zero or more format items, + which correspond to objects in the args array. + An object array that contains zero or more objects to format. + + + diff --git a/lib/ServiceStack.dll b/lib/ServiceStack.dll new file mode 100644 index 00000000..1f754b25 Binary files /dev/null and b/lib/ServiceStack.dll differ diff --git a/src/RedisStackOverflow/packages/ServiceStack.4.0.60/lib/net40/ServiceStack.xml b/lib/ServiceStack.xml similarity index 50% rename from src/RedisStackOverflow/packages/ServiceStack.4.0.60/lib/net40/ServiceStack.xml rename to lib/ServiceStack.xml index 58f9f82d..387fe9dd 100644 --- a/src/RedisStackOverflow/packages/ServiceStack.4.0.60/lib/net40/ServiceStack.xml +++ b/lib/ServiceStack.xml @@ -1,1109 +1,5044 @@ - - - - ServiceStack - - - - - Base class to create request filter attributes only for specific HTTP methods (GET, POST...) - - - - - Creates a new - - Defines when the filter should be executed - - - - This method is only executed if the HTTP method matches the property. - - The http request wrapper - The http response wrapper - The request DTO - - - - Create a ShallowCopy of this instance. - - - - - - Inherit from this class if you want to host your web services inside a - Console Application, Windows Service, etc. - - Usage of HttpListener allows you to host webservices on the same port (:80) as IIS - however it requires admin user privillages. - - - - - Wrapper class for the HTTPListener to allow easier access to the - server, for start and stop management and event routing of the actual - inbound requests. - - - - - ASP.NET or HttpListener ServiceStack host - - - - - Register dependency in AppHost IOC on Startup - - - - - AutoWired Registration of an interface with a concrete type in AppHost IOC on Startup. - - - - - Allows the clean up for executed autowired services and filters. - Calls directly after services and filters are executed. - - - - - Called at the end of each request. Enables Request Scope. - - - - - Add Request Filter for a specific Request DTO Type - - - - - Add Request Filter for a specific Response DTO Type - - - - - Add Request Filter for a specific MQ Request DTO Type - - - - - Add Request Filter for a specific MQ Response DTO Type - - - - - Register an Adhoc web service on Startup - - - - - Register all Services in Assembly - - - - - Apply plugins to this AppHost - - - - - Create a service runner for IService actions - - - - - Resolve the absolute url for this request - - - - - Resolve localized text, returns itself by default. - The Request is provided when exists. - - - - - Register user-defined custom routes. - - - - - Inferred Metadata available from existing services - - - - - Register custom ContentType serializers - - - - - Add Request Filters, to be applied before the dto is deserialized - - - - - Add Request Converter to convert Request DTO's - - - - - Add Response Converter to convert Response DTO's - - - - - Add Request Filters for HTTP Requests - - - - - Add Response Filters for HTTP Responses - - - - - Add Request Filters for MQ/TCP Requests - - - - - Add Response Filters for MQ/TCP Responses - - - - - Add alternative HTML View Engines - - - - - Provide an exception handler for unhandled exceptions - - - - - Provide an exception handler for un-caught exceptions - - - - - Provide callbacks to be fired after the AppHost has finished initializing - - - - - Provide callbacks to be fired when AppHost is being disposed - - - - - Skip the ServiceStack Request Pipeline and process the returned IHttpHandler instead - - - - - Provide a catch-all handler that doesn't match any routes - - - - - Use a fall-back Error Handler for handling global errors - - - - - Use a Custom Error Handler for handling specific error HttpStatusCodes - - - - - Provide a custom model minder for a specific Request DTO - - - - - The AppHost config - - - - - The AppHost AppSettings. Defaults to App or Web.config appSettings. - - - - - List of pre-registered and user-defined plugins to be enabled in this AppHost - - - - - Cascading number of file sources, inc. Embedded Resources, File System, In Memory, S3 - - - - - Read/Write Virtual FileSystem. Defaults to FileSystemVirtualPathProvider - - - - - Funqlets are a set of components provided as a package - to an existing container (like a module). - - - - - Configure the given container with the - registrations provided by the funqlet. - - Container to register. - - - - Retain the same behavior as ASP.NET and redirect requests to directores - without a trailing '/' - - - - - Executed immediately before a Service is executed. Use return to change the request DTO used, must be of the same type. - - - - - Executed immediately after a service is executed. Use return to change response used. - - - - - Occurs when the Service throws an Exception. - - - - - Occurs when an exception is thrown whilst processing a request. - - - - - Apply PreRequest Filters for participating Custom Handlers, e.g. RazorFormat, MarkdownFormat, etc - - - - - Apply PreAuthenticate Filters from IAuthWithRequest AuthProviders - - - - - Applies the raw request filters. Returns whether or not the request has been handled - and no more processing should be done. - - - - - - Applies the request filters. Returns whether or not the request has been handled - and no more processing should be done. - - - - - - Applies the response filters. Returns whether or not the request has been handled - and no more processing should be done. - - - - - - Inspect or modify ever new UserSession created or resolved from cache. - return null if Session is invalid to create new Session. - - - - - The AppHost.Container. Note: it is not thread safe to register dependencies after AppStart. - - - - - Starts the Web Service - - - A Uri that acts as the base that the server is listening on. - Format should be: http://127.0.0.1:8080/ or http://127.0.0.1:8080/somevirtual/ - Note: the trailing slash is required! For more info see the - HttpListener.Prefixes property on MSDN. - - - - - Shut down the Web Service - - - - - Overridable method that can be used to implement a custom hnandler - - - - - - Reserves the specified URL for non-administrator users and accounts. - http://msdn.microsoft.com/en-us/library/windows/desktop/cc307223(v=vs.85).aspx - - Reserved Url if the process completes successfully - - - - Default redirct URL if [Authenticate] attribute doesn't permit access. - - - - - Default redirct URL if Required Role or Permission attributes doesn't permit access. - - - - - The Interface Auth Repositories need to implement to support API Keys - - - - - The POCO Table used to persist API Keys - - - - - Enable access to protected Services using API Keys - - - - - Remove the Users Session - - - - - - - - The entry point for all AuthProvider providers. Runs inside the AuthService so exceptions are treated normally. - Overridable so you can provide your own Auth implementation. - - - - - Determine if the current session is already authenticated with this AuthProvider - - - - - Allows specifying a global fallback config that if exists is formatted with the Provider as the first arg. - E.g. this appSetting with the TwitterAuthProvider: - oauth.CallbackUrl="http://localhost:11001/auth/{0}" - Would result in: - oauth.CallbackUrl="http://localhost:11001/auth/twitter" - - - - - - Remove the Users Session - - - - - - - - Saves the Auth Tokens for this request. Called in OnAuthenticated(). - Overrideable, the default behaviour is to call IUserAuthRepository.CreateOrMergeAuthSession(). - - - - - Callback for AuthProviders to register callbacks with AuthFeature - - - - - Modify the registration of GetApiKeys and RegenrateApiKeys Services - - - - - How much entropy should the generated keys have. (default 24) - - - - - Generate different keys for different environments. (default live,test) - - - - - Different types of Keys each user can have. (default secret) - - - - - Whether to automatically expire keys. (default no expiry) - - - - - Automatically create the ApiKey Table for AuthRepositories which need it. (default true) - - - - - Whether to only allow access via API Key from a secure connection. (default true) - - - - - Change how API Key is generated - - - - - Run custom filter after API Key is created - - - - - Conveneint base class with empty virtual methods so subclasses only need to override the hooks they need. - - - - - Generic + Useful IService base class - - - - - Resolve an alternate Web Service from ServiceStack's IOC container. - - - - - - - Dynamic Session Bag - - - - - Typed UserSession - - - - - Cascading collection of virtual file sources, inc. Embedded Resources, File System, In Memory, S3 - - - - - Read/Write Virtual FileSystem. Defaults to FileSystemVirtualPathProvider - - - - - Used to Issue and process JWT Tokens and registers ConvertSessionToToken Service to convert Sessions to JWT Tokens - - - - - Enable access to protected Services using JWT Tokens - - - - - Different HMAC Algorithms supported - - - - - Different RSA Signing Algorithms supported - - - - - The RSA Private Key used to Sign the JWT Token when RSA is used - - - - - Whether to only allow access via API Key from a secure connection. (default true) - - - - - Run custom filter after JWT Header is created - - - - - Run custom filter after JWT Payload is created - - - - - Run custom filter after session is restored from a JWT Token - - - - - Whether to encrypt JWE Payload (default false). - Uses RSA-OAEP for Key Encryption and AES/128/CBC HMAC SHA256 for Conent Encryption - - - - - Which Hash Algorithm should be used to sign the JWT Token. (default HS256) - - - - - Whether to only allow processing of JWT Tokens using the configured HashAlgorithm. (default true) - - - - - The Issuer to embed in the token. (default ssjwt) - - - - - The Audience to embed in the token. (default null) - - - - - What Id to use to identify the Key used to sign the token. (default First 3 chars of Base64 Key) - - - - - The AuthKey used to sign the JWT Token - - - - - Convenient overload to intialize the Private Key via exported XML - - - - - The RSA Public Key used to Verify the JWT Token when RSA is used - - - - - Convenient overload to intialize the Public Key via exported XML - - - - - How long should JWT Tokens be valid for. (default 14 days) - - - - - Convenient overload to initialize ExpireTokensIn with an Integer - - - - - Whether to invalidate all JWT Tokens issued before a specified date. - - - - - Modify the registration of ConvertSessionToToken Service - - - - - Callback for Plugins to register necessary handlers with ServiceStack - - - - - Callback to post-configure any logic after IPlugin.Register() is fired - - - - - The BaseUrl of the ServiceStack instance (inferred) - - - - - Name of the ServiceStack Instance (inferred) - - - - - Textual description of the AutoQuery Services (shown in Home Services list) - - - - - Icon for this ServiceStack Instance (shown in Home Services list) - - - - - The different Content Type formats to display - - - - - The configured MaxLimit for AutoQuery - - - - - Whether to publish this Service to the public Services registry - - - - - Only show AutoQuery Services attributed with [AutoQueryViewer] - - - - - List of different Search Filters available - - - - - The Column which should be selected by default - - - - - The Query Type filter which should be selected by default - - - - - The search text which should be populated by default - - - - - Link to your website users can click to find out more about you - - - - - A custom logo or image that users can click on to visit your site - - - - - The default color of text - - - - - The default color of links - - - - - The default background color of each screen - - - - - The default background image of each screen anchored to the bottom left - - - - - The default icon for each of your AutoQuery Services - - - - - Returns true if the User Is Authenticated - - - - - How many queries are available to this user - - - - - The CacheKey to be use store the response against - - - - - The base Cache Key used to cache the Service response - - - - - Additional CacheKey Modifiers used to cache different outputs for a single Service Response - - - - - How long to cache the resource for. Fallsback to HttpCacheFeature.DefaultExpiresIn - - - - - The unique ETag returned for this resource clients can use to determine whether their local version has changed - - - - - The Age for this resource returned to clients - - - - - The MaxAge returned to clients to indicate how long they can use their local cache before re-validating - - - - - The LastModified date to use for the Cache and HTTP Header - - - - - Cache-Control HTTP Headers - - - - - Create unique cache per user - - - - - Use HostContext.LocalCache or HostContext.Cache - - - - - Cache the Response of a Service - - - - - Cache expiry in seconds - - - - - MaxAge in seconds - - - - - Cache-Control HTTP Headers - - - - - Vary cache per user - - - - - Vary cache for users in these roles - - - - - Use HostContext.LocalCache or HostContext.Cache - - - - - Defines a rule associated with a property. - - - - - Defines a rule associated with a property which can have multiple validators. - - - - - Performs validation using a validation context and returns a collection of Validation Failures. - - Validation Context - A collection of validation failures - - - - The validators that are grouped under this rule. - - - - - Name of the rule-set to which this rule belongs. - - - - - Creates a new property rule. - - Property - Function to get the property value - Lambda expression used to create the rule - Function to get the cascade mode. - Type to validate - Container type that owns the property - - - - Creates a new property rule from a lambda expression. - - - - - Creates a new property rule from a lambda expression. - - - - - Adds a validator to the rule. - - - - - Replaces a validator in this rule. Used to wrap validators. - - - - - Display name for the property. - - - - - Performs validation using a validation context and returns a collection of Validation Failures. - - Validation Context - A collection of validation failures - - - - Invokes a property validator using the specified validation context. - - - - - Property associated with this rule. - - - - - Function that can be invoked to retrieve the value of the property. - - - - - Expression that was used to create the rule. - - - - - String source that can be used to retrieve the display name (if null, falls back to the property name) - - - - - Rule set that this rule belongs to (if specified) - - - - - Function that will be invoked if any of the validators associated with this rule fail. - - - - - The current validator being configured by this rule. - - - - - Type of the property being validated - - - - - Cascade mode for this rule. - - - - - Validators associated with this rule. - - - - - Returns the property name for the property being validated. - Returns null if it is not a property being validated (eg a method call) - - - - - Creates a new property rule from a lambda expression. - - - - - This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), - and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** - equality. The type is fully thread-safe. - - - - - If the underlying command supports BindByName, this sets/clears the underlying - implementation accordingly. This is required to support OracleCommand from dapper-dot-net - - - - - Wraps a database connection, allowing sql execution timings to be collected when a session is started. - - - - - Returns a new that wraps , - providing query execution profiling. If profiler is null, no profiling will occur. - - Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection - The currently started or null. - Determines whether the ProfiledDbConnection will dispose the underlying connection. - - - - This will be made private; use - - - - - This will be made private; use - - - - - Wrapper for a db provider factory to enable profiling - - - - - Every provider factory must have an Instance public field - - - - - Used for db provider apis internally - - - - - proxy - - - - - proxy - - - - - Provides a common interface for Settings providers such as - ConfigurationManager or Azure's RoleEnvironment. The only - requirement is that if the implementation cannot find the - specified key, the return value must be null - - The key for the setting - The string value of the specified key, or null if the key - was invalid - - - - Return all keys in this configuration source. - - - - - + + + + ServiceStack + + + + + Inherit from this class if you want to host your web services inside an + ASP.NET application. + + + + + Get an IAppHost container. + Note: Registering dependencies should only be done during setup/configuration + stage and remain immutable there after for thread-safety. + + + + + + + Inherit from this class if you want to host your web services inside a + Console Application, Windows Service, etc. + + Usage of HttpListener allows you to host webservices on the same port (:80) as IIS + however it requires admin user privillages. + + + + + Exécute les tâches définies par l'application associées à la libération ou à la redéfinition des ressources non managées. + + 2 + + + + Default redirct URL if [Authenticate] attribute doesn't permit access. + + + + + Default redirct URL if Required Role or Permission attributes doesn't permit access. + + + + + Indicates that the request dto, which is associated with this attribute, + requires authentication. + + + + + Restrict authentication to a specific . + For example, if this attribute should only permit access + if the user is authenticated with , + you should set this property to . + + + + + Redirect the client to a specific URL if authentication failed. + If this property is null, simply `401 Unauthorized` is returned. + + + + + Enable the authentication feature and configure the AuthService. + + + + + Whether to Create Digest Auth MD5 Hash when Creating/Updating Users. + Defaults to only creating Digest Auth when DigestAuthProvider is registered. + + + + + Should UserName or Emails be saved in AuthRepository in LowerCase + + + + + The Interface Auth Repositories need to implement to support API Keys + + + + + The POCO Table used to persist API Keys + + + + + Enable access to protected Services using API Keys + + + + + Modify the registration of GetApiKeys and RegenerateApiKeys Services + + + + + How much entropy should the generated keys have. (default 24) + + + + + Generate different keys for different environments. (default live,test) + + + + + Different types of Keys each user can have. (default secret) + + + + + Whether to automatically expire keys. (default no expiry) + + + + + Automatically create the ApiKey Table for AuthRepositories which need it. (default true) + + + + + Whether to only allow access via API Key from a secure connection. (default true) + + + + + Change how API Key is generated + + + + + Run custom filter after API Key is created + + + + + Cache the User Session so it can be reused between subsequent API Key Requests + + + + + Whether to allow API Keys in 'apikey' QueryString or FormData + + + + + Specify all roles to be used by this application + + + + + Only allow access to users in specified roles + + + + + Get specific AuthProvider + + + + + + + Public API entry point to authenticate via code + + + null; if already autenticated otherwise a populated instance of AuthResponse + + + + The specified may change as a side-effect of this method. If + subsequent code relies on current data be sure to reload + the session istance via . + + + + + Conveneint base class with empty virtual methods so subclasses only need to override the hooks they need. + + + + + Allows specifying a global fallback config that if exists is formatted with the Provider as the first arg. + E.g. this appSetting with the TwitterAuthProvider: + oauth.CallbackUrl="http://localhost:11001/auth/{0}" + Would result in: + oauth.CallbackUrl="http://localhost:11001/auth/twitter" + + + + + + Remove the Users Session + + + + + + + + Create a Facebook App at: https://developers.facebook.com/apps + The Callback URL for your app should match the CallbackUrl provided. + + + + + Create an App at: https://github.com/settings/applications/new + The Callback URL for your app should match the CallbackUrl provided. + + + + + Download Yammer User Info given its ID. + + + The Yammer User ID. + + + The User info in JSON format. + + + + Yammer provides a method to retrieve current user information via + "https://www.yammer.com/api/v1/users/current.json". + + + However, to ensure consistency with the rest of the Auth codebase, + the explicit URL will be used, where [:id] denotes the User ID: + "https://www.yammer.com/api/v1/users/[:id].json" + + + Refer to: https://developer.yammer.com/restapi/ for full documentation. + + + + + + Remove the Users Session + + + + + + + + The entry point for all AuthProvider providers. Runs inside the AuthService so exceptions are treated normally. + Overridable so you can provide your own Auth implementation. + + + + + Determine if the current session is already authenticated with this AuthProvider + + + + + Thread-safe In memory UserAuth data store so it can be used without a dependency on Redis. + + + + + Used to Issue and process JWT Tokens and registers ConvertSessionToToken Service to convert Sessions to JWT Tokens + + + + + Whether to populate the Bearer Token in the AuthenticateResponse + + + + + Enable access to protected Services using JWT Tokens + + + + + Different HMAC Algorithms supported + + + + + Different RSA Signing Algorithms supported + + + + + Whether to only allow access via API Key from a secure connection. (default true) + + + + + Run custom filter after JWT Header is created + + + + + Run custom filter after JWT Payload is created + + + + + Run custom filter after session is restored from a JWT Token + + + + + Whether to encrypt JWE Payload (default false). + Uses RSA-OAEP for Key Encryption and AES/128/CBC HMAC SHA256 for Conent Encryption + + + + + Which Hash Algorithm should be used to sign the JWT Token. (default HS256) + + + + + Whether to only allow processing of JWT Tokens using the configured HashAlgorithm. (default true) + + + + + The Issuer to embed in the token. (default ssjwt) + + + + + The Audience to embed in the token. (default null) + + + + + What Id to use to identify the Key used to sign the token. (default First 3 chars of Base64 Key) + + + + + The AuthKey used to sign the JWT Token + + + + + Allow verification using multiple Auth keys + + + + + The RSA Private Key used to Sign the JWT Token when RSA is used + + + + + Convenient overload to intialize the Private Key via exported XML + + + + + The RSA Public Key used to Verify the JWT Token when RSA is used + + + + + Convenient overload to intialize the Public Key via exported XML + + + + + Allow verification using multiple public keys + + + + + How long should JWT Tokens be valid for. (default 14 days) + + + + + How long should JWT Refresh Tokens be valid for. (default 365 days) + + + + + Convenient overload to initialize ExpireTokensIn with an Integer + + + + + Allow custom logic to invalidate JWT Tokens + + + + + Allow custom logic to invalidate Refresh Tokens + + + + + Whether to invalidate all JWT Tokens issued before a specified date. + + + + + Modify the registration of ConvertSessionToToken Service + + + + + Allow JWT in ?ss-tok=jwt QueryString. (default false) + + + + + Allow JWT in ss-tok=jwt HTML POST FormData. (default false) + + + + + The entry point for all AuthProvider providers. Runs inside the AuthService so exceptions are treated normally. + Overridable so you can provide your own Auth implementation. + + + + + + + + + Sets the CallbackUrl and session.ReferrerUrl if not set and initializes the session tokens for this AuthProvider + + + + + + + + + Create Odnoklassniki App at: http://www.odnoklassniki.ru/devaccess + The Callback URL for your app should match the CallbackUrl provided. + + NB: They claim they use OAuth 2.0, but they in fact don't. + http://apiok.ru/wiki/display/api/Authorization+OAuth+2.0 + + + + + Allow utilizing an alternative PBKDF2 implementation. + + + + + The PBKDF2 strategy PasswordHasher implementation that's used for hashing PBKDF2 passwords. + + + + + The Password Hasher provider used to hash users passwords which uses the same algorithm used by ASP.NET Identity v3: + PBKDF2 with HMAC-SHA256, 128-bit salt, 256-bit subkey, 10000 iterations. + + + + + Gets the number of iterations used when hashing passwords using PBKDF2. Default is 10,000. + + + + + The number of iterations used when hashing passwords using PBKDF2. Default is 10,000. + + + + + The Format Version specifier for this PasswordHasher embedded as the first byte in password hashes. + + + + + Returns a hashed representation of the supplied for the specified . + + The user whose password is to be hashed. + The password to hash. + A hashed representation of the supplied for the specified . + + + + Specifies the PRF which should be used for the key derivation algorithm. + + + + + The HMAC algorithm (RFC 2104) using the SHA-1 hash function (FIPS 180-4). + + + + + The HMAC algorithm (RFC 2104) using the SHA-256 hash function (FIPS 180-4). + + + + + The HMAC algorithm (RFC 2104) using the SHA-512 hash function (FIPS 180-4). + + + + + Provides algorithms for performing key derivation. + + + + + Performs key derivation using the PBKDF2 algorithm. + + The password from which to derive the key. + The salt to be used during the key derivation process. + The pseudo-random function to be used in the key derivation process. + The number of iterations of the pseudo-random function to apply + during the key derivation process. + The desired length (in bytes) of the derived key. + The derived key. + + The PBKDF2 algorithm is specified in RFC 2898. + + + + + Internal interface used for abstracting away the PBKDF2 implementation since the implementation is OS-specific. + + + + + A PBKDF2 provider which utilizes the managed hash algorithm classes as PRFs. + This isn't the preferred provider since the implementation is slow, but it is provided as a fallback. + + + + + Update an existing registraiton + + + + + Create new Registration + + + + + Thank you Martijn + http://www.dijksterhuis.org/creating-salted-hash-values-in-c/ + + Stronger/Slower Alternative: + https://github.com/defuse/password-hashing/blob/master/PasswordStorage.cs + + + + + Create an app at https://dev.twitter.com/apps to get your ConsumerKey and ConsumerSecret for your app. + The Callback URL for your app should match the CallbackUrl provided. + + + + + Creates the required missing tables or DB schema + + + + + Create VK App at: http://vk.com/editapp?act=create + The Callback URL for your app should match the CallbackUrl provided. + + + + + If previous attemts failes, the subsequential calls + build up code value like "code1,code2,code3" + so we need the last one only + + + + + + + The ServiceStack Yammer OAuth provider. + + + + This provider is loosely based on the existing ServiceStack's Facebook OAuth provider. + + + For the full info on Yammer's OAuth2 authentication flow, refer to: + https://developer.yammer.com/authentication/#a-oauth2 + + + Note: Add these to your application / web config settings under appSettings and replace + values as appropriate. + + + + + + + + + ]]> + + + + + + The OAuth provider name / identifier. + + + + + Initializes a new instance of the class. + + + The application settings (in web.config). + + + + + Gets or sets the Yammer OAuth client id. + + + + + Gets or sets the Yammer OAuth client secret. + + + + + Gets or sets the Yammer OAuth pre-auth url. + + + + + Authenticate against Yammer OAuth endpoint. + + + The auth service. + + + The session. + + + The request. + + + The . + + + + + Load the UserAuth info into the session. + + + The User session. + + + The OAuth tokens. + + + The auth info. + + + + + Load the UserOAuth info into the session. + + + The auth session. + + + The OAuth tokens. + + + + + The Yammer User's email addresses. + + + + + Gets or sets the email address type (e.g. primary). + + + + + Gets or sets the email address. + + + + + Create Yandex App at: https://oauth.yandex.ru/client/new + The Callback URL for your app should match the CallbackUrl provided. + + + + + The BaseUrl of the ServiceStack instance (inferred) + + + + + Name of the ServiceStack Instance (inferred) + + + + + Textual description of the AutoQuery Services (shown in Home Services list) + + + + + Icon for this ServiceStack Instance (shown in Home Services list) + + + + + The different Content Type formats to display + + + + + The configured MaxLimit for AutoQuery + + + + + Whether to publish this Service to the public Services registry + + + + + Only show AutoQuery Services attributed with [AutoQueryViewer] + + + + + List of different Search Filters available + + + + + The Column which should be selected by default + + + + + The Query Type filter which should be selected by default + + + + + The search text which should be populated by default + + + + + Link to your website users can click to find out more about you + + + + + A custom logo or image that users can click on to visit your site + + + + + The default color of text + + + + + The default color of links + + + + + The default background color of each screen + + + + + The default background image of each screen anchored to the bottom left + + + + + The default icon for each of your AutoQuery Services + + + + + Returns true if the User Is Authenticated + + + + + How many queries are available to this user + + + + + Removes items from cache that have keys matching the specified wildcard pattern + + Cache client + The wildcard, where "*" means any sequence of characters and "?" means any single character. + + + + Removes items from the cache based on the specified regular expression pattern + + Cache client + Regular expression pattern to search cache keys + + + + The CacheKey to be use store the response against + + + + + The base Cache Key used to cache the Service response + + + + + Additional CacheKey Modifiers used to cache different outputs for a single Service Response + + + + + How long to cache the resource for. Fallsback to HttpCacheFeature.DefaultExpiresIn + + + + + The unique ETag returned for this resource clients can use to determine whether their local version has changed + + + + + The Age for this resource returned to clients + + + + + The MaxAge returned to clients to indicate how long they can use their local cache before re-validating + + + + + The LastModified date to use for the Cache and HTTP Header + + + + + Cache-Control HTTP Headers + + + + + Create unique cache per user + + + + + Use HostContext.LocalCache or HostContext.Cache + + + + + Skip compression for this Cache Result + + + + + Cache the Response of a Service + + + + + Cache expiry in seconds + + + + + MaxAge in seconds + + + + + Cache-Control HTTP Headers + + + + + Vary cache per user + + + + + Vary cache for users in these roles + + + + + Vary cache for different HTTP Headers + + + + + Use HostContext.LocalCache or HostContext.Cache + + + + + Skip compression for this Cache Result + + + + + Decorates the ICacheClient (and its sibblings) prefixing every key with the given prefix + + Usefull for multi-tenant environments + + + + + Decorates the ICacheClient (and its sibblings) prefixing every key with the given prefix + + Usefull for multi-tenant environments + + + + + Create new instance of CacheEntry. + + + + UTC time at which CacheEntry expires. + + + + Stores The value with key only if such key doesn't exist at the server yet. + + + + + Adds or replaces the value with key. + + + + + Adds or replaces the value with key. + + + + + Replace the value with specified key if it exists. + + + + + Add the value with key to the cache, set to never expire. + + + + + Add or replace the value with key to the cache, set to never expire. + + + + + Replace the value with key in the cache, set to never expire. + + + + + Add the value with key to the cache, set to expire at specified DateTime. + + This method examines the DateTimeKind of expiresAt to determine if conversion to + universal time is needed. The version of Add that takes a TimeSpan expiration is faster + than using this method with a DateTime of Kind other than Utc, and is not affected by + ambiguous local time during daylight savings/standard time transition. + + + + Add or replace the value with key to the cache, set to expire at specified DateTime. + + This method examines the DateTimeKind of expiresAt to determine if conversion to + universal time is needed. The version of Set that takes a TimeSpan expiration is faster + than using this method with a DateTime of Kind other than Utc, and is not affected by + ambiguous local time during daylight savings/standard time transition. + + + + Replace the value with key in the cache, set to expire at specified DateTime. + + This method examines the DateTimeKind of expiresAt to determine if conversion to + universal time is needed. The version of Replace that takes a TimeSpan expiration is faster + than using this method with a DateTime of Kind other than Utc, and is not affected by + ambiguous local time during daylight savings/standard time transition. + + + + Add the value with key to the cache, set to expire after specified TimeSpan. + + + + + Add or replace the value with key to the cache, set to expire after specified TimeSpan. + + + + + Replace the value with key in the cache, set to expire after specified TimeSpan. + + + + + Provides access to the System.Configuration.AppSettingsSection data for the current application's default configuration. + + + + + Initializes a new instance of the ServiceStack.Configuration.AppSettings class. + + The tier used to retrieve a setting. The default value is null. + + + + Provides a collection of keys and values that contains application settings. This is an abstract class. + + + + + Gets or sets the prefix of key, which lets you retrieve a setting with the tier first before falling back to the original key. + E.g a tier of 'Live' looks for 'Live.{Key}' or if not found falls back to '{Key}'. + + + + + Initializes a new instance of the ServiceStack.Configuration.AppSettingsBase class using the specified settings reader. + + The instance of class to read the settings. + + + + Gets the string value associated with the specified key. + + The specified key. + The string value associated with the specified key. If the specified key is not found, return null. + + + + Gets the nullable app setting. + + + + + Gets the app setting. + + + + + Returns AppSetting[key] if exists otherwise defaultValue + + + + + Returns AppSetting[key] if exists otherwise defaultValue, for non-string values + + + + + Gets the connection string. + + + + + Gets the list from app setting. + + + + + Gets the dictionary from app setting. + + + + + Represents a builder for the class. + + + + + Initializes a new instance of the class with a specified . + + The of the . + + + + Adds an that reads configuration values from the Web.config file. + + The . + + + + Adds an that reads configuration values from the Web.config file. + + The tier of the . + The . + + + + Adds a that reads configuration values from a dictionary. + + The dictionary of settings to add. + The . + + + + Adds an that reads configuration values from environmental variables. + + The . + + + + Adds an that reads configuration values from environmental variables. + + The tier of the . + The . + + + + Adds an that reads configuration values from a text file at . + + The path of the text file. + The . + + + + Adds an that reads configuration values from a text file at with a specified . + + The path of the text file. + The delimeter fo the text file. + The . + + + + Adds an that reads configuration values from a text file at with a specified . + + The path of the text file. + The delimeter fo the text file. + The tier of the . + The . + + + + Builds an . + + An . + + + + Wrappers for improving consistency with .NET Core Conventions + + + + + Registers the type in the IoC container and + adds auto-wiring to the specified type. + + + + + + + Registers a named instance of type in the IoC container and + adds auto-wiring to the specified type. + + + + + + + Registers the type in the IoC container and + adds auto-wiring to the specified type. + The reuse scope is set to none (transient). + + + + + + Registers the type in the IoC container and + adds auto-wiring to the specified type. + The reuse scope is set to none (transient). + + + + + + Registers the types in the IoC container and + adds auto-wiring to the specified types. + The reuse scope is set to none (transient). + + + + + + Register a singleton instance as a runtime type + + + + + Plugin adds support for Cross-origin resource sharing (CORS, see http://www.w3.org/TR/access-control/). + CORS allows to access resources from different domain which usually forbidden by origin policy. + + + + + Represents a default constructor with Allow Origin equals to "*", Allowed GET, POST, PUT, DELETE, OPTIONS request and allowed "Content-Type" header. + + + + + Lets you Register new Services and the optional restPaths will be registered against + this default Request Type + + + + + Change the default HTML view or template used for the HTML response of this service + + + + + Tracks created objects. + Used by to track created IDisposable instances. + These instances are tracked and disposed at the end of a request. + + + + + Adds disposable to the tracker + + + + + Dispose all disposables in the tracker. + If disposable is still alive alose .Release() is called to release the object. + + + + + Naming convention for the ResponseStatus property name on the response DTO + + + + + Create an instance of the service response dto type and inject it with the supplied responseStatus + + + + + + + + + + + + + + + + + Override to provide additional/less context about the Service Exception. + By default the request is serialized and appended to the ResponseStatus StackTrace. + + + + + Attribute marks that specific response class has support for Cross-origin resource sharing (CORS, see http://www.w3.org/TR/access-control/). CORS allows to access resources from different domain which usually forbidden by origin policy. + + + + + Represents a default constructor with Allow Origin equals to "*", Allowed GET, POST, PUT, DELETE, OPTIONS request and allowed "Content-Type" header. + + + + + Redirect to the https:// version of this url if not already. + + + + + Don't redirect when in DebugMode + + + + + Don't redirect if the request was a forwarded request, e.g. from a Load Balancer + + + + + Base class for entity validator classes. + + The type of the object being validated + + Base class for entity validator classes. + + The type of the object being validated + + + + Sets the cascade mode for all rules within this validator. + + + + + Validates the specified instance + + The object to validate + A ValidationResult object containing any validation failures + + + + Validates the specified instance asynchronously + + The object to validate + Cancellation token + A ValidationResult object containing any validation failures + + + + Validates the specified instance. + + Validation Context + A ValidationResult object containing any validation failures. + + + + Validates the specified instance asynchronously. + + Validation Context + Cancellation token + A ValidationResult object containing any validation failures. + + + + Adds a rule to the current validator. + + + + + + Creates a that can be used to obtain metadata about the current validator. + + + + + Defines a validation rule for a specify property. + + + RuleFor(x => x.Surname)... + + The type of property being validated + The expression representing the property to validate + an IRuleBuilder instance on which validators can be defined + + + + Invokes a rule for each item in the collection + + Type of property + Expression representing the collection to validate + An IRuleBuilder instance on which validators can be defined + + + + Defines a custom validation rule using a lambda expression. + If the validation rule fails, it should return a instance of a ValidationFailure + If the validation rule succeeds, it should return null. + + A lambda that executes custom validation rules. + + + + Defines a custom validation rule using a lambda expression. + If the validation rule fails, it should return an instance of ValidationFailure + If the validation rule succeeds, it should return null. + + A lambda that executes custom validation rules + + + + Defines a custom asynchronous validation rule using a lambda expression. + If the validation rule fails, it should asynchronously return a instance of a ValidationFailure + If the validation rule succeeds, it should return null. + + A lambda that executes custom validation rules. + + + + Defines a custom asynchronous validation rule using a lambda expression. + If the validation rule fails, it should asynchronously return an instance of ValidationFailure + If the validation rule succeeds, it should return null. + + A lambda that executes custom validation rules + + + + Defines a RuleSet that can be used to group together several validators. + + The name of the ruleset. + Action that encapsulates the rules in the ruleset. + + + + Defines a condition that applies to several rules + + The condition that should apply to multiple rules + Action that encapsulates the rules. + + + + + Defines an inverse condition that applies to several rules + + The condition that should be applied to multiple rules + Action that encapsulates the rules + + + + Defines an asynchronous condition that applies to several rules + + The asynchronous condition that should apply to multiple rules + Action that encapsulates the rules. + + + + + Defines an inverse asynchronous condition that applies to several rules + + The asynchronous condition that should be applied to multiple rules + Action that encapsulates the rules + + + + Includes the rules from the specified validator + + + + + Returns an enumerator that iterates through the collection of validation rules. + + + A that can be used to iterate through the collection. + + 1 + + + + Throws an exception if the instance being validated is null. + + + + + + Defines a RuleSet that can be used to provide specific validation rules for specific HTTP methods (GET, POST...) + + The HTTP methods where this rule set should be used. + Action that encapuslates the rules in the ruleset. + + + + Container class for dependent rule definitions + + + + + + Class that can be used to find all the validators from a collection of types. + + + + + Creates a scanner that works on a sequence of types. + + + + + Finds all the validators in the specified assembly. + + + + + Finds all the validators in the specified assemblies + + + + + Finds all the validators in the assembly containing the specified type. + + + + + Performs the specified action to all of the assembly scan results. + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Result of performing a scan. + + + + + Creates an instance of an AssemblyScanResult. + + + + + Validator interface type, eg IValidator<Foo> + + + + + Concrete type that implements the InterfaceType, eg FooValidator. + + + + + Implementation of and that looks for + the instance on the specified or + in order to provide the validator instance. + + + + + Creates an instance of . + + + + + Creates an instance of with the supplied instance factory delegate + used for creation of instances. + + The instance factory delegate. + + + + Gets a validator for the appropriate type. + + + + + Gets a validator for the appropriate type. + + Created instance; if a validator cannot be + created. + + + + Gets a validator for . + + The instance to get a validator for. + Created instance; if a validator cannot be + created. + + + + Validator attribute to define the class that will describe the Validation rules. + + + + + The type of the validator used to validate the current type or parameter. + + + + + Creates an instance of allowing a validator type to be specified. + + + + + Overrides the name of the property associated with this rule. + NOTE: This is a considered to be an advanced feature. 99% of the time that you use this, you actually meant to use WithName. + + The current rule + The property name to use + + + + + Specifies a localized name for the error message. + + The current rule + The resource to use as an expression, eg () => Messages.MyResource + Resource accessor builder to use + + + + Specifies a custom error message resource to use when validation fails. + + The current rule + The resource to use as an expression, eg () => Messages.MyResource + + + + + Specifies a custom error message resource to use when validation fails. + + The current rule + The resource to use as an expression, eg () => Messages.MyResource + Custom message format args + + + + + Specifies a custom error message resource to use when validation fails. + + The current rule + The resource to use as an expression, eg () => Messages.MyResource + The resource accessor builder to use. + + + + + Specifies a custom error message resource to use when validation fails. + + The current rule + The resource to use as an expression, eg () => Messages.MyResource + Custom message format args + + + + + Specifies a localized name for the error message. + + The current rule + The type of the generated resource file + The name of the resource to use + + + + Specifies a custom error message to use if validation fails. + + The current rule + The error message to use + Additional arguments to be specified when formatting the custom error message. + + + + + Specifies a custom error message to use if validation fails. + + The current rule + The error message to use + Additional property values to be included when formatting the custom error message. + + + + + Specifies a custom error message to use if validation fails. + + The current rule + The error message to use + Additional property values to use when formatting the custom error message. + + + + + Specifies a custom error message resource to use when validation fails. + + The current rule + Name of resource + Custom message format args + Type of resource representing a resx file + + + + + Specifies a custom error message resource to use when validation fails. + + The current rule + Resource name + Custom message format args + Resource type representing a resx file + + + + + Replace the first validator of this type and remove all the others. + + + + + Remove all validators of the specified type. + + + + + Remove all validators for the given property. + + + + + Builds a delegate for retrieving a localised resource from a resource type and property name. + + + + + Gets a function that can be used to retrieve a message from a resource type and resource name. + + + + + Allows the default error message translations to be managed. + + + + + Whether localization is enabled. + + + + + Default culture to use for all requests to the LanguageManager. If not specified, uses the current UI culture. + + + + + Gets a translated string based on its key. If the culture is specific and it isn't registered, we try the neutral culture instead. + If no matching culture is found to be registered we use English. + + The key + The culture to translate into + + + + + Provides error message templates + + + + + Construct the error message template + + Error message template + + + + The name of the resource if localized. + + + + + The type of the resource provider if localized. + + + + + Marker interface that indicates a PropertyValidatorContext should be passed to GetString + + + + + Base class for lanaguages + + + + + Name of language (culture code) + + + + + Adds a translation + + + + + + + Adds a translation for a type + + + + + + + Gets the localized version of a string with a specific key. + + + + + + + Allows the default error message translations to be managed. + + + + + Creates a new instance of the LanguageManager class. + + + + + Whether localization is enabled. + + + + + Default culture to use for all requests to the LanguageManager. If not specified, uses the current UI culture. + + + + + Provides a collection of all supported languages. + + + + + + Removes all languages except the default. + + + + + Gets a translated string based on its key. If the culture is specific and it isn't registered, we try the neutral culture instead. + If no matching culture is found to be registered we use English. + + The key + The culture to translate into + + + + + IStringSource implementation that uses the default language manager. + + + + + Lazily loads the string + + + + + Creates a LazyStringSource + + + + + Gets the value + + + + + + Resource type + + + + + Resource name + + + + + Creates a LazyStringSource + + + + + Gets the value + + + + + + Resource type + + + + + Resource name + + + + + Represents a localized string. + + + + + Creates a new instance of the LocalizedErrorMessageSource class using the specified resource name and resource type. + + The resource type + The resource name + + + + Creates a new instance of the LocalizedErrorMessageSource class using the specified resource name and resource type. + + The resource type + The resource name + Strategy used to construct the resource accessor + + + + Creates a LocalizedStringSource from an expression: () => MyResources.SomeResourceName + + The expression + Strategy used to construct the resource accessor + Error message source + + + + Construct the error message template + + Error message template + + + + The name of the resource if localized. + + + + + The type of the resource provider if localized. + + + + + Gets the PropertyInfo for a resource. + ResourceType and ResourceName are ref parameters to allow derived types + to replace the type/name of the resource before the delegate is constructed. + + + + + Version of LocalizedStringSource that allows the specified ResourceType to be replaced by the default resource type specified in ValidatorOptions.ResourceProviderType. + This is typically only used by the default validator types built into FV, or if you're building a library of validators. Don't use it in rule definitions. + + + + + Gets the PropertyInfo for a resource. + ResourceType and ResourceName are ref parameters to allow derived types + to replace the type/name of the resource before the delegate is constructed. + + + + + Creates a OverridableLocalizedStringSource from an expression: () => MyResources.SomeResourceName + + The expression + Error message source + + + + Defines an accessor for localization resources + + + + + Function that can be used to retrieve the resource + + + + + Resource type + + + + + Resource name + + + + + Represents a static string. + + + + + Creates a new StringErrorMessageSource using the specified error message as the error template. + + The error message template. + + + + Construct the error message template + + Error message template + + + + The name of the resource if localized. + + + + + The type of the resource provider if localized. + + + + + Extension methods for collection validation rules + + + + + Associates an instance of IValidator with the current property rule and is used to validate each item within the collection. + + Rule builder + The validator to use + + + + Uses a provider to instantiate a validator instance to be associated with a collection + + + + + + + + + + + Collection rule builder syntax + + + + + + + Defines a condition to be used to determine if validation should run + + + + + + + Extension methods that provide the default set of validators. + + + + + Defines a 'not null' validator on the current rule builder. + Validation will fail if the property is null. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + + + + + Defines a 'null' validator on the current rule builder. + Validation will fail if the property is not null. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + + + + + Defines a 'not empty' validator on the current rule builder. + Validation will fail if the property is null, an empty or the default value for the type (for example, 0 for integers) + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + + + + + Defines a 'empty' validator on the current rule builder. + Validation will fail if the property is not null, an empty or the default value for the type (for example, 0 for integers) + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + + + + + Defines a length validator on the current rule builder, but only for string properties. + Validation will fail if the length of the string is outside of the specified range. The range is inclusive. + + Type of object being validated + The rule builder on which the validator should be defined + + + + + + + Defines a length validator on the current rule builder, but only for string properties. + Validation will fail if the length of the string is outside of the specified range. The range is inclusive. + + Type of object being validated + The rule builder on which the validator should be defined + + + + + + + Defines a length validator on the current rule builder, but only for string properties. + Validation will fail if the length of the string is not equal to the length specified. + + Type of object being validated + The rule builder on which the validator should be defined + + + + + + Defines a length validator on the current rule builder, but only for string properties. + Validation will fail if the length of the string is not equal to the length specified. + + Type of object being validated + The rule builder on which the validator should be defined + + + + + + Defines a regular expression validator on the current rule builder, but only for string properties. + Validation will fail if the value returned by the lambda does not match the regular expression. + + Type of object being validated + The rule builder on which the validator should be defined + The regular expression to check the value against. + + + + + Defines a length validator on the current rule builder, but only for string properties. + Validation will fail if the length of the string is larger than the length specified. + + Type of object being validated + The rule builder on which the validator should be defined + + + + + + Defines a length validator on the current rule builder, but only for string properties. + Validation will fail if the length of the string is less than the length specified. + + Type of object being validated + The rule builder on which the validator should be defined + + + + + + Defines a regular expression validator on the current rule builder, but only for string properties. + Validation will fail if the value returned by the lambda does not match the regular expression. + + Type of object being validated + The rule builder on which the validator should be defined + The regular expression to check the value against. + + + + + Defines a regular expression validator on the current rule builder, but only for string properties. + Validation will fail if the value returned by the lambda does not match the regular expression. + + Type of object being validated + The rule builder on which the validator should be defined + The regular expression to use + + + + + Defines a regular expression validator on the current rule builder, but only for string properties. + Validation will fail if the value returned by the lambda does not match the regular expression. + + Type of object being validated + The rule builder on which the validator should be defined + The regular expression to use + + + + + Defines a regular expression validator on the current rule builder, but only for string properties. + Validation will fail if the value returned by the lambda does not match the regular expression. + + Type of object being validated + The rule builder on which the validator should be defined + The regular expression to check the value against. + Regex options + + + + + Defines a regular expression validator on the current rule builder, but only for string properties. + Validation will fail if the value returned by the lambda does not match the regular expression. + + Type of object being validated + The rule builder on which the validator should be defined + The regular expression to check the value against. + Regex options + + + + + Defines a regular expression validator on the current rule builder, but only for string properties. + Validation will fail if the value returned by the lambda is not a valid email address. + + Type of object being validated + The rule builder on which the validator should be defined + + + + + Defines a 'not equal' validator on the current rule builder. + Validation will fail if the specified value is equal to the value of the property. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value to compare + Equality comparer to use + + + + + Defines a 'not equal' validator on the current rule builder using a lambda to specify the value. + Validation will fail if the value returned by the lambda is equal to the value of the property. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression to provide the comparison value + Equality Comparer to use + + + + + Defines an 'equals' validator on the current rule builder. + Validation will fail if the specified value is not equal to the value of the property. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value to compare + Equality Comparer to use + + + + + Defines an 'equals' validator on the current rule builder using a lambda to specify the comparison value. + Validation will fail if the value returned by the lambda is not equal to the value of the property. + + The type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression to provide the comparison value + Equality comparer to use + + + + + Defines a predicate validator on the current rule builder using a lambda expression to specify the predicate. + Validation will fail if the specified lambda returns false. + Validation will succeed if the specified lambda returns true. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression specifying the predicate + + + + + Defines a predicate validator on the current rule builder using a lambda expression to specify the predicate. + Validation will fail if the specified lambda returns false. + Validation will succeed if the specified lambda returns true. + This overload accepts the object being validated in addition to the property being validated. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression specifying the predicate + + + + + Defines a predicate validator on the current rule builder using a lambda expression to specify the predicate. + Validation will fail if the specified lambda returns false. + Validation will succeed if the specified lambda returns true. + This overload accepts the object being validated in addition to the property being validated. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression specifying the predicate + + + + + Defines an asynchronous predicate validator on the current rule builder using a lambda expression to specify the predicate. + Validation will fail if the specified lambda returns false. + Validation will succeed if the specified lambda returns true. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression specifying the predicate + + + + + Defines an asynchronous predicate validator on the current rule builder using a lambda expression to specify the predicate. + Validation will fail if the specified lambda returns false. + Validation will succeed if the specified lambda returns true. + This overload accepts the object being validated in addition to the property being validated. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression specifying the predicate + + + + + Defines an asynchronous predicate validator on the current rule builder using a lambda expression to specify the predicate. + Validation will fail if the specified lambda returns false. + Validation will succeed if the specified lambda returns true. + This overload accepts the object being validated in addition to the property being validated. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda expression specifying the predicate + + + + + Defines a 'less than' validator on the current rule builder. + The validation will succeed if the property value is less than the specified value. + The validation will fail if the property value is greater than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than' validator on the current rule builder. + The validation will succeed if the property value is less than the specified value. + The validation will fail if the property value is greater than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than or equal' validator on the current rule builder. + The validation will succeed if the property value is less than or equal to the specified value. + The validation will fail if the property value is greater than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than or equal' validator on the current rule builder. + The validation will succeed if the property value is less than or equal to the specified value. + The validation will fail if the property value is greater than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than' validator on the current rule builder. + The validation will succeed if the property value is greater than the specified value. + The validation will fail if the property value is less than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than' validator on the current rule builder. + The validation will succeed if the property value is greater than the specified value. + The validation will fail if the property value is less than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than or equal' validator on the current rule builder. + The validation will succeed if the property value is greater than or equal the specified value. + The validation will fail if the property value is less than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than or equal' validator on the current rule builder. + The validation will succeed if the property value is greater than or equal the specified value. + The validation will fail if the property value is less than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than the specified value. + The validation will fail if the property value is greater than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda that should return the value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than the specified value. + The validation will fail if the property value is greater than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda that should return the value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than the specified value. + The validation will fail if the property value is greater than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda that should return the value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than the specified value. + The validation will fail if the property value is greater than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + A lambda that should return the value being compared + + + + + Defines a 'less than or equal' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than or equal to the specified value. + The validation will fail if the property value is greater than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than or equal' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than or equal to the specified value. + The validation will fail if the property value is greater than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than or equal' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than or equal to the specified value. + The validation will fail if the property value is greater than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than or equal' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is less than or equal to the specified value. + The validation will fail if the property value is greater than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than the specified value. + The validation will fail if the property value is less than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than the specified value. + The validation will fail if the property value is less than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than the specified value. + The validation will fail if the property value is less than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'less than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than the specified value. + The validation will fail if the property value is less than or equal to the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than or equal the specified value. + The validation will fail if the property value is less than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than or equal the specified value. + The validation will fail if the property value is less than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than or equal to' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than or equal the specified value. + The validation will fail if the property value is less than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Defines a 'greater than or equal to' validator on the current rule builder using a lambda expression. + The validation will succeed if the property value is greater than or equal the specified value. + The validation will fail if the property value is less than the specified value. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The value being compared + + + + + Validates certain properties of the specified instance. + + The current validator + The object to validate + Expressions to specify the properties to validate + A ValidationResult object containing any validation failures + + + + Validates certain properties of the specified instance. + + + The object to validate + The names of the properties to validate. + A ValidationResult object containing any validation failures. + + + + Validates an object using either a custom validator selector or a ruleset. + + + + + + + + + + + Validates certain properties of the specified instance asynchronously. + + The current validator + The object to validate + Expressions to specify the properties to validate + A ValidationResult object containing any validation failures + + + + Validates certain properties of the specified instance asynchronously. + + + The object to validate + The names of the properties to validate. + A ValidationResult object containing any validation failures. + + + + Validates an object asynchronously using a custom valdiator selector or a ruleset + + + + + + + + + + + Performs validation and then throws an exception if validation fails. + + The validator this method is extending. + The instance of the type we are validating. + Optional: a ruleset when need to validate against. + + + + Performs validation asynchronously and then throws an exception if validation fails. + + The validator this method is extending. + The instance of the type we are validating. + Optional: a ruleset when need to validate against. + + + + Defines an 'inclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. + Validation will fail if the value of the property is outside of the specifed range. The range is inclusive. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The lowest allowed value + The highest allowed value + + + + + Defines an 'inclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. + Validation will fail if the value of the property is outside of the specifed range. The range is inclusive. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The lowest allowed value + The highest allowed value + + + + + Defines an 'exclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. + Validation will fail if the value of the property is outside of the specifed range. The range is exclusive. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The lowest allowed value + The highest allowed value + + + + + Defines an 'exclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. + Validation will fail if the value of the property is outside of the specifed range. The range is exclusive. + + Type of object being validated + Type of property being validated + The rule builder on which the validator should be defined + The lowest allowed value + The highest allowed value + + + + + Defines a credit card validator for the current rule builder that ensures that the specified string is a valid credit card number. + + + + + Defines a enum value validator on the current rule builder that ensures that the specific value is a valid enum value. + + Type of Enum being validated + Type of property being validated + The rule builder on which the validator should be defined + + + + + Defines a custom validation rule + + + + + + + + + + Defines a custom validation rule + + + + + + + + + + Performs validation and then throws an exception if validation fails. + + The validator this method is extending. + The instance of the type we are validating. + The ruleset to validate against. + + + + Performs validation asynchronously and then throws an exception if validation fails. + + The validator this method is extending. + The instance of the type we are validating. + Optional: a ruleset when need to validate against. + + + + Default options that can be used to configure a validator. + + + + + Specifies the cascade mode for failures. + If set to 'Stop' then execution of the rule will stop once the first validator in the chain fails. + If set to 'Continue' then all validators in the chain will execute regardless of failures. + + + + + Specifies a custom action to be invoked when the validator fails. + + + + + + + + + + Specifies a custom error message to use if validation fails. + + The current rule + The error message to use + + + + + Specifies a custom error message to use when validation fails. + + The current rule + Delegate that will be invoked to retrieve the localized message. + + + + + Specifies a custom error message to use when validation fails. + + The current rule + Delegate that will be invoked to retrieve the localized message. + + + + + Specifies a custom error code to use if validation fails. + + The current rule + The error code to use + + + + + Specifies a custom error message resource to use when validation fails. + + The current rule + Resource type representing a resx file + Name of resource + + + + + Specifies a condition limiting when the validator should run. + The validator will only be executed if the result of the lambda returns true. + + The current rule + A lambda expression that specifies a condition for when the validator should run + Whether the condition should be applied to the current rule or all rules in the chain + + + + + Specifies a condition limiting when the validator should not run. + The validator will only be executed if the result of the lambda returns false. + + The current rule + A lambda expression that specifies a condition for when the validator should not run + Whether the condition should be applied to the current rule or all rules in the chain + + + + + Specifies an asynchronous condition limiting when the validator should run. + The validator will only be executed if the result of the lambda returns true. + + The current rule + A lambda expression that specifies a condition for when the validator should run + Whether the condition should be applied to the current rule or all rules in the chain + + + + + Specifies an asynchronous condition limiting when the validator should not run. + The validator will only be executed if the result of the lambda returns false. + + The current rule + A lambda expression that specifies a condition for when the validator should not run + Whether the condition should be applied to the current rule or all rules in the chain + + + + + Triggers an action when the rule passes. Typically used to configure dependent rules. This applies to all preceding rules in the chain. + + The current rule + An action to be invoked if the rule is valid + + + + + Specifies a custom property name to use within the error message. + + The current rule + The property name to use + + + + + Specifies a custom property name to use within the error message. + + The current rule + Func used to retrieve the property's display name + + + + + Overrides the name of the property associated with this rule. + NOTE: This is a considered to be an advanced feature. 99% of the time that you use this, you actually meant to use WithName. + + The current rule + The property name to use + + + + + Specifies custom state that should be stored alongside the validation message when validation fails for this rule. + + + + + + + + + + Specifies custom state that should be stored alongside the validation message when validation fails for this rule. + + + + + + + + + + Specifies custom severity that should be stored alongside the validation message when validation fails for this rule. + + + + + + + + + + Gets the default message for a property validato + + The validator type + The translated string + + + + Specifies how rules should cascade when one fails. + + + + + When a rule fails, execution continues to the next rule. + + + + + When a rule fails, validation is stopped and all other rules in the chain will not be executed. + + + + + Specifies where a When/Unless condition should be applied + + + + + Applies the condition to all validators declared so far in the chain. + + + + + Applies the condition to the current validator only. + + + + + Specifies the severity of a rule. + + + + + Error + + + + + Warning + + + + + Info + + + + + Validator implementation that allows rules to be defined without inheriting from AbstractValidator. + + + + public class Customer { + public int Id { get; set; } + public string Name { get; set; } + + public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> { + v => v.RuleFor(x => x.Name).NotNull(), + v => v.RuleFor(x => x.Id).NotEqual(0), + } + } + + + + + + + Delegate that specifies configuring an InlineValidator. + + + + + Allows configuration of the validator. + + + + + Rule definition for collection properties + + + + + + Initializes new instance of the CollectionPropertyRule class + + + + + + + + + + + Creates a new property rule from a lambda expression. + + + + + Invokes the validator asynchronously + + + + + + + + + + Invokes the validator + + + + + + + + + Custom logic for performing comparisons + + + + + Tries to compare the two objects. + + + The resulting comparison value. + + True if all went well, otherwise False. + + + + Tries to do a proper comparison but may fail. + First it tries the default comparison, if this fails, it will see + if the values are fractions. If they are, then it does a double + comparison, otherwise it does a long comparison. + + + + + Tries to compare the two objects, but will throw an exception if it fails. + + True on success, otherwise False. + + + + Tries to compare the two objects, but will throw an exception if it fails. + + True on success, otherwise False. + + + + Default validator selector that will execute all rules that do not belong to a RuleSet. + + + + + Determines whether or not a rule should execute. + + The rule + Property path (eg Customer.Address.Line1) + Contextual information + Whether or not the validator can execute. + + + + Custom IValidationRule for performing custom logic. + + + + + + Rule set to which this rule belongs. + + + + + Creates a new DelegateValidator using the specified function to perform validation. + + + + + Creates a new DelegateValidator using the specified function to perform validation. + + + + + Creates a new DelegateValidator using the specified async function to perform validation. + + + + + Creates a new DelegateValidator using the specified async function to perform validation. + + + + + Performs validation using a validation context and returns a collection of Validation Failures. + + Validation Context + A collection of validation failures + + + + Performs validation asynchronously using a validation context and returns a collection of Validation Failures. + + Validation Context + + A collection of validation failures + + + + The validators that are grouped under this rule. + + + + + Performs validation using a validation context and returns a collection of Validation Failures. + + Validation Context + A collection of validation failures + + + + When overloaded performs validation asynchronously using a validation context and returns a collection of Validation Failures. + + Validation Context + + A collection of validation failures + + + + Applies a condition to the validator. + + + + + + + Applies a condition asynchronously to the validator + + + + + + + Useful extensions + + + + + Checks if the expression is a parameter expression + + + + + + + Gets a MemberInfo from a member expression. + + + + + Gets a MemberInfo from a member expression. + + + + + Splits pascal case, so "FooBar" would become "Foo Bar" + + + + + Helper method to construct a constant expression from a constant. + + Type of object being validated + Type of property being validated + The value being compared + + + + + Represents an object that is configurable. + + Type of object being configured + Return type + + + + Configures the current object. + + Action to configure the object. + + + + + Instancace cache. + + + + + Gets or creates an instance using Activator.CreateInstance + + The type to instantiate + The instantiated object + + + + Gets or creates an instance using a custom factory + + The type to instantiate + The custom factory + The instantiated object + + + + Member accessor cache. + + + + + + Gets an accessor func based on an expression + + + The member represented by the expression + + Accessor func + + + + Determines whether or not a rule should execute. + + + + + Determines whether or not a rule should execute. + + The rule + Property path (eg Customer.Address.Line1) + Contextual information + Whether or not the validator can execute. + + + + Selects validators that are associated with a particular property. + + + + + Creates a new instance of MemberNameValidatorSelector. + + + + + Member names that are validated. + + + + + Determines whether or not a rule should execute. + + The rule + Property path (eg Customer.Address.Line1) + Contextual information + Whether or not the validator can execute. + + + + Creates a MemberNameValidatorSelector from a collection of expressions. + + + + + Gets member names from expressions + + + + + + + + Assists in the construction of validation messages. + + + + + Default Property Name placeholder. + + + + + Default Property Value placeholder. + + + + + Adds a value for a validation message placeholder. + + + + + + + + Appends a property name to the message. + + The name of the property + + + + + Appends a property value to the message. + + The value of the property + + + + + Adds additional arguments to the message for use with standard string placeholders. + + Additional arguments + + + + + Constructs the final message from the specified template. + + Message template + The message with placeholders replaced with their appropriate values + + + + Additional arguments to use + + + + + Additional placeholder values + + + + + Represents a chain of properties + + + + + Creates a new PropertyChain. + + + + + Creates a new PropertyChain based on another. + + + + + Creates a new PropertyChain + + + + + + Creates a PropertyChain from a lambda expresion + + + + + + + Adds a MemberInfo instance to the chain + + Member to add + + + + Adds a property name to the chain + + Name of the property to add + + + + Adds an indexer to the property chain. For example, if the following chain has been constructed: + Parent.Child + then calling AddIndexer(0) would convert this to: + Parent.Child[0] + + + + + + Creates a string representation of a property chain. + + + + + Checks if the current chain is the child of another chain. + For example, if chain1 were for "Parent.Child" and chain2 were for "Parent.Child.GrandChild" then + chain2.IsChildChainOf(chain1) would be true. + + The parent chain to compare + True if the current chain is the child of the other chain, otherwise false + + + + Builds a property path. + + + + + Number of member names in the chain + + + + + Defines a rule associated with a property. + + + + + Property associated with this rule. + + + + + Function that can be invoked to retrieve the value of the property. + + + + + Expression that was used to create the rule. + + + + + String source that can be used to retrieve the display name (if null, falls back to the property name) + + + + + Rule set that this rule belongs to (if specified) + + + + + Function that will be invoked if any of the validators associated with this rule fail. + + + + + The current validator being configured by this rule. + + + + + Type of the property being validated + + + + + Cascade mode for this rule. + + + + + Validators associated with this rule. + + + + + Creates a new property rule. + + Property + Function to get the property value + Lambda expression used to create the rule + Function to get the cascade mode. + Type to validate + Container type that owns the property + + + + Creates a new property rule from a lambda expression. + + + + + Creates a new property rule from a lambda expression. + + + + + Adds a validator to the rule. + + + + + Replaces a validator in this rule. Used to wrap validators. + + + + + Remove a validator in this rule. + + + + + Clear all validators from this rule. + + + + + Returns the property name for the property being validated. + Returns null if it is not a property being validated (eg a method call) + + + + + Allows custom creation of an error message + + + + + Dependent rules + + + + + Display name for the property. + + + + + Display name for the property. + + + + + Performs validation using a validation context and returns a collection of Validation Failures. + + Validation Context + A collection of validation failures + + + + Performs asynchronous validation using a validation context and returns a collection of Validation Failures. + + Validation Context + + A collection of validation failures + + + + Invokes the validator asynchronously + + + + + + + + + + Invokes a property validator using the specified validation context. + + + + + Applies a condition to the rule + + + + + + + Applies the condition to the rule asynchronously + + + + + + + Include rule + + + + + Creates a new IncludeRule + + + + + + + + + Creates a new include rule from an existing validator + + + + + + + + + Builds a validation rule and constructs a validator. + + Type of object being validated + Type of property being validated + + + + The rule being created by this RuleBuilder. + + + + + Creates a new instance of the RuleBuilder class. + + + + + Sets the validator associated with the rule. + + The validator to set + + + + + Sets the validator associated with the rule. Use with complex properties where an IValidator instance is already declared for the property type. + + The validator to set + + + + Sets the validator associated with the rule. Use with complex properties where an IValidator instance is already declared for the property type. + + The validator provider to set + + + + Selects validators that belong to the specified rulesets. + + + + + Rule sets + + + + + Creates a new instance of the RulesetValidatorSelector. + + + + + Determines whether or not a rule should execute. + + The rule + Property path (eg Customer.Address.Line1) + Contextual information + Whether or not the validator can execute. + + + + Checks if the rule is an IncludeRule + + + + + + + Gets validators for method parameters. + + + + + Gets a validator for . + + The instance to get a validator for. + Created instance; if a validator cannot be + created. + + + + Defines a rule associated with a property which can have multiple validators. + + + + + The validators that are grouped under this rule. + + + + + Name of the rule-set to which this rule belongs. + + + + + Performs validation using a validation context and returns a collection of Validation Failures. + + Validation Context + A collection of validation failures + + + + Performs validation using a validation context and returns a collection of Validation Failures asynchronoulsy. + + Validation Context + Cancellation token + A collection of validation failures + + + + Applies a condition to the rule + + + + + + + Applies a condition to the rule asynchronously + + + + + + + Defines a validator for a particular type. + + + + + + Validates the specified instance. + + The instance to validate + A ValidationResult object containing any validation failures. + + + + Validate the specified instance asynchronously + + The instance to validate + + A ValidationResult object containing any validation failures. + + + + Sets the cascade mode for all rules within this validator. + + + + + Defines a validator for a particular type. + + + + + Validates the specified instance + + + A ValidationResult containing any validation failures + + + + Validates the specified instance asynchronously + + + Cancellation token + A ValidationResult containing any validation failures + + + + Validates the specified instance. + + A ValidationContext + A ValidationResult object containy any validation failures. + + + + Validates the specified instance asynchronously. + + A ValidationContext + Cancellation token + A ValidationResult object containy any validation failures. + + + + Creates a hook to access various meta data properties + + A IValidatorDescriptor object which contains methods to access metadata + + + + Checks to see whether the validator can validate objects of the specified type + + + + + Provides metadata about a validator. + + + + + Gets the name display name for a property. + + + + + Gets a collection of validators grouped by property. + + + + + Gets validators for a particular property. + + + + + Gets rules for a property. + + + + + Gets validators for a particular type. + + + + + Gets the validator for the specified type. + + + + + Gets the validator for the specified type. + + + + + Defines a validation failure + + + + + Creates a new validation failure. + + + + + Creates a new ValidationFailure. + + + + + The name of the property. + + + + + The error message + + + + + The property value that caused the failure. + + + + + Custom state associated with the failure. + + + + + Custom severity level associated with the failure. + + + + + Gets or sets the formatted message arguments. + These are values for custom formatted message in validator resource files + Same formatted message can be reused in UI and with same number of format placeholders + Like "Value {0} that you entered should be {1}" + + + + + Gets or sets the formatted message placeholder values. + + + + + The resource name used for building the message + + + + + Creates a textual representation of the failure. + + + + + Creates a new ValidationFailure with ErrorCode. + + + + + Gets or sets the error code. + + + + + The result of running a validator + + + + + Whether validation succeeded + + + + + A collection of errors + + + + + Creates a new validationResult + + + + + Creates a new ValidationResult from a collection of failures + + List of which is later available through . This list get's copied. + + Every caller is responsible for not adding null to the list. + + + + + Rule builder that starts the chain + + + + + + + Rule builder + + + + + + + Associates a validator with this the property for this rule builder. + + The validator to set + + + + + Associates an instance of IValidator with the current property rule. + + The validator to use + + + + Associates a validator provider with the current property rule. + + The validator provider to use + + + + Rule builder + + + + + + + Validation context + + + + Validation context + + + + + + Creates a new validation context + + + + + + Creates a new validation context with a custom property chain and selector + + + + + + + + The object to validate + + + + + Validation context + + + Validation context + + + + + Creates a new validation context + + + + + + Creates a new validation context with a property chain and validation selector + + + + + + + + Property chain + + + + + Object being validated + + + + + Selector + + + + + Whether this is a child context + + + + + Whether this is a child collection context. + + + + + Creates a new ValidationContext based on this one + + + + + + + + + Creates a new validation context for use with a child validator + + + + + + + Creates a new validation context for use with a child collection validator + + + + + + + An exception that represents failed validation + + + An exception that represents failed validation + + + + + Validation errors + + + + + Creates a new ValidationException + + + + + + Creates a new ValidationException + + + + + + + Creates a new ValidationException + + + + + + Used for providing metadata about a validator. + + + + + Rules associated with the validator + + + + + Creates a ValidatorDescriptor + + + + + + Gets the display name or a property property + + + + + + + Gets all members with their associated validators + + + + + + Gets validators for a specific member + + + + + + + Gets rules for a specific member + + + + + + + Gets the member name from an expression + + + + + + + Gets validators for a member + + + + + + + + Gets rules grouped by ruleset + + + + + + Information about reulesets + + + + + Creates a new RulesetMetadata + + + + + + + Rulset name + + + + + Rules in the ruleset + + + + + Factory for creating validators + + + + + Gets a validator for a type + + + + + + + Gets a validator for a type + + + + + + + Instantiates the validator + + + + + + + Validator runtime options + + + + + Default cascade mode + + + + + Default property chain separator + + + + + Default resource provider + + + + + Default language manager + + + + + Customizations of validator selector + + + + + Specifies a factory for creating MessageFormatter instances. + + + + + Pluggable logic for resolving property names + + + + + Pluggable logic for resolving display names + + + + + Disables the expression accessor cache. Not recommended. + + + + + ValidatorSelector options + + + + + Factory func for creating the default validator selector + + + + + Factory func for creating the member validator selector + + + + + Factory func for creating the ruleset validator selector + + + + + Base class for all comparison validators + + + + + + + + + + + + + + + + + + Performs the comparison + + + + + + + Override to perform the comparison + + + + + + + + Metadata- the comparison type + + + + + Metadata- the member being compared + + + + + Metadata- the value being compared + + + + + Defines a comparison validator + + + + + Metadata- the comparison type + + + + + Metadata- the member being compared + + + + + Metadata- the value being compared + + + + + Asynchronous custom validator + + + + + Creates a new ASyncPredicateValidator + + + + + + Runs the validation check + + + + + + + + Ensures that the property value is a valid credit card number. + + + + + Custom validator that allows for manual/direct creation of ValidationFailure instances. + + + + + + Creates a new instance of the CustomValidator + + + + + + Creates a new isntance of the CutomValidator. + + + + + + Custom validation context + + + + + Creates a new CustomContext + + The parent PropertyValidatorContext that represents this execution + + + + Adds a new validation failure. + + The property name + The error mesage + + + + Adds a new validation failure (the property name is inferred) + + The error message + + + + Adss a new validation failure + + The failure to add + + + + A custom property validator. + This interface should not be implemented directly in your code as it is subject to change. + Please inherit from PropertyValidator instead. + + + + + Prepares the of for an upcoming . + + The validator context + + + + Creates an error validation result for this validator. + + The validator context + Returns an error validation result. + + + + Allows a decimal to be validated for scale and precision. + Scale would be the number of digits to the right of the decimal point. + Precision would be the number of digits. + + It can be configured to use the effective scale and precision + (i.e. ignore trailing zeros) if required. + + 123.4500 has an scale of 4 and a precision of 7, but an effective scale + and precision of 2 and 5 respectively. + + + + + The AppHost.Container. Note: it is not thread safe to register dependencies after AppStart. + + + + + Initializes the AppHost. + Calls the method. + Should be called before start. + + + + + Collection of added plugins. + + + + + If app currently runs for unit tests. Used for overwritting AuthSession. + + + + + Gets Full Directory Path of where the app is running + + + + + Starts the AppHost. + this methods needs to be overwritten in subclass to provider a listener to start handling requests. + + Url to listen to + + + + Collection of PreRequest filters. + They are called before each request is handled by a service, but after an HttpHandler is by the chosen. + called in . + + + + + Collection of RequestConverters. + Can be used to convert/change Input Dto + Called after routing and model binding, but before request filters. + All request converters are called unless + Converter can return null, orginal model will be used. + + Note one converter could influence the input for the next converter! + + + + + Collection of ResponseConverters. + Can be used to convert/change Output Dto + + Called directly after response is handled, even before ! + + + + + Lists of view engines for this app. + If view is needed list is looped until view is found. + + + + + Executed immediately before a Service is executed. Use return to change the request DTO used, must be of the same type. + + + + + Executed immediately after a service is executed. Use return to change response used. + + + + + Occurs when the Service throws an Exception. + + + + + Occurs when an exception is thrown whilst processing a request. + + + + + Register singleton in the Ioc Container of the AppHost. + + + + + Registers type to be automatically wired by the Ioc container of the AppHost. + + Concrete type + Abstract type + + + + Tries to resolve type through the ioc container of the AppHost. + Can return null. + + + + + Resolves Type through the Ioc container of the AppHost. + + If type is not registered + + + + Looks for first plugin of this type in Plugins. + Reflection performance penalty. + + + + + Apply PreRequest Filters for participating Custom Handlers, e.g. RazorFormat, MarkdownFormat, etc + + + + + Applies the raw request filters. Returns whether or not the request has been handled + and no more processing should be done. + + + + + + Applies the request filters. Returns whether or not the request has been handled + and no more processing should be done. + + + + + + Applies the response filters. Returns whether or not the request has been handled + and no more processing should be done. + + + + + + Inspect or modify ever new UserSession created or resolved from cache. + return null if Session is invalid to create new Session. + + + + + Gets IDbConnection Checks if DbInfo is seat in RequestContext. + See multitenancy: http://docs.servicestack.net/multitenancy + Called by itself, and + + Provided by services and pageView, can be helpfull when overriding this method + + + + + Resolves based on .GetClient(); + Called by itself, and + + Provided by services and pageView, can be helpfull when overriding this method + + + + + Tries to resolve through Ioc container. + If not registered, it falls back to .GetClient(); + Called by itself, and + + Provided by services and pageView, can be helpfull when overriding this method + + + + + Returns . cache is only persisted for this running app instance. + Called by .MemoryCacheClient + + Provided by services and pageView, can be helpfull when overriding this method + Nullable MemoryCacheClient + + + + Returns from the IOC container. + Called by itself, and + + Provided by services and PageViewBase, can be helpfull when overriding this method + + + + + If enabled reverts to persist password hashes using the original SHA256 SaltedHash implementation. + By default ServiceStack uses the more secure ASP.NET Identity v3 PBKDF2 with HMAC-SHA256 implementation. + + New Users will have their passwords persisted with the specified implementation, likewise existing users will have their passwords re-hased + to use the current registered IPasswordHasher. + + + + + Older Password Hashers that were previously used to hash passwords. Failed password matches check to see if the password was hashed with + any of the registered FallbackPasswordHashers, if true the password attempt will succeed and password will get re-hashed with + the current registered IPasswordHasher. + + + + + Read/Write Virtual FileSystem. Defaults to FileSystemVirtualPathProvider + + + + + Cascading collection of virtual file sources, inc. Embedded Resources, File System, In Memory, S3 + + + + + Call to signal the completion of a ServiceStack-handled Request + + + + + Resolves and auto-wires a ServiceStack Service from a ASP.NET HttpContext. + + + + + Resolves and auto-wires a ServiceStack Service from a HttpListenerContext. + + + + + Resolves and auto-wires a ServiceStack Service. + + + + + Context to capture IService action + + + + + Can ignore as doesn't throw if HTTP Headers already written + + + + + Creates instance using straight Resolve approach. + This will throw an exception if resolution fails + + + + + Creates instance using the TryResolve approach if tryResolve = true. + Otherwise uses Resolve approach, which will throw an exception if resolution fails + + + + + Sets a persistent cookie which never expires + + + + + Sets a session cookie which expires after the browser session closes + + + + + Deletes a specified cookie by setting its value to empty and expiration to -1 days + + + + + Return File at specified virtualPath from AppHost.VirtualFiles ContentRootPath + + + + + Keep default file contents in-memory + + + + + + Wrapper class for the HTTPListener to allow easier access to the + server, for start and stop management and event routing of the actual + inbound requests. + + + + + Starts the Web Service + + + A Uri that acts as the base that the server is listening on. + Format should be: http://127.0.0.1:8080/ or http://127.0.0.1:8080/somevirtual/ + Note: the trailing slash is required! For more info see the + HttpListener.Prefixes property on MSDN. + + + + + Shut down the Web Service + + + + + When overrided in the sub class, which can be used to implement a custom hnandler + + + + + + Reserves the specified URL for non-administrator users and accounts. + http://msdn.microsoft.com/en-us/library/windows/desktop/cc307223(v=vs.85).aspx + + Reserved Url if the process completes successfully + + + + Can ignore as doesn't throw if HTTP Headers already written + + + + + Used in Unit tests + + + + + + The number of segments separated by '/' determinable by path.Split('/').Length + e.g. /path/to/here.ext == 3 + + + + + The total number of segments after subparts have been exploded ('.') + e.g. /path/to/here.ext == 4 + + + + + Provide for quick lookups based on hashes that can be determined from a request url + + + + + For performance withPathInfoParts should already be a lower case string + to minimize redundant matching operations. + + + + + + For performance withPathInfoParts should already be a lower case string + to minimize redundant matching operations. + + + + + + + + + Get Best Matching Route. + + + + If not null, ensures any Route matches any [Route(Matches)] + + + + + Execute MQ + + + + + Execute MQ with requestContext + + + + + Execute using empty RequestContext + + + + + External HTTP Request called from HTTP handlers + + + + + Execute a Service with a Request DTO. + + + + + Gets the name of the base most type in the heirachy tree with the same. + + We get an exception when trying to create a schema with multiple types of the same name + like when inheriting from a DataContract with the same name. + + The type. + + + + + Back-end Service used by /js/hot-fileloader.js to detect file changes in /wwwroot and auto reload page. + + + + Predefined pattern that matches <?php ... ?> tags. Could be passed inside a list to {@link #setPreservePatterns(List) setPreservePatterns} method. - - + + Predefined pattern that matches <% ... %> tags. Could be passed inside a list to {@link #setPreservePatterns(List) setPreservePatterns} method. - - + + Predefined pattern that matches <--# ... --> tags. Could be passed inside a list to {@link #setPreservePatterns(List) setPreservePatterns} method. - - + + Predefined list of tags that are very likely to be block-level. Could be passed to {@link #setRemoveSurroundingSpaces(string) setRemoveSurroundingSpaces} method. - - + + Predefined list of tags that are block-level by default, excluding <div> and <li> tags. Table tags are also included. Could be passed to {@link #setRemoveSurroundingSpaces(string) setRemoveSurroundingSpaces} method. - - + + Could be passed to {@link #setRemoveSurroundingSpaces(string) setRemoveSurroundingSpaces} method to remove all surrounding spaces (not recommended). - - + + If set to false all compression will be bypassed. Might be useful for testing purposes. Default is true. @param enabled set false to bypass all compression - - + + Gets or Sets JavaScript compressor implementation that will be used to compress inline JavaScript in HTML. - - + + Returns CSS compressor implementation that will be used to compress inline CSS in HTML. - - + + If set to true all HTML comments will be removed. Default is true. @param removeComments set true to remove all HTML comments - - + + If set to true all multiple whitespace characters will be replaced with single spaces. Default is true. @param removeMultiSpaces set true to replace all multiple whitespace characters will single spaces. - - - - + + + + Enables JavaScript compression within <script> tags if set to true. Default is false for performance reasons. @@ -1114,8 +5049,8 @@ @param compressJavaScript set true to enable JavaScript compression. Default is false - - + + Enables CSS compression within <style> tags using Yahoo YUI ICompressor if set to true. Default is false for performance reasons. @@ -1127,38 +5062,38 @@ @param compressCss set true to enable CSS compression. Default is false - - + + If set to true, existing DOCTYPE declaration will be replaced with simple <!DOCTYPE html> declaration. Default is false. @param simpleDoctype set true to replace existing DOCTYPE declaration with <!DOCTYPE html> - - - + + + If set to true, type="text/style" attributes will be removed from <style> tags. Default is false. @param removeStyleAttributes set true to remove type="text/style" attributes from <style> tags - - - + + + If set to true, method="get" attributes will be removed from <form> tags. Default is false. @param removeFormAttributes set true to remove method="get" attributes from <form> tags - - + + If set to true, type="text" attributes will be removed from <input> tags. Default is false. @param removeInputAttributes set true to remove type="text" attributes from <input> tags - - - - - - - - - + + + + + + + + + Returns {@link HtmlCompressorStatistics} object containing statistics of the last HTML compression, if enabled. Should be called after {@link #compress(string)} @@ -1166,6994 +5101,108 @@ @see HtmlCompressorStatistics @see #setGenerateStatistics(bool) - - + + The main method that compresses given HTML source and returns compressed result. @param html HTML content to compress @return compressed content. - - + + Returns metrics of an uncompressed document @return metrics of an uncompressed document @see HtmlMetrics - - + + Returns metrics of a compressed document @return metrics of a compressed document @see HtmlMetrics - - - + + + Returns total size of blocks that were skipped by the compressor (for example content inside <pre> tags or inside <script> tags with disabled javascript compression) @return the total size of blocks that were skipped by the compressor, in bytes - - + + Returns total filesize of a document @return total filesize of a document, in bytes - - + + Returns number of empty characters (spaces, tabs, end of lines) in a document @return number of empty characters in a document - - + + Returns total size of inline <script> tags @return total size of inline <script> tags, in bytes - - + + Returns total size of inline <style> tags @return total size of inline <style> tags, in bytes - - + + Returns total size of inline event handlers (onclick, etc) @return total size of inline event handlers, in bytes - - - - Typed UserSession - - - - - Dynamic Session Bag - - - - - Specify all roles to be used by this application - - - - - Only allow access to users in specified roles - - - - - Create Odnoklassniki App at: http://www.odnoklassniki.ru/devaccess - The Callback URL for your app should match the CallbackUrl provided. - - NB: They claim they use OAuth 2.0, but they in fact don't. - http://apiok.ru/wiki/display/api/Authorization+OAuth+2.0 - - - - - The entry point for all AuthProvider providers. Runs inside the AuthService so exceptions are treated normally. - Overridable so you can provide your own Auth implementation. - - - - - - - - - Sets the CallbackUrl and session.ReferrerUrl if not set and initializes the session tokens for this AuthProvider - - - - - - - - - Create VK App at: http://vk.com/editapp?act=create - The Callback URL for your app should match the CallbackUrl provided. - - - - - If previous attemts failes, the subsequential calls - build up code value like "code1,code2,code3" - so we need the last one only - - - - - - - Create Yandex App at: https://oauth.yandex.ru/client/new - The Callback URL for your app should match the CallbackUrl provided. - - - - - Create an App at: https://github.com/settings/applications/new - The Callback URL for your app should match the CallbackUrl provided. - - - - - Calling to Github API without defined Useragent throws - exception "The server committed a protocol violation. Section=ResponseStatusLine" - - - - - Creates the required missing tables or DB schema - - - - - Redirect to the https:// version of this url if not already. - - - - - Don't redirect when in DebugMode - - - - - Don't redirect if the request was a forwarded request, e.g. from a Load Balancer - - - - - Encapsulates creating a new message handler - - - - - Processes all messages in a Normal and Priority Queue. - Expects to be called in 1 thread. i.e. Non Thread-Safe. - - - - - - A convenient repository base class you can inherit from to reduce the boilerplate - with accessing a managed IDbConnection - - - - - A convenient base class for your injected service dependencies that reduces the boilerplate - with managed access to ServiceStack's built-in providers - - - - - Only generate specified Verb entries for "ANY" routes - - - - - Tell ServiceStack to use ThreadStatic Items Collection for RequestScoped items. - Warning: ThreadStatic Items aren't pinned to the same request in async services which callback on different threads. - - - - - Track any IDisposable's to dispose of at the end of the request in IAppHost.OnEndRequest() - - - - - - Release currently registered dependencies for this request - - true if any dependencies were released - - - - Gets a list of items for this request. - - This list will be cleared on every request and is specific to the original thread that is handling the request. - If a handler uses additional threads, this data will not be available on those threads. - - - - - This class stores the caller call context in order to restore - it when the work item is executed in the thread pool environment. - - - - - Constructor - - - - - Captures the current thread context - - - - - - Applies the thread context stored earlier - - - - - - EventWaitHandleFactory class. - This is a static class that creates AutoResetEvent and ManualResetEvent objects. - In WindowCE the WaitForMultipleObjects API fails to use the Handle property - of XxxResetEvent. It can use only handles that were created by the CreateEvent API. - Consequently this class creates the needed XxxResetEvent and replaces the handle if - it's a WindowsCE OS. - - - - - Create a new AutoResetEvent object - - Return a new AutoResetEvent object - - - - Create a new ManualResetEvent object - - Return a new ManualResetEvent object - - - - Represents an exception in case IWorkItemResult.GetResult has been canceled - - - Represents an exception in case IWorkItemResult.GetResult has been canceled - - - - - Represents an exception in case IWorkItemResult.GetResult has been timed out - - - Represents an exception in case IWorkItemResult.GetResult has been timed out - - - - - Represents an exception in case IWorkItemResult.GetResult has been timed out - - - Represents an exception in case IWorkItemResult.GetResult has been timed out - - - - - A delegate that represents the method to run as the work item - - A state object for the method to run - - - - A delegate to call after the WorkItemCallback completed - - The work item result object - - - - A delegate to call after the WorkItemCallback completed - - The work item result object - - - - A delegate to call when a WorkItemsGroup becomes idle - - A reference to the WorkItemsGroup that became idle - - - - A delegate to call after a thread is created, but before - it's first use. - - - - - A delegate to call when a thread is about to exit, after - it is no longer belong to the pool. - - - - - Defines the availeable priorities of a work item. - The higher the priority a work item has, the sooner - it will be executed. - - - - - IWorkItemsGroup interface - Created by SmartThreadPool.CreateWorkItemsGroup() - - - - - Get an array with all the state objects of the currently running items. - The array represents a snap shot and impact performance. - - - - - Starts to execute work items - - - - - Cancel all the work items. - Same as Cancel(false) - - - - - Cancel all work items using thread abortion - - True to stop work items by raising ThreadAbortException - - - - Wait for all work item to complete. - - - - - Wait for all work item to complete, until timeout expired - - How long to wait for the work items to complete - Returns true if work items completed within the timeout, otherwise false. - - - - Wait for all work item to complete, until timeout expired - - How long to wait for the work items to complete in milliseconds - Returns true if work items completed within the timeout, otherwise false. - - - - Queue a work item - - A callback to execute - Returns a work item result - - - - Queue a work item - - A callback to execute - The priority of the work item - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - The work item priority - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - The work item priority - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Indicates on which cases to call to the post execute callback - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Indicates on which cases to call to the post execute callback - The work item priority - Returns a work item result - - - - Queue a work item - - Work item info - A callback to execute - Returns a work item result - - - - Queue a work item - - Work item information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - Returns a work item result - - - - Queue a work item. - - Returns a IWorkItemResult object, but its GetResult() will always return null - - - - Queue a work item. - - Returns a IWorkItemResult object, but its GetResult() will always return null - - - - Queue a work item. - - Returns a IWorkItemResult object, but its GetResult() will always return null - - - - Queue a work item. - - Returns a IWorkItemResult object, but its GetResult() will always return null - - - - Queue a work item. - - Returns a IWorkItemResult object, but its GetResult() will always return null - - - - Queue a work item. - - Returns a IWorkItemResult<TResult> object. - its GetResult() returns a TResult object - - - - Queue a work item. - - Returns a IWorkItemResult<TResult> object. - its GetResult() returns a TResult object - - - - Queue a work item. - - Returns a IWorkItemResult<TResult> object. - its GetResult() returns a TResult object - - - - Queue a work item. - - Returns a IWorkItemResult<TResult> object. - its GetResult() returns a TResult object - - - - Queue a work item. - - Returns a IWorkItemResult<TResult> object. - its GetResult() returns a TResult object - - - - Get/Set the name of the WorkItemsGroup - - - - - Get/Set the maximum number of workitem that execute cocurrency on the thread pool - - - - - Get the number of work items waiting in the queue. - - - - - Get the WorkItemsGroup start information - - - - - IsIdle is true when there are no work items running or queued. - - - - - This event is fired when all work items are completed. - (When IsIdle changes to true) - This event only work on WorkItemsGroup. On SmartThreadPool - it throws the NotImplementedException. - - - - - Never call to the PostExecute call back - - - - - Call to the PostExecute only when the work item is cancelled - - - - - Call to the PostExecute only when the work item is not cancelled - - - - - Always call to the PostExecute - - - - - The common interface of IWorkItemResult and IWorkItemResult<T> - - - - - This method intent is for internal use. - - - - - - This method intent is for internal use. - - - - - - IWorkItemResult interface. - Created when a WorkItemCallback work item is queued. - - - - - IWorkItemResult<TResult> interface. - Created when a Func<TResult> work item is queued. - - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits. - - The result of the work item - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout. - - The result of the work item - On timeout throws WorkItemTimeoutException - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout. - - The result of the work item - On timeout throws WorkItemTimeoutException - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout or until the cancelWaitHandle is signaled. - - Timeout in milliseconds, or -1 for infinite - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the blocking if needed - The result of the work item - On timeout throws WorkItemTimeoutException - On cancel throws WorkItemCancelException - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout or until the cancelWaitHandle is signaled. - - The result of the work item - On timeout throws WorkItemTimeoutException - On cancel throws WorkItemCancelException - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits. - - Filled with the exception if one was thrown - The result of the work item - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout. - - - - Filled with the exception if one was thrown - The result of the work item - On timeout throws WorkItemTimeoutException - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout. - - - Filled with the exception if one was thrown - - The result of the work item - On timeout throws WorkItemTimeoutException - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout or until the cancelWaitHandle is signaled. - - Timeout in milliseconds, or -1 for infinite - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the blocking if needed - Filled with the exception if one was thrown - The result of the work item - On timeout throws WorkItemTimeoutException - On cancel throws WorkItemCancelException - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits until timeout or until the cancelWaitHandle is signaled. - - The result of the work item - - Filled with the exception if one was thrown - - - On timeout throws WorkItemTimeoutException - On cancel throws WorkItemCancelException - - - - Same as Cancel(false). - - - - - Cancel the work item execution. - If the work item is in the queue then it won't execute - If the work item is completed, it will remain completed - If the work item is in progress then the user can check the SmartThreadPool.IsWorkItemCanceled - property to check if the work item has been cancelled. If the abortExecution is set to true then - the Smart Thread Pool will send an AbortException to the running thread to stop the execution - of the work item. When an in progress work item is canceled its GetResult will throw WorkItemCancelException. - If the work item is already cancelled it will remain cancelled - - When true send an AbortException to the executing thread. - Returns true if the work item was not completed, otherwise false. - - - - Gets an indication whether the asynchronous operation has completed. - - - - - Gets an indication whether the asynchronous operation has been canceled. - - - - - Gets the user-defined object that contains context data - for the work item method. - - - - - Get the work item's priority - - - - - Return the result, same as GetResult() - - - - - Returns the exception if occured otherwise returns null. - - - - - An internal delegate to call when the WorkItem starts or completes - - - - - This method is intent for internal use. - - - - - PriorityQueue class - This class is not thread safe because we use external lock - - - - - The number of queues, there is one for each type of priority - - - - - Work items queues. There is one for each type of priority - - - - - The total number of work items within the queues - - - - - Use with IEnumerable interface - - - - - Enqueue a work item. - - A work item - - - - Dequeque a work item. - - Returns the next work item - - - - Find the next non empty queue starting at queue queueIndex+1 - - The index-1 to start from - - The index of the next non empty queue or -1 if all the queues are empty - - - - - Clear all the work items - - - - - Returns an enumerator to iterate over the work items - - Returns an enumerator - - - - The number of work items - - - - - The class the implements the enumerator - - - - - Smart thread pool class. - - - - - Contains the name of this instance of SmartThreadPool. - Can be changed by the user. - - - - - Cancel all the work items. - Same as Cancel(false) - - - - - Wait for the SmartThreadPool/WorkItemsGroup to be idle - - - - - Wait for the SmartThreadPool/WorkItemsGroup to be idle - - - - - Queue a work item - - A callback to execute - Returns a work item result - - - - Queue a work item - - A callback to execute - The priority of the work item - Returns a work item result - - - - Queue a work item - - Work item info - A callback to execute - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - The work item priority - Returns a work item result - - - - Queue a work item - - Work item information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - The work item priority - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Indicates on which cases to call to the post execute callback - Returns a work item result - - - - Queue a work item - - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Indicates on which cases to call to the post execute callback - The work item priority - Returns a work item result - - - - Get/Set the name of the SmartThreadPool/WorkItemsGroup instance - - - - - IsIdle is true when there are no work items running or queued. - - - - - Default minimum number of threads the thread pool contains. (0) - - - - - Default maximum number of threads the thread pool contains. (25) - - - - - Default idle timeout in milliseconds. (One minute) - - - - - Indicate to copy the security context of the caller and then use it in the call. (false) - - - - - Indicate to copy the HTTP context of the caller and then use it in the call. (false) - - - - - Indicate to dispose of the state objects if they support the IDispose interface. (false) - - - - - The default option to run the post execute (CallToPostExecute.Always) - - - - - The default work item priority (WorkItemPriority.Normal) - - - - - The default is to work on work items as soon as they arrive - and not to wait for the start. (false) - - - - - The default thread priority (ThreadPriority.Normal) - - - - - The default thread pool name. (SmartThreadPool) - - - - - The default fill state with params. (false) - It is relevant only to QueueWorkItem of Action<...>/Func<...> - - - - - The default thread backgroundness. (true) - - - - - The default apartment state of a thread in the thread pool. - The default is ApartmentState.Unknown which means the STP will not - set the apartment of the thread. It will use the .NET default. - - - - - The default post execute method to run. (None) - When null it means not to call it. - - - - - The default name to use for the performance counters instance. (null) - - - - - The default Max Stack Size. (SmartThreadPool) - - - - - Dictionary of all the threads in the thread pool. - - - - - Queue of work items. - - - - - Count the work items handled. - Used by the performance counter. - - - - - Number of threads that currently work (not idle). - - - - - Stores a copy of the original STPStartInfo. - It is used to change the MinThread and MaxThreads - - - - - Total number of work items that are stored in the work items queue - plus the work items that the threads in the pool are working on. - - - - - Signaled when the thread pool is idle, i.e. no thread is busy - and the work items queue is empty - - - - - An event to signal all the threads to quit immediately. - - - - - A flag to indicate if the Smart Thread Pool is now suspended. - - - - - A flag to indicate the threads to quit. - - - - - Counts the threads created in the pool. - It is used to name the threads. - - - - - Indicate that the SmartThreadPool has been disposed - - - - - Holds all the WorkItemsGroup instaces that have at least one - work item int the SmartThreadPool - This variable is used in case of Shutdown - - - - - A common object for all the work items int the STP - so we can mark them to cancel in O(1) - - - - - Windows STP performance counters - - - - - Local STP performance counters - - - - - Constructor - - - - - Constructor - - Idle timeout in milliseconds - - - - Constructor - - Idle timeout in milliseconds - Upper limit of threads in the pool - - - - Constructor - - Idle timeout in milliseconds - Upper limit of threads in the pool - Lower limit of threads in the pool - - - - Constructor - - A SmartThreadPool configuration that overrides the default behavior - - - - Waits on the queue for a work item, shutdown, or timeout. - - - Returns the WaitingCallback or null in case of timeout or shutdown. - - - - - Put a new work item in the queue - - A work item to queue - - - - Inform that the current thread is about to quit or quiting. - The same thread may call this method more than once. - - - - - Starts new threads - - The number of threads to start - - - - A worker thread method that processes work items from the work items queue. - - - - - Force the SmartThreadPool to shutdown - - - - - Force the SmartThreadPool to shutdown with timeout - - - - - Empties the queue of work items and abort the threads in the pool. - - - - - Wait for all work items to complete - - Array of work item result objects - - true when every work item in workItemResults has completed; otherwise false. - - - - - Wait for all work items to complete - - Array of work item result objects - The number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - - true when every work item in workItemResults has completed; otherwise false. - - - - - Wait for all work items to complete - - Array of work item result objects - The number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the wait if needed - - true when every work item in workItemResults has completed; otherwise false. - - - - - Wait for all work items to complete - - Array of work item result objects - The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - - true when every work item in workItemResults has completed; otherwise false. - - - - - Wait for all work items to complete - - Array of work item result objects - The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the wait if needed - - true when every work item in workItemResults has completed; otherwise false. - - - - - Waits for any of the work items in the specified array to complete, cancel, or timeout - - Array of work item result objects - - The array index of the work item result that satisfied the wait, or WaitTimeout if any of the work items has been canceled. - - - - - Waits for any of the work items in the specified array to complete, cancel, or timeout - - Array of work item result objects - The number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - - The array index of the work item result that satisfied the wait, or WaitTimeout if no work item result satisfied the wait and a time interval equivalent to millisecondsTimeout has passed or the work item has been canceled. - - - - - Waits for any of the work items in the specified array to complete, cancel, or timeout - - Array of work item result objects - The number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the wait if needed - - The array index of the work item result that satisfied the wait, or WaitTimeout if no work item result satisfied the wait and a time interval equivalent to millisecondsTimeout has passed or the work item has been canceled. - - - - - Waits for any of the work items in the specified array to complete, cancel, or timeout - - Array of work item result objects - The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - - The array index of the work item result that satisfied the wait, or WaitTimeout if no work item result satisfied the wait and a time interval equivalent to millisecondsTimeout has passed or the work item has been canceled. - - - - - Waits for any of the work items in the specified array to complete, cancel, or timeout - - Array of work item result objects - The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the wait if needed - - The array index of the work item result that satisfied the wait, or WaitTimeout if no work item result satisfied the wait and a time interval equivalent to millisecondsTimeout has passed or the work item has been canceled. - - - - - Creates a new WorkItemsGroup. - - The number of work items that can be run concurrently - A reference to the WorkItemsGroup - - - - Creates a new WorkItemsGroup. - - The number of work items that can be run concurrently - A WorkItemsGroup configuration that overrides the default behavior - A reference to the WorkItemsGroup - - - - Checks if the work item has been cancelled, and if yes then abort the thread. - Can be used with Cancel and timeout - - - - - Get an array with all the state objects of the currently running items. - The array represents a snap shot and impact performance. - - - - - Start the thread pool if it was started suspended. - If it is already running, this method is ignored. - - - - - Cancel all work items using thread abortion - - True to stop work items by raising ThreadAbortException - - - - Wait for the thread pool to be idle - - - - - Executes all actions in parallel. - Returns when they all finish. - - Actions to execute - - - - Executes all actions in parallel. - Returns when they all finish. - - Actions to execute - - - - Executes all actions in parallel - Returns when the first one completes - - Actions to execute - - - - Executes all actions in parallel - Returns when the first one completes - - Actions to execute - - - - Executes actions in sequence asynchronously. - Returns immediately. - - A state context that passes - Actions to execute in the order they should run - - - - Executes actions in sequence asynchronously. - Returns immediately. - - - Actions to execute in the order they should run - - - - An event to call after a thread is created, but before - it's first use. - - - - - An event to call when a thread is about to exit, after - it is no longer belong to the pool. - - - - - A reference to the current work item a thread from the thread pool - is executing. - - - - - This event is fired when a thread is created. - Use it to initialize a thread before the work items use it. - - - - - This event is fired when a thread is terminating. - Use it for cleanup. - - - - - Get/Set the lower limit of threads in the pool. - - - - - Get/Set the upper limit of threads in the pool. - - - - - Get the number of threads in the thread pool. - Should be between the lower and the upper limits. - - - - - Get the number of busy (not idle) threads in the thread pool. - - - - - Returns true if the current running work item has been cancelled. - Must be used within the work item's callback method. - The work item should sample this value in order to know if it - needs to quit before its completion. - - - - - Thread Pool start information (readonly) - - - - - Return the local calculated performance counters - Available only if STPStartInfo.EnableLocalPerformanceCounters is true. - - - - - Get/Set the maximum number of work items that execute cocurrency on the thread pool - - - - - Get the number of work items in the queue. - - - - - WorkItemsGroup start information (readonly) - - - - - This event is fired when all work items are completed. - (When IsIdle changes to true) - This event only work on WorkItemsGroup. On SmartThreadPool - it throws the NotImplementedException. - - - - - The thread creation time - The value is stored as UTC value. - - - - - The last time this thread has been running - It is updated by IAmAlive() method - The value is stored as UTC value. - - - - - A reference from each thread in the thread pool to its SmartThreadPool - object container. - With this variable a thread can know whatever it belongs to a - SmartThreadPool. - - - - - A reference to the current work item a thread from the thread pool - is executing. - - - - - Summary description for STPPerformanceCounter. - - - - - Summary description for STPStartInfo. - - - - - Summary description for WIGStartInfo. - - - - - Get a readonly version of this WIGStartInfo - - Returns a readonly reference to this WIGStartInfoRO - - - - Get/Set if to use the caller's security context - - - - - Get/Set if to use the caller's HTTP context - - - - - Get/Set if to dispose of the state object of a work item - - - - - Get/Set the run the post execute options - - - - - Get/Set the default post execute callback - - - - - Get/Set if the work items execution should be suspended until the Start() - method is called. - - - - - Get/Set the default priority that a work item gets when it is enqueued - - - - - Get/Set the if QueueWorkItem of Action<...>/Func<...> fill the - arguments as an object array into the state of the work item. - The arguments can be access later by IWorkItemResult.State. - - - - - Get a readonly version of this STPStartInfo. - - Returns a readonly reference to this STPStartInfo - - - - Get/Set the idle timeout in milliseconds. - If a thread is idle (starved) longer than IdleTimeout then it may quit. - - - - - Get/Set the lower limit of threads in the pool. - - - - - Get/Set the upper limit of threads in the pool. - - - - - Get/Set the scheduling priority of the threads in the pool. - The Os handles the scheduling. - - - - - Get/Set the thread pool name. Threads will get names depending on this. - - - - - Get/Set the performance counter instance name of this SmartThreadPool - The default is null which indicate not to use performance counters at all. - - - - - Enable/Disable the local performance counter. - This enables the user to get some performance information about the SmartThreadPool - without using Windows performance counters. (Useful on WindowsCE, Silverlight, etc.) - The default is false. - - - - - Get/Set backgroundness of thread in thread pool. - - - - - Get/Set the apartment state of threads in the thread pool - - - - - Get/Set the max stack size of threads in the thread pool - - - - - Holds a callback delegate and the state for that delegate. - - - - - Callback delegate for the callback. - - - - - State with which to call the callback delegate. - - - - - Stores the caller's context - - - - - Holds the result of the mehtod - - - - - Hold the exception if the method threw it - - - - - Hold the state of the work item - - - - - A ManualResetEvent to indicate that the result is ready - - - - - A reference count to the _workItemCompleted. - When it reaches to zero _workItemCompleted is Closed - - - - - Represents the result state of the work item - - - - - Work item info - - - - - A reference to an object that indicates whatever the - WorkItemsGroup has been canceled - - - - - A reference to an object that indicates whatever the - SmartThreadPool has been canceled - - - - - The work item group this work item belong to. - - - - - The thread that executes this workitem. - This field is available for the period when the work item is executed, before and after it is null. - - - - - The absulote time when the work item will be timeout - - - - - Stores how long the work item waited on the stp queue - - - - - Stores how much time it took the work item to execute after it went out of the queue - - - - - Initialize the callback holding object. - - The workItemGroup of the workitem - The WorkItemInfo of te workitem - Callback delegate for the callback. - State with which to call the callback delegate. - - We assume that the WorkItem object is created within the thread - that meant to run the callback - - - - Change the state of the work item to in progress if it wasn't canceled. - - - Return true on success or false in case the work item was canceled. - If the work item needs to run a post execute then the method will return true. - - - - - Execute the work item and the post execute - - - - - Execute the work item - - - - - Runs the post execute callback - - - - - Set the result of the work item to return - - The result of the work item - The exception that was throw while the workitem executed, null - if there was no exception. - - - - Returns the work item result - - The work item result - - - - Wait for all work items to complete - - Array of work item result objects - The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the wait if needed - - true when every work item in waitableResults has completed; otherwise false. - - - - - Waits for any of the work items in the specified array to complete, cancel, or timeout - - Array of work item result objects - The number of milliseconds to wait, or Timeout.Infinite (-1) to wait indefinitely. - - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it; otherwise, false. - - A cancel wait handle to interrupt the wait if needed - - The array index of the work item result that satisfied the wait, or WaitTimeout if no work item result satisfied the wait and a time interval equivalent to millisecondsTimeout has passed or the work item has been canceled. - - - - - Fill an array of wait handles with the work items wait handles. - - An array of work item results - An array of wait handles to fill - - - - Release the work items' wait handles - - An array of work item results - - - - Sets the work item's state - - The state to set the work item to - - - - Signals that work item has been completed or canceled - - Indicates that the work item has been canceled - - - - Cancel the work item if it didn't start running yet. - - Returns true on success or false if the work item is in progress or already completed - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits for the result, timeout, or cancel. - In case of error the method throws and exception - - The result of the work item - - - - Get the result of the work item. - If the work item didn't run yet then the caller waits for the result, timeout, or cancel. - In case of error the e argument is filled with the exception - - The result of the work item - - - - A wait handle to wait for completion, cancel, or timeout - - - - - Called when the WorkItem starts - - - - - Called when the WorkItem completes - - - - - Returns true when the work item has completed or canceled - - - - - Returns true when the work item has canceled - - - - - Returns the priority of the work item - - - - - Indicates the state of the work item in the thread pool - - - - - A back reference to the work item - - - - - Return the result, same as GetResult() - - - - - Returns the exception if occured otherwise returns null. - This value is valid only after the work item completed, - before that it is always null. - - - - - Create a new work item - - The WorkItemsGroup of this workitem - Work item group start information - A callback to execute - Returns a work item - - - - Create a new work item - - The WorkItemsGroup of this workitem - Work item group start information - A callback to execute - The priority of the work item - Returns a work item - - - - Create a new work item - - The WorkItemsGroup of this workitem - Work item group start information - Work item info - A callback to execute - Returns a work item - - - - Create a new work item - - The WorkItemsGroup of this workitem - Work item group start information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - Returns a work item - - - - Create a new work item - - The work items group - Work item group start information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - The work item priority - Returns a work item - - - - Create a new work item - - The work items group - Work item group start information - Work item information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - Returns a work item - - - - Create a new work item - - The work items group - Work item group start information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Returns a work item - - - - Create a new work item - - The work items group - Work item group start information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - The work item priority - Returns a work item - - - - Create a new work item - - The work items group - Work item group start information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Indicates on which cases to call to the post execute callback - Returns a work item - - - - Create a new work item - - The work items group - Work item group start information - A callback to execute - - The context object of the work item. Used for passing arguments to the work item. - - - A delegate to call after the callback completion - - Indicates on which cases to call to the post execute callback - The work item priority - Returns a work item - - - - Summary description for WorkItemInfo. - - - - - Get/Set if to use the caller's security context - - - - - Get/Set if to use the caller's HTTP context - - - - - Get/Set if to dispose of the state object of a work item - - - - - Get/Set the run the post execute options - - - - - Get/Set the post execute callback - - - - - Get/Set the work item's priority - - - - - Get/Set the work item's timout in milliseconds. - This is a passive timout. When the timout expires the work item won't be actively aborted! - - - - - Summary description for WorkItemsGroup. - - - - - A reference to the SmartThreadPool instance that created this - WorkItemsGroup. - - - - - A flag to indicate if the Work Items Group is now suspended. - - - - - Defines how many work items of this WorkItemsGroup can run at once. - - - - - Priority queue to hold work items before they are passed - to the SmartThreadPool. - - - - - Indicate how many work items are waiting in the SmartThreadPool - queue. - This value is used to apply the concurrency. - - - - - Indicate how many work items are currently running in the SmartThreadPool. - This value is used with the Cancel, to calculate if we can send new - work items to the STP. - - - - - WorkItemsGroup start information - - - - - Signaled when all of the WorkItemsGroup's work item completed. - - - - - A common object for all the work items that this work items group - generate so we can mark them to cancel in O(1) - - - - - Start the Work Items Group if it was started suspended - - - - - Wait for the thread pool to be idle - - - - - The OnIdle event - - - - - WorkItemsGroup start information - - - - - WorkItemsQueue class. - - - - - Waiters queue (implemented as stack). - - - - - Waiters count - - - - - Work items queue - - - - - Indicate that work items are allowed to be queued - - - - - A flag that indicates if the WorkItemsQueue has been disposed. - - - - - Enqueue a work item to the queue. - - - - - Waits for a work item or exits on timeout or cancel - - Timeout in milliseconds - Cancel wait handle - Returns true if the resource was granted - - - - Cleanup the work items queue, hence no more work - items are allowed to be queue - - - - - Returns the WaiterEntry of the current thread - - - In order to avoid creation and destuction of WaiterEntry - objects each thread has its own WaiterEntry object. - - - - Push a new waiter into the waiter's stack - - A waiter to put in the stack - - - - Pop a waiter from the waiter's stack - - Returns the first waiter in the stack - - - - Remove a waiter from the stack - - A waiter entry to remove - If true the waiter count is always decremented - - - - Each thread in the thread pool keeps its own waiter entry. - - - - - Returns the current number of work items in the queue - - - - - Returns the current number of waiters - - - - - Event to signal the waiter that it got the work item. - - - - - Flag to know if this waiter already quited from the queue - because of a timeout. - - - - - Flag to know if the waiter was signaled and got a work item. - - - - - A work item that passed directly to the waiter withou going - through the queue - - - - - Signal the waiter that it got a work item. - - Return true on success - The method fails if Timeout() preceded its call - - - - Mark the wait entry that it has been timed out - - Return true on success - The method fails if Signal() preceded its call - - - - Reset the wait entry so it can be used again - - - - - Free resources - - - - - Respond with a 'Soft redirect' so smart clients (e.g. ajax) have access to the response and - can decide whether or not they should redirect - - - - - Decorate the response with an additional client-side event to instruct participating - smart clients (e.g. ajax) with hints to transparently invoke client-side functionality - - - - - Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult - - - - - - - Alias of AsDto - - - - - Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult - - - TResponse if found; otherwise null - - - - Alias of AsDto - - - - - Whether the response is an IHttpError or Exception - - - - - rangeHeader should be of the format "bytes=0-" or "bytes=0-12345" or "bytes=123-456" - - - - - Adds 206 PartialContent Status, Content-Range and Content-Length headers - - - - - Writes partial range as specified by start-end, from fromStream to toStream. - - - - - Service error logs are kept in 'urn:ServiceErrors:{ServiceName}' - - - - - Combined service error logs are maintained in 'urn:ServiceErrors:All' - - - - - RequestLogs service Route, default is /requestlogs - - - - - Turn On/Off Session Tracking - - - - - Turn On/Off Logging of Raw Request Body, default is Off - - - - - Turn On/Off Tracking of Responses - - - - - Turn On/Off Tracking of Exceptions - - - - - Size of InMemoryRollingRequestLogger circular buffer - - - - - Limit access to /requestlogs service to these roles - - - - - Change the RequestLogger provider. Default is InMemoryRollingRequestLogger - - - - - Don't log requests of these types. By default RequestLog's are excluded - - - - - Don't log request bodys for services with sensitive information. - By default Auth and Registration requests are hidden. - - - - - Indicates that the request dto, which is associated with this attribute, - requires authentication. - - - - - Restrict authentication to a specific . - For example, if this attribute should only permit access - if the user is authenticated with , - you should set this property to . - - - - - Redirect the client to a specific URL if authentication failed. - If this property is null, simply `401 Unauthorized` is returned. - - - - - Enable the authentication feature and configure the AuthService. - - - - - Inject logic into existing services by introspecting the request and injecting your own - validation logic. Exceptions thrown will have the same behaviour as if the service threw it. - - If a non-null object is returned the request will short-circuit and return that response. - - The instance of the service - GET,POST,PUT,DELETE - - Response DTO; non-null will short-circuit execution and return that response - - - - Public API entry point to authenticate via code - - - null; if already autenticated otherwise a populated instance of AuthResponse - - - - The specified may change as a side-effect of this method. If - subsequent code relies on current data be sure to reload - the session istance via . - - - - - Base class for entity validator classes. - - The type of the object being validated - - - - Defines a validator for a particualr type. - - - - - - Defines a validator for a particular type. - - - - - Validates the specified instance - - - A ValidationResult containing any validation failures - - - - Validates the specified instance. - - A ValidationContext - A ValidationResult object containy any validation failures. - - - - Creates a hook to access various meta data properties - - A IValidatorDescriptor object which contains methods to access metadata - - - - Checks to see whether the validator can validate objects of the specified type - - - - - Validates the specified instance. - - The instance to validate - A ValidationResult object containing any validation failures. - - - - Sets the cascade mode for all rules within this validator. - - - - - Validates the specified instance - - The object to validate - A ValidationResult object containing any validation failures - - - - Validates the specified instance. - - Validation Context - A ValidationResult object containing any validation failures. - - - - Adds a rule to the current validator. - - - - - - Creates a that can be used to obtain metadata about the current validator. - - - - - Defines a validation rule for a specify property. - - - RuleFor(x => x.Surname)... - - The type of property being validated - The expression representing the property to validate - an IRuleBuilder instance on which validators can be defined - - - - Defines a custom validation rule using a lambda expression. - If the validation rule fails, it should return a instance of a ValidationFailure - If the validation rule succeeds, it should return null. - - A lambda that executes custom validation rules. - - - - Defines a custom validation rule using a lambda expression. - If the validation rule fails, it should return an instance of ValidationFailure - If the validation rule succeeds, it should return null. - - A lambda that executes custom validation rules - - - - Defines a RuleSet that can be used to group together several validators. - - The name of the ruleset. - Action that encapsulates the rules in the ruleset. - - - - Defines a RuleSet that can be used to provide specific validation rules for specific HTTP methods (GET, POST...) - - The HTTP methods where this rule set should be used. - Action that encapuslates the rules in the ruleset. - - - - Defines a condition that applies to several rules - - The condition that should apply to multiple rules - Action that encapsulates the rules. - - - - - Defiles an inverse condition that applies to several rules - - The condition that should be applied to multiple rules - Action that encapsulates the rules - - - - Returns an enumerator that iterates through the collection of validation rules. - - - A that can be used to iterate through the collection. - - 1 - - - - Sets the cascade mode for all rules within this validator. - - - - - Create a Facebook App at: https://developers.facebook.com/apps - The Callback URL for your app should match the CallbackUrl provided. - - - - - Download Yammer User Info given its ID. - - - The Yammer User ID. - - - The User info in JSON format. - - - - Yammer provides a method to retrieve current user information via - "https://www.yammer.com/api/v1/users/current.json". - - - However, to ensure consistency with the rest of the Auth codebase, - the explicit URL will be used, where [:id] denotes the User ID: - "https://www.yammer.com/api/v1/users/[:id].json" - - - Refer to: https://developer.yammer.com/restapi/ for full documentation. - - - - - - Thread-safe In memory UserAuth data store so it can be used without a dependency on Redis. - - - - - Update an existing registraiton - - - - - Create new Registration - - - - - Logic to update UserAuth from Registration info, not enabled on PUT because of security. - - - - - Thank you Martijn - http://www.dijksterhuis.org/creating-salted-hash-values-in-c/ - - Stronger/Slower Alternative: - https://github.com/defuse/password-hashing/blob/master/PasswordStorage.cs - - - - - Create an app at https://dev.twitter.com/apps to get your ConsumerKey and ConsumerSecret for your app. - The Callback URL for your app should match the CallbackUrl provided. - - - - - The ServiceStack Yammer OAuth provider. - - - - This provider is loosely based on the existing ServiceStack's Facebook OAuth provider. - - - For the full info on Yammer's OAuth2 authentication flow, refer to: - https://developer.yammer.com/authentication/#a-oauth2 - - - Note: Add these to your application / web config settings under appSettings and replace - values as appropriate. - - - - - - - - - ]]> - - - - - - The OAuth provider name / identifier. - - - - - Initializes a new instance of the class. - - - The application settings (in web.config). - - - - - Authenticate against Yammer OAuth endpoint. - - - The auth service. - - - The session. - - - The request. - - - The . - - - - - Load the UserAuth info into the session. - - - The User session. - - - The OAuth tokens. - - - The auth info. - - - - - Load the UserOAuth info into the session. - - - The auth session. - - - The OAuth tokens. - - - - - Gets or sets the Yammer OAuth client id. - - - - - Gets or sets the Yammer OAuth client secret. - - - - - Gets or sets the Yammer OAuth pre-auth url. - - - - - The Yammer User's email addresses. - - - - - Gets or sets the email address type (e.g. primary). - - - - - Gets or sets the email address. - - - - - Removes items from cache that have keys matching the specified wildcard pattern - - Cache client - The wildcard, where "*" means any sequence of characters and "?" means any single character. - - - - Removes items from the cache based on the specified regular expression pattern - - Cache client - Regular expression pattern to search cache keys - - - - Stores The value with key only if such key doesn't exist at the server yet. - - - - - Adds or replaces the value with key. - - - - - Adds or replaces the value with key. - - - - - Replace the value with specified key if it exists. - - - - - Add the value with key to the cache, set to never expire. - - - - - Add or replace the value with key to the cache, set to never expire. - - - - - Replace the value with key in the cache, set to never expire. - - - - - Add the value with key to the cache, set to expire at specified DateTime. - - This method examines the DateTimeKind of expiresAt to determine if conversion to - universal time is needed. The version of Add that takes a TimeSpan expiration is faster - than using this method with a DateTime of Kind other than Utc, and is not affected by - ambiguous local time during daylight savings/standard time transition. - - - - Add or replace the value with key to the cache, set to expire at specified DateTime. - - This method examines the DateTimeKind of expiresAt to determine if conversion to - universal time is needed. The version of Set that takes a TimeSpan expiration is faster - than using this method with a DateTime of Kind other than Utc, and is not affected by - ambiguous local time during daylight savings/standard time transition. - - - - Replace the value with key in the cache, set to expire at specified DateTime. - - This method examines the DateTimeKind of expiresAt to determine if conversion to - universal time is needed. The version of Replace that takes a TimeSpan expiration is faster - than using this method with a DateTime of Kind other than Utc, and is not affected by - ambiguous local time during daylight savings/standard time transition. - - - - Add the value with key to the cache, set to expire after specified TimeSpan. - - - - - Add or replace the value with key to the cache, set to expire after specified TimeSpan. - - - - - Replace the value with key in the cache, set to expire after specified TimeSpan. - - - - - Create new instance of CacheEntry. - - - - UTC time at which CacheEntry expires. - - - - Would've preferred to use [assembly: ContractNamespace] attribute but it is not supported in Mono - - - - - More familiar name for the new crowd. - - - - - The tier lets you specify a retrieving a setting with the tier prefix first before falling back to the original key. - E.g a tier of 'Live' looks for 'Live.{Key}' or if not found falls back to '{Key}'. - - - - - Returns string if exists, otherwise null - - - - - - - Gets the nullable app setting. - - - - - Gets the app setting. - - - - - Determines wheter the Config section identified by the sectionName exists. - - - - - Returns AppSetting[key] if exists otherwise defaultValue - - - - - Returns AppSetting[key] if exists otherwise defaultValue, for non-string values - - - - - Gets the connection string setting. - - - - - Gets the connection string. - - - - - Gets the list from app setting. - - - - - Gets the dictionary from app setting. - - - - - Get the static Parse(string) method on the type supplied - - - - - Gets the constructor info for T(string) if exists. - - - - - Returns the value returned by the 'T.Parse(string)' method if exists otherwise 'new T(string)'. - e.g. if T was a TimeSpan it will return TimeSpan.Parse(textValue). - If there is no Parse Method it will attempt to create a new instance of the destined type - - - - - Plugin adds support for Cross-origin resource sharing (CORS, see http://www.w3.org/TR/access-control/). - CORS allows to access resources from different domain which usually forbidden by origin policy. - - - - - Represents a default constructor with Allow Origin equals to "*", Allowed GET, POST, PUT, DELETE, OPTIONS request and allowed "Content-Type" header. - - - - - Attribute marks that specific response class has support for Cross-origin resource sharing (CORS, see http://www.w3.org/TR/access-control/). CORS allows to access resources from different domain which usually forbidden by origin policy. - - - - - Represents a default constructor with Allow Origin equals to "*", Allowed GET, POST, PUT, DELETE, OPTIONS request and allowed "Content-Type" header. - - - - - Change the default HTML view or template used for the HTML response of this service - - - - - Class that can be used to find all the validators from a collection of types. - - - - - Creates a scanner that works on a sequence of types. - - - - - Finds all the validators in the specified assembly. - - - - - Finds all the validators in the assembly containing the specified type. - - - - - Performs the specified action to all of the assembly scan results. - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - 1 - - - - Result of performing a scan. - - - - - Creates an instance of an AssemblyScanResult. - - - - - Validator interface type, eg IValidator<Foo> - - - - - Concrete type that implements the InterfaceType, eg FooValidator. - - - - - Implementation of IValidatorFactory that looks for ValidatorAttribute instances on the specified type in order to provide the validator instance. - - - - - Gets validators for a particular type. - - - - - Gets the validator for the specified type. - - - - - Gets the validator for the specified type. - - - - - Gets a validator for the appropriate type. - - - - - Gets a validator for the appropriate type. - - - - - Validator attribute to define the class that will describe the Validation rules - - - - - Creates an instance of the ValidatorAttribute allowing a validator type to be specified. - - - - - The type of the validator used to validate the current type. - - - - - Associates an instance of IValidator with the current property rule and is used to validate each item within the collection. - - The validator to use - - - - Rule builder - - - - - - - Rule builder - - - - - - - Associates a validator with this the property for this rule builder. - - The validator to set - - - - - Associates an instance of IValidator with the current property rule. - - The validator to use - - - - Represents an object that is configurable. - - Type of object being configured - Return type - - - - Configures the current object. - - Action to configure the object. - - - - - Extension methods that provide the default set of validators. - - - - - Defines a 'not null' validator on the current rule builder. - Validation will fail if the property is null. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - - - - - Defines a 'not empty' validator on the current rule builder. - Validation will fail if the property is null, an empty or the default value for the type (for example, 0 for integers) - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - - - - - Defines a length validator on the current rule builder, but only for string properties. - Validation will fail if the length of the string is outside of the specifed range. The range is inclusive. - - Type of object being validated - The rule builder on which the validator should be defined - - - - - Defines a length validator on the current rule builder, but only for string properties. - Validation will fail if the length of the string is not equal to the length specified. - - Type of object being validated - The rule builder on which the validator should be defined - - - - - Defines a regular expression validator on the current rule builder, but only for string properties. - Validation will fail if the value returned by the lambda does not match the regular expression. - - Type of object being validated - The rule builder on which the validator should be defined - The regular expression to check the value against. - - - - - Defines a regular expression validator on the current rule builder, but only for string properties. - Validation will fail if the value returned by the lambda is not a valid email address. - - Type of object being validated - The rule builder on which the validator should be defined - - - - - Defines a 'not equal' validator on the current rule builder. - Validation will fail if the specified value is equal to the value of the property. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value to compare - Equality comparer to use - - - - - Defines a 'not equal' validator on the current rule builder using a lambda to specify the value. - Validation will fail if the value returned by the lambda is equal to the value of the property. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - A lambda expression to provide the comparison value - Equality Comparer to use - - - - - Defines an 'equals' validator on the current rule builder. - Validation will fail if the specified value is not equal to the value of the property. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value to compare - Equality Comparer to use - - - - - Defines an 'equals' validator on the current rule builder using a lambda to specify the comparison value. - Validation will fail if the value returned by the lambda is not equal to the value of the property. - - The type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - A lambda expression to provide the comparison value - Equality comparer to use - - - - - Defines a predicate validator on the current rule builder using a lambda expression to specify the predicate. - Validation will fail if the specified lambda returns false. - Validation will succeed if the specifed lambda returns true. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - A lambda expression specifying the predicate - - - - - Defines a predicate validator on the current rule builder using a lambda expression to specify the predicate. - Validation will fail if the specified lambda returns false. - Validation will succeed if the specifed lambda returns true. - This overload accepts the object being validated in addition to the property being validated. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - A lambda expression specifying the predicate - - - - - Defines a predicate validator on the current rule builder using a lambda expression to specify the predicate. - Validation will fail if the specified lambda returns false. - Validation will succeed if the specifed lambda returns true. - This overload accepts the object being validated in addition to the property being validated. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - A lambda expression specifying the predicate - - - - - Defines a 'less than' validator on the current rule builder. - The validation will succeed if the property value is less than the specified value. - The validation will fail if the property value is greater than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than' validator on the current rule builder. - The validation will succeed if the property value is less than the specified value. - The validation will fail if the property value is greater than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than or equal' validator on the current rule builder. - The validation will succeed if the property value is less than or equal to the specified value. - The validation will fail if the property value is greater than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than or equal' validator on the current rule builder. - The validation will succeed if the property value is less than or equal to the specified value. - The validation will fail if the property value is greater than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'greater than' validator on the current rule builder. - The validation will succeed if the property value is greater than the specified value. - The validation will fail if the property value is less than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'greater than' validator on the current rule builder. - The validation will succeed if the property value is greater than the specified value. - The validation will fail if the property value is less than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'greater than or equal' validator on the current rule builder. - The validation will succeed if the property value is greater than or equal the specified value. - The validation will fail if the property value is less than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'greater than or equal' validator on the current rule builder. - The validation will succeed if the property value is greater than or equal the specified value. - The validation will fail if the property value is less than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is less than the specified value. - The validation will fail if the property value is greater than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - A lambda that should return the value being compared - - - - - Defines a 'less than' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is less than the specified value. - The validation will fail if the property value is greater than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - A lambda that should return the value being compared - - - - - Defines a 'less than or equal' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is less than or equal to the specified value. - The validation will fail if the property value is greater than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than or equal' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is less than or equal to the specified value. - The validation will fail if the property value is greater than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is greater than the specified value. - The validation will fail if the property value is less than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is greater than the specified value. - The validation will fail if the property value is less than or equal to the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is greater than or equal the specified value. - The validation will fail if the property value is less than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Defines a 'less than' validator on the current rule builder using a lambda expression. - The validation will succeed if the property value is greater than or equal the specified value. - The validation will fail if the property value is less than the specified value. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The value being compared - - - - - Validates certain properties of the specified instance. - - The current validator - The object to validate - Expressions to specify the properties to validate - A ValidationResult object containing any validation failures - - - - Validates certain properties of the specified instance. - - The object to validate - The names of the properties to validate. - A ValidationResult object containing any validation failures. - - - - Performs validation and then throws an exception if validation fails. - - - - - Defines an 'inclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. - Validation will fail if the value of the property is outside of the specifed range. The range is inclusive. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The lowest allowed value - The highest allowed value - - - - - Defines an 'inclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. - Validation will fail if the value of the property is outside of the specifed range. The range is inclusive. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The lowest allowed value - The highest allowed value - - - - - Defines an 'exclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. - Validation will fail if the value of the property is outside of the specifed range. The range is exclusive. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The lowest allowed value - The highest allowed value - - - - - Defines an 'exclusive between' validator on the current rule builder, but only for properties of types that implement IComparable. - Validation will fail if the value of the property is outside of the specifed range. The range is exclusive. - - Type of object being validated - Type of property being validated - The rule builder on which the validator should be defined - The lowest allowed value - The highest allowed value - - - - - Defines a credit card validator for the current rule builder that ensures that the specified string is a valid credit card number. - - - - - Default options that can be used to configure a validator. - - - - - Specifies the cascade mode for failures. - If set to 'Stop' then execution of the rule will stop once the first validator in the chain fails. - If set to 'Continue' then all validators in the chain will execute regardless of failures. - - - - - Specifies a custom action to be invoked when the validator fails. - - - - - - - - - - Specifies a custom error message to use if validation fails. - - The current rule - The error message to use - - - - - Specifies a custom error message to use if validation fails. - - The current rule - The error message to use - Additional arguments to be specified when formatting the custom error message. - - - - - Specifies a custom error message to use if validation fails. - - The current rule - The error message to use - Additional property values to be included when formatting the custom error message. - - - - - Specifies a custom error message resource to use when validation fails. - - The current rule - The resource to use as an expression, eg () => Messages.MyResource - - - - - Specifies a custom error message resource to use when validation fails. - - The current rule - The resource to use as an expression, eg () => Messages.MyResource - Custom message format args - - - - - Specifies a custom error message resource to use when validation fails. - - The current rule - The resource to use as an expression, eg () => Messages.MyResource - Custom message format args - - - - - Specifies a custom error message resource to use when validation fails. - - The current rule - The resource to use as an expression, eg () => Messages.MyResource - The resource accessor builder to use. - - - - - Specifies a custom error code to use when validation fails - - The current rule - The error code to use - - - - - Specifies a condition limiting when the validator should run. - The validator will only be executed if the result of the lambda returns true. - - The current rule - A lambda expression that specifies a condition for when the validator should run - Whether the condition should be applied to the current rule or all rules in the chain - - - - - Specifies a condition limiting when the validator should not run. - The validator will only be executed if the result of the lambda returns false. - - The current rule - A lambda expression that specifies a condition for when the validator should not run - Whether the condition should be applied to the current rule or all rules in the chain - - - - - Specifies a custom property name to use within the error message. - - The current rule - The property name to use - - - - - Specifies a localized name for the error message. - - The current rule - The resource to use as an expression, eg () => Messages.MyResource - Resource accessor builder to use - - - - Overrides the name of the property associated with this rule. - NOTE: This is a considered to be an advanced feature. 99% of the time that you use this, you actually meant to use WithName. - - The current rule - The property name to use - - - - - Specifies custom state that should be stored alongside the validation message when validation fails for this rule. - - - - - - - - - - Specifies how rules should cascade when one fails. - - - - - When a rule fails, execution continues to the next rule. - - - - - When a rule fails, validation is stopped and all other rules in the chain will not be executed. - - - - - Specifies where a When/Unless condition should be applied - - - - - Applies the condition to all validators declared so far in the chain. - - - - - Applies the condition to the current validator only. - - - - - Validator implementation that allows rules to be defined without inheriting from AbstractValidator. - - - - public class Customer { - public int Id { get; set; } - public string Name { get; set; } - - public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> { - v => v.RuleFor(x => x.Name).NotNull(), - v => v.RuleFor(x => x.Id).NotEqual(0), - } - } - - - - - - - Allows configuration of the validator. - - - - - Delegate that specifies configuring an InlineValidator. - - - - - Default validator selector that will execute all rules that do not belong to a RuleSet. - - - - - Determines whether or not a rule should execute. - - - - - Determines whether or not a rule should execute. - - The rule - Property path (eg Customer.Address.Line1) - Contextual information - Whether or not the validator can execute. - - - - Determines whether or not a rule should execute. - - The rule - Property path (eg Customer.Address.Line1) - Contextual information - Whether or not the validator can execute. - - - - Custom IValidationRule for performing custom logic. - - - - - - Creates a new DelegateValidator using the specified function to perform validation. - - - - - Creates a new DelegateValidator using the specified function to perform validation. - - - - - Performs validation using a validation context and returns a collection of Validation Failures. - - Validation Context - A collection of validation failures - - - - Performs validation using a validation context and returns a collection of Validation Failures. - - Validation Context - A collection of validation failures - - - - Rule set to which this rule belongs. - - - - - The validators that are grouped under this rule. - - - - - Useful extensions - - - - - Gets a MemberInfo from a member expression. - - - - - Gets a MemberInfo from a member expression. - - - - - Splits pascal case, so "FooBar" would become "Foo Bar" - - - - - Helper method to construct a constant expression from a constant. - - Type of object being validated - Type of property being validated - The value being compared - - - - - Based on a child validator and a propery rule, infers whether the validator should be wrapped in a ChildValidatorAdaptor or a CollectionValidatorAdaptor - - - - - Instancace cache. - TODO: This isn't actually completely thread safe. It would be much better to use ConcurrentDictionary, but this isn't available in Silverlight/WP7. - - - - - Gets or creates an instance using Activator.CreateInstance - - The type to instantiate - The instantiated object - - - - Gets or creates an instance using a custom factory - - The type to instantiate - The custom factory - The instantiated object - - - - Selects validators that are associated with a particular property. - - - - - Creates a new instance of MemberNameValidatorSelector. - - - - - Determines whether or not a rule should execute. - - The rule - Property path (eg Customer.Address.Line1) - Contextual information - Whether or not the validator can execute. - - - - Creates a MemberNameValidatorSelector from a collection of expressions. - - - - - Assists in the construction of validation messages. - - - - - Default Property Name placeholder. - - - - - Adds a value for a validation message placeholder. - - - - - - - - Appends a property name to the message. - - The name of the property - - - - - Adds additional arguments to the message for use with standard string placeholders. - - Additional arguments - - - - - Constructs the final message from the specified template. - - Message template - The message with placeholders replaced with their appropriate values - - - - Represents a chain of properties - - - - - Creates a new PropertyChain. - - - - - Creates a new PropertyChain based on another. - - - - - Adds a MemberInfo instance to the chain - - Member to add - - - - Adds a property name to the chain - - Name of the property to add - - - - Adds an indexer to the property chain. For example, if the following chain has been constructed: - Parent.Child - then calling AddIndexer(0) would convert this to: - Parent.Child[0] - - - - - - Creates a string representation of a property chain. - - - - - Checks if the current chain is the child of another chain. - For example, if chain1 were for "Parent.Child" and chain2 were for "Parent.Child.GrandChild" then - chain2.IsChildChainOf(chain1) would be true. - - The parent chain to compare - True if the current chain is the child of the other chain, otherwise false - - - - Builds a property path. - - - - - Builds a validation rule and constructs a validator. - - Type of object being validated - Type of property being validated - - - - Rule builder that starts the chain - - - - - - - Creates a new instance of the RuleBuilder class. - - - - - Sets the validator associated with the rule. - - The validator to set - - - - - Sets the validator associated with the rule. Use with complex properties where an IValidator instance is already declared for the property type. - - The validator to set - - - - The rule being created by this RuleBuilder. - - - - - Selects validators that belong to the specified rulesets. - - - - - Creates a new instance of the RulesetValidatorSelector. - - - - - Determines whether or not a rule should execute. - - The rule - Property path (eg Customer.Address.Line1) - Contextual information - Whether or not the validator can execute. - - - - Provides metadata about a validator. - - - - - Gets the name display name for a property. - - - - - Gets a collection of validators grouped by property. - - - - - Gets validators for a particular property. - - - - - Gets rules for a property. - - - - - Builds a delegate for retrieving a localised resource from a resource type and property name. - - - - - Gets a function that can be used to retrieve a message from a resource type and resource name. - - - - - Builds a delegate for retrieving a localised resource from a resource type and property name. - - - - - Builds a function used to retrieve the resource. - - - - - Gets the PropertyInfo for a resource. - ResourceType and ResourceName are ref parameters to allow derived types - to replace the type/name of the resource before the delegate is constructed. - - - - - Implemenetation of IResourceAccessorBuilder that can fall back to the default resource provider. - - - - - Gets the PropertyInfo for a resource. - ResourceType and ResourceName are ref parameters to allow derived types - to replace the type/name of the resource before the delegate is constructed. - - - - - Provides error message templates - - - - - Construct the error message template - - Error message template - - - - The name of the resource if localized. - - - - - The type of the resource provider if localized. - - - - - Represents a localized string. - - - - - Creates a new instance of the LocalizedErrorMessageSource class using the specified resource name and resource type. - - The resource type - The resource name - Strategy used to construct the resource accessor - - - - Creates an IErrorMessageSource from an expression: () => MyResources.SomeResourceName - - The expression - Strategy used to construct the resource accessor - Error message source - - - - Construct the error message template - - Error message template - - - - The name of the resource if localized. - - - - - The type of the resource provider if localized. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to '{PropertyName}' is not a valid credit card number.. - - - - - Looks up a localized string similar to '{PropertyName}' is not a valid email address.. - - - - - Looks up a localized string similar to '{PropertyName}' should be equal to '{PropertyValue}'.. - - - - - Looks up a localized string similar to '{PropertyName}' must be {MaxLength} characters in length. You entered {TotalLength} characters.. - - - - - Looks up a localized string similar to '{PropertyName}' must be between {From} and {To} (exclusive). You entered {Value}.. - - - - - Looks up a localized string similar to '{PropertyName}' must be greater than '{ComparisonValue}'.. - - - - - Looks up a localized string similar to '{PropertyName}' must be greater than or equal to '{ComparisonValue}'.. - - - - - Looks up a localized string similar to '{PropertyName}' must be between {From} and {To}. You entered {Value}.. - - - - - Looks up a localized string similar to '{PropertyName}' must be between {MinLength} and {MaxLength} characters. You entered {TotalLength} characters.. - - - - - Looks up a localized string similar to '{PropertyName}' must be less than '{ComparisonValue}'.. - - - - - Looks up a localized string similar to '{PropertyName}' must be less than or equal to '{ComparisonValue}'.. - - - - - Looks up a localized string similar to '{PropertyName}' should not be empty.. - - - - - Looks up a localized string similar to '{PropertyName}' should not be equal to '{PropertyValue}'.. - - - - - Looks up a localized string similar to '{PropertyName}' must not be empty.. - - - - - Looks up a localized string similar to The specified condition was not met for '{PropertyName}'.. - - - - - Looks up a localized string similar to '{PropertyName}' is not in the correct format.. - - - - - Represents a static string. - - - - - Creates a new StringErrorMessageSource using the specified error message as the error template. - - The error message template. - - - - Construct the error message template - - Error message template - - - - The name of the resource if localized. - - - - - The type of the resource provider if localized. - - - - - Creates a new validation failure. - - - - - Creates a new ValidationFailure. - - - - - Creates a textual representation of the failure. - - - - - The name of the property. - - - - - The error message - - - - - The error code - - - - - The property value that caused the failure. - - - - - Custom state associated with the failure. - - - - - Placeholder values used for string substitution when building ErrorMessage - - - - - Used for providing metadata about a validator. - - - - - A custom property validator. - This interface should not be implemented directly in your code as it is subject to change. - Please inherit from PropertyValidator instead. - - - - - Creates an error validation result for this validator. - - The validator context - Returns an error validation result. - - - - Ensures that the property value is a valid credit card number. - - - - - Provides access to the anti-forgery system, which provides protection against - Cross-site Request Forgery (XSRF, also called CSRF) attacks. - - - - - Generates an anti-forgery token for this request. This token can - be validated by calling the Validate() method. - - An HTML string corresponding to an <input type="hidden"> - element. This element should be put inside a <form>. - - This method has a side effect: it may set a response cookie. - - - - - Generates an anti-forgery token pair (cookie and form token) for this request. - This method is similar to GetHtml(), but this method gives the caller control - over how to persist the returned values. To validate these tokens, call the - appropriate overload of Validate. - - The anti-forgery token - if any - that already existed - for this request. May be null. The anti-forgery system will try to reuse this cookie - value when generating a matching form token. - Will contain a new cookie value if the old cookie token - was null or invalid. If this value is non-null when the method completes, the caller - must persist this value in the form of a response cookie, and the existing cookie value - should be discarded. If this value is null when the method completes, the existing - cookie value was valid and needn't be modified. - The value that should be stored in the <form>. The caller - should take care not to accidentally swap the cookie and form tokens. - - Unlike the GetHtml() method, this method has no side effect. The caller - is responsible for setting the response cookie and injecting the returned - form token as appropriate. - - - - - Validates an anti-forgery token that was supplied for this request. - The anti-forgery token may be generated by calling GetHtml(). - - - Throws an HttpAntiForgeryException if validation fails. - - - - - Validates an anti-forgery token pair that was generated by the GetTokens method. - - The token that was supplied in the request cookie. - The token that was supplied in the request form body. - - Throws an HttpAntiForgeryException if validation fails. - - - - - Provides programmatic configuration for the anti-forgery token system. - - - - - Specifies an object that can provide additional data to put into all - generated tokens and that can validate additional data in incoming - tokens. - - - - - Specifies the name of the cookie that is used by the anti-forgery - system. - - - If an explicit name is not provided, the system will automatically - generate a name. - - - - - Specifies whether SSL is required for the anti-forgery system - to operate. If this setting is 'true' and a non-SSL request - comes into the system, all anti-forgery APIs will fail. - - - - - Specifies whether the anti-forgery system should skip checking - for conditions that might indicate misuse of the system. Please - use caution when setting this switch, as improper use could open - security holes in the application. - - - Setting this switch will disable several checks, including: - - Identity.IsAuthenticated = true without Identity.Name being set - - special-casing claims-based identities - - - - - If claims-based authorization is in use, specifies the claim - type from the identity that is used to uniquely identify the - user. If this property is set, all claims-based identities - must return unique values for this claim type. - - - If claims-based authorization is in use and this property has - not been set, the anti-forgery system will automatically look - for claim types "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" - and "http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider". - - - - - Allows providing or validating additional custom data for anti-forgery tokens. - For example, the developer could use this to supply a nonce when the token is - generated, then he could validate the nonce when the token is validated. - - - The anti-forgery system already embeds the client's username within the - generated tokens. This interface provides and consumes supplemental - data. If an incoming anti-forgery token contains supplemental data but no - additional data provider is configured, the supplemental data will not be - validated. - - - - - Provides additional data to be stored for the anti-forgery tokens generated - during this request. - - Information about the current request. - Supplemental data to embed within the anti-forgery token. - - - - Validates additional data that was embedded inside an incoming anti-forgery - token. - - Information about the current request. - Supplemental data that was embedded within the token. - True if the data is valid; false if the data is invalid. - - - - Initializes a new instance of the class. - - The base scope. - - The dictionary to use as a storage. Since the dictionary would be used as-is, we expect the implementer to - use the same key-value comparison logic as we do here. - - - - - Custom comparer for the context dictionaries - The comparer treats strings as a special case, performing case insesitive comparison. - This guaratees that we remain consistent throughout the chain of contexts since PageData dictionary - behaves in this manner. - - - - - End a ServiceStack Request - - - - - End a ServiceStack Request - - - - - End a HttpHandler Request - - - - - End a HttpHandler Request - - - - - End an MQ Request - - - - - End a ServiceStack Request with no content - - - - - Main container class for components, supporting container hierarchies and - lifetime management of instances. - - - - - Initializes a new empty container. - - - - - Creates a child container of the current one, which exposes its - current service registration to the new child container. - - - - - Disposes the container and all instances owned by it (see - ), as well as all child containers - created through . - - - - - Registers a service instance with the container. This instance - will have and - behavior. - Service instance to use. - - - - Registers a named service instance with the container. This instance - will have and - behavior. - Name of the service to register.Service instance to use. - - - - Retrieves a function that can be used to lazily resolve an instance - of the service when needed. - Type of the service to retrieve.The function that can resolve to the service instance when invoked.The requested service has not been registered previously. - - - - - - - - - - - - - - - - - - - - - - Retrieves a function that can be used to lazily resolve an instance - of the service with the given name when needed. - Type of the service to retrieve.Name of the service to retrieve.The function that can resolve to the service instance with the given name when invoked.The requested service with the given name has not been registered previously. - - - - Retrieves a function that can be used to lazily resolve an instance - of the service of the given type, name and service constructor arguments when needed. - Name of the service to retrieve.The function that can resolve to the service instance with the given and service constructor arguments name when invoked.The requested service with the given name and constructor arguments has not been registered previously. - - - - Retrieves a function that can be used to lazily resolve an instance - of the service of the given type, name and service constructor arguments when needed. - Name of the service to retrieve.The function that can resolve to the service instance with the given and service constructor arguments name when invoked.The requested service with the given name and constructor arguments has not been registered previously. - - - - Retrieves a function that can be used to lazily resolve an instance - of the service of the given type, name and service constructor arguments when needed. - Name of the service to retrieve.The function that can resolve to the service instance with the given and service constructor arguments name when invoked.The requested service with the given name and constructor arguments has not been registered previously. - - - - Retrieves a function that can be used to lazily resolve an instance - of the service of the given type, name and service constructor arguments when needed. - Name of the service to retrieve.The function that can resolve to the service instance with the given and service constructor arguments name when invoked.The requested service with the given name and constructor arguments has not been registered previously. - - - - Retrieves a function that can be used to lazily resolve an instance - of the service of the given type, name and service constructor arguments when needed. - Name of the service to retrieve.The function that can resolve to the service instance with the given and service constructor arguments name when invoked.The requested service with the given name and constructor arguments has not been registered previously. - - - - Retrieves a function that can be used to lazily resolve an instance - of the service of the given type, name and service constructor arguments when needed. - Name of the service to retrieve.The function that can resolve to the service instance with the given and service constructor arguments name when invoked.The requested service with the given name and constructor arguments has not been registered previously. - - - - Registers the given service by providing a factory delegate to - instantiate it. - The service type to register.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.Fourth argument that should be passed to the factory delegate to create the instace.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.Fourth argument that should be passed to the factory delegate to create the instace.Fifth argument that should be passed to the factory delegate to create the instace.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.Fourth argument that should be passed to the factory delegate to create the instace.Fifth argument that should be passed to the factory delegate to create the instace.Sixth argument that should be passed to the factory delegate to create the instace.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given named service by providing a factory delegate to - instantiate it. - The service type to register.A name used to differenciate this service registration.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given named service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.A name used to differenciate this service registration.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given named service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.A name used to differenciate this service registration.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given named service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.A name used to differenciate this service registration.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given named service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.Fourth argument that should be passed to the factory delegate to create the instace.A name used to differenciate this service registration.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given named service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.Fourth argument that should be passed to the factory delegate to create the instace.Fifth argument that should be passed to the factory delegate to create the instace.A name used to differenciate this service registration.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Registers the given named service by providing a factory delegate that receives arguments to - instantiate it. - The service type to register.First argument that should be passed to the factory delegate to create the instace.Second argument that should be passed to the factory delegate to create the instace.Third argument that should be passed to the factory delegate to create the instace.Fourth argument that should be passed to the factory delegate to create the instace.Fifth argument that should be passed to the factory delegate to create the instace.Sixth argument that should be passed to the factory delegate to create the instace.A name used to differenciate this service registration.The factory delegate to initialize new instances of the service when needed.The registration object to perform further configuration via its fluent interface. - - - - Resolves the given service by type, without passing any arguments for - its construction. - Type of the service to retrieve.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace.Sixth argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type and name, without passing arguments for its initialization. - Type of the service to retrieve.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type and name, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type and name, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type and name, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type and name, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type and name, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Resolves the given service by type and name, passing the given arguments - for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace.Sixth argument to pass to the factory delegate that may create the instace.The resolved service instance.The given service could not be resolved. - - - - Attempts to resolve the given service by type, without passing arguments for its initialization. - Type of the service to retrieve. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace.Sixth argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type and name, without passing - arguments arguments for its initialization. - Type of the service to retrieve. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type and name, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type and name, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type and name, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type and name, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type and name, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Attempts to resolve the given service by type and name, passing the - given arguments arguments for its initialization. - Type of the service to retrieve.First argument to pass to the factory delegate that may create the instace.Second argument to pass to the factory delegate that may create the instace.Third argument to pass to the factory delegate that may create the instace.Fourth argument to pass to the factory delegate that may create the instace.Fifth argument to pass to the factory delegate that may create the instace.Sixth argument to pass to the factory delegate that may create the instace. - The resolved service instance or if it cannot be resolved. - - - - - Register an autowired dependency - - - - - - Register an autowired dependency as a separate type - - - - - - Alias for RegisterAutoWiredAs - - - - - - Auto-wires an existing instance, - ie all public properties are tried to be resolved. - - - - - - Generates a function which creates and auto-wires . - - - - - - - - Auto-wires an existing instance of a specific type. - The auto-wiring progress is also cached to be faster - when calling next time with the same type. - - - - - - Default owner for new registrations. by default. - - - - - Default reuse scope for new registrations. by default. - - - - - Enable the Registration feature and configure the RegistrationService. - - - - - Registers the type in the IoC container and - adds auto-wiring to the specified type. - - - - - - - Registers the type in the IoC container and - adds auto-wiring to the specified type. - The reuse scope is set to none (transient). - - - - - - Registers the types in the IoC container and - adds auto-wiring to the specified types. - The reuse scope is set to none (transient). - - - - - - Register a singleton instance as a runtime type - - - - - Encapsulates a method that has five parameters and returns a value of the - type specified by the parameter. - - - - - Encapsulates a method that has six parameters and returns a value of the - type specified by the parameter. - - - - - Encapsulates a method that has seven parameters and returns a value of the - type specified by the parameter. - - - - - Helper interface used to hide the base - members from the fluent API to make for much cleaner - Visual Studio intellisense experience. - - - - - - - - - - - - - - - - - Interface used by plugins to contribute registrations - to an existing container. - - - - - Determines who is responsible for disposing instances - registered with a container. - - - - - Container should dispose provided instances when it is disposed. This is the - default. - - - - - Container does not dispose provided instances. - - - - - Default owner, which equals . - - - - - Exception thrown by the container when a service cannot be resolved. - - - - - Initializes the exception with the service that could not be resolved. - - - - - Initializes the exception with the service (and its name) that could not be resolved. - - - - - Initializes the exception with an arbitrary message. - - - - - Determines visibility and reuse of instances provided by the container. - - - - - Instances are reused within a container hierarchy. Instances - are created (if necessary) in the container where the registration - was performed, and are reused by all descendent containers. - - - - - Instances are reused only at the given container. Descendent - containers do not reuse parent container instances and get - a new instance at their level. - - - - - Each request to resolve the dependency will result in a new - instance being returned. - - - - - Instaces are reused within the given request - - - - - Default scope, which equals . - - - - - Fluent API for customizing the registration of a service. - - - - - Fluent API that exposes both - and owner (). - - - - - Fluent API that allows specifying the reuse instances. - - - - - Specifies how instances are reused within a container or hierarchy. Default - scope is . - - - - - Fluent API that allows specifying the owner of instances - created from a registration. - - - - - Specifies the owner of instances created from this registration. Default - owner is . - - - - - Ownership setting for the service. - - - - - Reuse scope setting for the service. - - - - - The container where the entry was registered. - - - - - Specifies the owner for instances, which determines how - they will be disposed. - - - - - Specifies the scope for instances, which determines - visibility of instances across containers and hierarchies. - - - - - Fluent API for customizing the registration of a service. - - - - - Fluent API that allows registering an initializer for the - service. - - - - - Specifies an initializer that should be invoked after - the service instance has been created by the factory. - - - - - The Func delegate that creates instances of the service. - - - - - The cached service instance if the scope is or - . - - - - - The Func delegate that initializes the object after creation. - - - - - Clones the service entry assigning the to the - . Does not copy the . - - - - - BaseProfilerProvider. This providers some helper methods which provide access to - internals not otherwise available. - To use, override the , and - methods. - - - - - A provider used to create instances and maintain the current instance. - - - - - Starts a new MiniProfiler and sets it to be current. By the end of this method - should return the new MiniProfiler. - - - - - Ends the current profiling session, if one exists. - - - When true, clears the for this HttpContext, allowing profiling to - be prematurely stopped and discarded. Useful for when a specific route does not need to be profiled. - - - - - Returns the current MiniProfiler. This is used by . - - - - - - Starts a new MiniProfiler and sets it to be current. By the end of this method - should return the new MiniProfiler. - - - - - Stops the current MiniProfiler (if any is currently running). - should be called if is false - - If true, any current results will be thrown away and nothing saved - - - - Returns the current MiniProfiler. This is used by . - - - - - - Sets to be active (read to start profiling) - This should be called once a new MiniProfiler has been created. - - The profiler to set to active - If is null - - - - Stops the profiler and marks it as inactive. - - The profiler to stop - True if successful, false if Stop had previously been called on this profiler - If is null - - - - Calls to save the current - profiler using the current storage settings - - - - - - Common extension methods to use only in this project - - - - - Answers true if this String is either null or empty. - - - - - Answers true if this String is neither null or empty. - - - - - Removes trailing / characters from a path and leaves just one - - - - - Removes any leading / characters from a path - - - - - Removes any leading / characters from a path - - - - - Serializes to a json string. - - - - - Gets part of a stack trace containing only methods we care about. - - - - - Gets the current formatted and filted stack trace. - - Space separated list of methods - - - - Identifies users based on ip address. - - - - - Provides functionality to identify which user is profiling a request. - - - - - Returns a string to identify the user profiling the current 'request'. - - The current HttpRequest being profiled. - - - - Returns the paramter HttpRequest's client ip address. - - - - - A single MiniProfiler can be used to represent any number of steps/levels in a call-graph, via Step() - - Totally baller. - - - - Starts when this profiler is instantiated. Each step will use this Stopwatch's current ticks as - their starting time. - - - - - Creates and starts a new MiniProfiler for the root , filtering steps to . - - - - - Returns the 's and this profiler recorded. - - - - - Returns true if Ids match. - - - - - Returns hashcode of Id. - - - - - Obsolete - used for serialization. - - - - - Walks the hierarchy contained in this profiler, starting with , and returns each Timing found. - - - - - Returns milliseconds based on Stopwatch's Frequency. - - - - - Starts a new MiniProfiler based on the current . This new profiler can be accessed by - - - - - - Ends the current profiling session, if one exists. - - - When true, clears the for this HttpContext, allowing profiling to - be prematurely stopped and discarded. Useful for when a specific route does not need to be profiled. - - - - - Returns an that will time the code between its creation and disposal. Use this method when you - do not wish to include the MvcMiniProfiler namespace for the extension method. - - A descriptive name for the code that is encapsulated by the resulting IDisposable's lifetime. - This step's visibility level; allows filtering when is called. - - - - Returns the css and javascript includes needed to display the MiniProfiler results UI. - - Which side of the page the profiler popup button should be displayed on (defaults to left) - Whether to show trivial timings by default (defaults to false) - Whether to show time the time with children column by default (defaults to false) - The maximum number of trace popups to show before removing the oldest (defaults to 15) - xhtml rendering mode, ensure script tag is closed ... etc - when true, shows buttons to minimize and clear MiniProfiler results - Script and link elements normally; an empty string when there is no active profiling session. - - - - Renders the current to json. - - - - - Renders the parameter to json. - - - - - Deserializes the json string parameter to a . - - - - - Create a DEEP clone of this object - - - - - - Returns all currently open commands on this connection - - - - - Returns all results contained in all child steps. - - - - - Contains any sql statements that are executed, along with how many times those statements are executed. - - - - - Adds to the current . - - - - - Returns the number of sql statements of that were executed in all s. - - - - - Identifies this Profiler so it may be stored/cached. - - - - - A display name for this profiling session. - - - - - When this profiler was instantiated. - - - - - Where this profiler was run. - - - - - Allows filtering of steps based on what - the steps are created with. - - - - - The first that is created and started when this profiler is instantiated. - All other s will be children of this one. - - - - - A string identifying the user/client that is profiling this request. Set - with an -implementing class to provide a custom value. - - - If this is not set manually at some point, the implementation will be used; - by default, this will be the current request's ip address. - - - - - Returns true when this MiniProfiler has been viewed by the that recorded it. - - - Allows POSTs that result in a redirect to be profiled. implementation - will keep a list of all profilers that haven't been fetched down. - - - - - For unit testing, returns the timer. - - - - - Milliseconds, to one decimal place, that this MiniProfiler ran. - - - - - Returns true when or any of its are . - - - - - Returns true when all child s are . - - - - - Any Timing step with a duration less than or equal to this will be hidden by default in the UI; defaults to 2.0 ms. - - - - - Ticks since this MiniProfiler was started. - - - - - Json representing the collection of CustomTimings relating to this Profiler - - - Is used when storing the Profiler in SqlStorage - - - - - Points to the currently executing Timing. - - - - - Gets the currently running MiniProfiler for the current HttpContext; null if no MiniProfiler was ed. - - - - - Contains information about queries executed during this profiling session. - - - - - Milliseconds, to one decimal place, that this MiniProfiler was executing sql. - - - - - Returns true when we have profiled queries. - - - - - Returns true when any child Timings have duplicate queries. - - - - - How many sql data readers were executed in all steps. - - - - - How many sql scalar queries were executed in all steps. - - - - - How many sql non-query statements were executed in all steps. - - - - - Various configuration properties. - - - - - Excludes the specified assembly from the stack trace output. - - The short name of the assembly. AssemblyName.Name - - - - Excludes the specified type from the stack trace output. - - The System.Type name to exclude - - - - Excludes the specified method name from the stack trace output. - - The name of the method - - - - Make sure we can at least store profiler results to the http runtime cache. - - - - - Assemblies to exclude from the stack trace report. - - - - - Types to exclude from the stack trace report. - - - - - Methods to exclude from the stack trace report. - - - - - The max length of the stack string to report back; defaults to 120 chars. - - - - - Any Timing step with a duration less than or equal to this will be hidden by default in the UI; defaults to 2.0 ms. - - - - - Dictates if the "time with children" column is displayed by default, defaults to false. - For a per-page override you can use .RenderIncludes(showTimeWithChildren: true/false) - - - - - Dictates if trivial timings are displayed by default, defaults to false. - For a per-page override you can use .RenderIncludes(showTrivial: true/false) - - - - - Determines how many traces to show before removing the oldest; defaults to 15. - For a per-page override you can use .RenderIncludes(maxTracesToShow: 10) - - - - - Dictates on which side of the page the profiler popup button is displayed; defaults to left. - For a per-page override you can use .RenderIncludes(position: RenderPosition.Left/Right) - - - - - Determines if min-max, clear, etc are rendered; defaults to false. - For a per-page override you can use .RenderIncludes(showControls: true/false) - - - - - By default, SqlTimings will grab a stack trace to help locate where queries are being executed. - When this setting is true, no stack trace will be collected, possibly improving profiler performance. - - - - - When is called, if the current request url contains any items in this property, - no profiler will be instantiated and no results will be displayed. - Default value is { "/ssr-", "/content/", "/scripts/", "/favicon.ico" }. - - - - - The path under which ALL routes are registered in, defaults to the application root. For example, "~/myDirectory/" would yield - "/myDirectory/ssr-includes.js" rather than just "/mini-profiler-includes.js" - Any setting here should be in APP RELATIVE FORM, e.g. "~/myDirectory/" - - - - - Understands how to save and load MiniProfilers. Used for caching between when - a profiling session ends and results can be fetched to the client, and for showing shared, full-page results. - - - The normal profiling session life-cycle is as follows: - 1) request begins - 2) profiler is started - 3) normal page/controller/request execution - 4) profiler is stopped - 5) profiler is cached with 's implementation of - 6) request ends - 7) page is displayed and profiling results are ajax-fetched down, pulling cached results from - 's implementation of - - - - - The formatter applied to the SQL being rendered (used only for UI) - - - - - Assembly version of this dank MiniProfiler. - - - - - The provider used to provider the current instance of a provider - This is also - - - - - A function that determines who can access the MiniProfiler results url. It should return true when - the request client has access, false for a 401 to be returned. HttpRequest parameter is the current request and - MiniProfiler parameter is the results that were profiled. - - - Both the HttpRequest and MiniProfiler parameters that will be passed into this function should never be null. - - - - - Allows switching out stopwatches for unit testing. - - - - - Categorizes individual steps to allow filtering. - - - - - Default level given to Timings. - - - - - Useful when profiling many items in a loop, but you don't wish to always see this detail. - - - - - Dictates on which side of the page the profiler popup button is displayed; defaults to left. - - - - - Profiler popup button is displayed on the left. - - - - - Profiler popup button is displayed on the right. - - - - - Contains helper methods that ease working with null s. - - - - - Wraps in a call and executes it, returning its result. - - The current profiling session or null. - Method to execute and profile. - The step name used to label the profiler results. - - - - - Returns an that will time the code between its creation and disposal. - - The current profiling session or null. - A descriptive name for the code that is encapsulated by the resulting IDisposable's lifetime. - This step's visibility level; allows filtering when is called. - - - - Adds 's hierarchy to this profiler's current Timing step, - allowing other threads, remote calls, etc. to be profiled and joined into this profiling session. - - - - - Returns an html-encoded string with a text-representation of ; returns "" when profiler is null. - - The current profiling session or null. - - - - Formats any SQL query with inline parameters, optionally including the value type - - - - - Takes a SqlTiming and returns a formatted SQL string, for parameter replacement, etc. - - - - - Return SQL the way you want it to look on the in the trace. Usually used to format parameters - - - Formatted SQL - - - - Creates a new Inline SQL Formatter, optionally including the parameter type info in comments beside the replaced value - - whether to include a comment after the value, indicating the type, e.g. /* @myParam DbType.Int32 */ - - - - Formats the SQL in a generic frieldly format, including the parameter type information in a comment if it was specified in the InlineFormatter constructor - - The SqlTiming to format - A formatted SQL string - - - - Returns a string representation of the parameter's value, including the type - - The parameter to get a value for - - - - - NOT IMPLEMENTED - will format statements with paramters in an Oracle friendly way - - - - - Does NOTHING, implement me! - - - - - Formats SQL server queries with a DECLARE up top for parameter values - - - - - Formats the SQL in a SQL-Server friendly way, with DECLARE statements for the parameters up top. - - The SqlTiming to format - A formatted SQL string - - - - Contains helper code to time sql statements. - - - - - Returns a new SqlProfiler to be used in the 'profiler' session. - - - - - Tracks when 'command' is started. - - - - - Returns all currently open commands on this connection - - - - - Finishes profiling for 'command', recording durations. - - - - - Called when 'reader' finishes its iterations and is closed. - - - - - The profiling session this SqlProfiler is part of. - - - - - Helper methods that allow operation on SqlProfilers, regardless of their instantiation. - - - - - Tracks when 'command' is started. - - - - - Finishes profiling for 'command', recording durations. - - - - - Called when 'reader' finishes its iterations and is closed. - - - - - Profiles a single sql execution. - - - - - Creates a new SqlTiming to profile 'command'. - - - - - Obsolete - used for serialization. - - - - - Returns a snippet of the sql command and the duration. - - - - - Returns true if Ids match. - - - - - Returns hashcode of Id. - - - - - Called when command execution is finished to determine this SqlTiming's duration. - - - - - Called when database reader is closed, ending profiling for SqlTimings. - - - - - To help with display, put some space around sammiched commas - - - - - Unique identifier for this SqlTiming. - - - - - Category of sql statement executed. - - - - - The sql that was executed. - - - - - The command string with special formatting applied based on MiniProfiler.Settings.SqlFormatter - - - - - Roughly where in the calling code that this sql was executed. - - - - - Offset from main MiniProfiler start that this sql began. - - - - - How long this sql statement took to execute. - - - - - When executing readers, how long it took to come back initially from the database, - before all records are fetched and reader is closed. - - - - - Stores any parameter names and values used by the profiled DbCommand. - - - - - Id of the Timing this statement was executed in. - - - Needed for database deserialization. - - - - - The Timing step that this sql execution occurred in. - - - - - True when other identical sql statements have been executed during this MiniProfiler session. - - - - - Information about a DbParameter used in the sql statement profiled by SqlTiming. - - - - - Returns true if this has the same parent , and as . - - - - - Returns the XOR of certain properties. - - - - - Which SqlTiming this Parameter was executed with. - - - - - Parameter name, e.g. "@routeName" - - - - - The value submitted to the database. - - - - - System.Data.DbType, e.g. "String", "Bit" - - - - - How large the type is, e.g. for string, size could be 4000 - - - - - Understands how to save MiniProfiler results to a MSSQL database, allowing more permanent storage and - querying of slow results. - - - - - Provides saving and loading s to a storage medium. - - - - - Stores under its . - - The results of a profiling session. - - Should also ensure the profiler is stored as being unviewed by its profiling . - - - - - Returns a from storage based on , which should map to . - - - Should also update that the resulting profiler has been marked as viewed by its profiling . - - - - - Returns a list of s that haven't been seen by . - - User identified by the current . - - - - Returns a new SqlServerDatabaseStorage object that will insert into the database identified by connectionString. - - - - - Saves 'profiler' to a database under its . - - - - - Returns the MiniProfiler identified by 'id' from the database or null when no MiniProfiler exists under that 'id'. - - - - - Returns a list of s that haven't been seen by . - - User identified by the current . - - - - Returns a DbConnection for your specific provider. - - - - - Returns a DbConnection already opened for execution. - - - - - How we connect to the database used to save/load MiniProfiler results. - - - - - Understands how to store a to the with absolute expiration. - - - - - The string that prefixes all keys that MiniProfilers are saved under, e.g. - "mini-profiler-ecfb0050-7ce8-4bf1-bf82-2cb38e90e31e". - - - - - Returns a new HttpRuntimeCacheStorage class that will cache MiniProfilers for the specified duration. - - - - - Saves to the HttpRuntime.Cache under a key concated with - and the parameter's . - - - - - Returns the saved identified by . Also marks the resulting - profiler to true. - - - - - Returns a list of s that haven't been seen by . - - User identified by the current . - - - - Syncs access to runtime cache when adding a new list of ids for a user. - - - - - How long to cache each for (i.e. the absolute expiration parameter of - ) - - - - - An individual profiling step that can contain child steps. - - - - - Rebuilds all the parent timings on deserialization calls - - - - - Offset from parent MiniProfiler's creation that this Timing was created. - - - - - Creates a new Timing named 'name' in the 'profiler's session, with 'parent' as this Timing's immediate ancestor. - - - - - Obsolete - used for serialization. - - - - - Returns this Timing's Name. - - - - - Returns true if Ids match. - - - - - Returns hashcode of Id. - - - - - Adds arbitrary string 'value' under 'key', allowing custom properties to be stored in this Timing step. - - - - - Completes this Timing's duration and sets the MiniProfiler's Head up one level. - - - - - Add the parameter 'timing' to this Timing's Children collection. - - - Used outside this assembly for custom deserialization when creating an implementation. - - - - - Adds the parameter 'sqlTiming' to this Timing's SqlTimings collection. - - A sql statement profiling that was executed in this Timing step. - - Used outside this assembly for custom deserialization when creating an implementation. - - - - - Returns the number of sql statements of that were executed in this . - - - - - Unique identifer for this timing; set during construction. - - - - - Text displayed when this Timing is rendered. - - - - - How long this Timing step took in ms; includes any Timings' durations. - - - - - The offset from the start of profiling. - - - - - All sub-steps that occur within this Timing step. Add new children through - - - - - Stores arbitrary key/value strings on this Timing step. Add new tuples through . - - - - - Any queries that occurred during this Timing step. - - - - - Needed for database deserialization and JSON serialization. - - - - - Which Timing this Timing is under - the duration that this step takes will be added to its parent's duration. - - This will be null for the root (initial) Timing. - - - - Gets the elapsed milliseconds in this step without any children's durations. - - - - - Gets the aggregate elapsed milliseconds of all SqlTimings executed in this Timing, excluding Children Timings. - - - - - Returns true when this is less than the configured - , by default 2.0 ms. - - - - - Reference to the containing profiler, allowing this Timing to affect the Head and get Stopwatch readings. - - - - - Returns true when this Timing has inner Timing steps. - - - - - Returns true if this Timing step collected sql execution timings. - - - - - Returns true if any s executed in this step are detected as duplicate statements. - - - - - Returns true when this Timing is the first one created in a MiniProfiler session. - - - - - How far away this Timing is from the Profiler's Root. - - - - - How many sql data readers were executed in this Timing step. Does not include queries in any child Timings. - - - - - How many sql scalar queries were executed in this Timing step. Does not include queries in any child Timings. - - - - - How many sql non-query statements were executed in this Timing step. Does not include queries in any child Timings. - - - - - Understands how to route and respond to MiniProfiler UI urls. - - - - - Returns either includes' css/javascript or results' html. - - - - - Handles rendering static content files. - - - - - Handles rendering a previous MiniProfiler session, identified by its "?id=GUID" on the query. - - - - - Embedded resource contents keyed by filename. - - - - - Helper method that sets a proper 404 response code. - - - - - Try to keep everything static so we can easily be reused. - - - - - HttpContext based profiler provider. This is the default provider to use in a web context. - The current profiler is associated with a HttpContext.Current ensuring that profilers are - specific to a individual HttpRequest. - - - - - Public constructor. This also registers any UI routes needed to display results - - - - - Starts a new MiniProfiler and associates it with the current . - - - - - Ends the current profiling session, if one exists. - - - When true, clears the for this HttpContext, allowing profiling to - be prematurely stopped and discarded. Useful for when a specific route does not need to be profiled. - - - - - Makes sure 'profiler' has a Name, pulling it from route data or url. - - - - - Returns the current profiler - - - - - - Gets the currently running MiniProfiler for the current HttpContext; null if no MiniProfiler was ed. - - - - - WebRequestProfilerProvider specific configurations - - - - - Provides user identification for a given profiling request. - - - - - Indicates that the request dto, which is associated with this attribute, - can only execute, if the user has specific permissions. - - - - - Indicates that the request dto, which is associated with this attribute, - can only execute, if the user has specific roles. - - - - - Check all session is in all supplied roles otherwise a 401 HttpError is thrown - - - - - - - Indicates that the request dto, which is associated with this attribute, - can only execute, if the user has specific permissions. - - - - - Indicates that the request dto, which is associated with this attribute, - can only execute, if the user has any of the specified roles. - - - - - Check all session is in any supplied roles otherwise a 401 HttpError is thrown - - - - - - - Base class to create response filter attributes only for specific HTTP methods (GET, POST...) - - - - - Creates a new - - Defines when the filter should be executed - - - - This method is only executed if the HTTP method matches the property. - - The http request wrapper - The http response wrapper - The response DTO - - - - Create a ShallowCopy of this instance. - - - - - - If they don't have an ICacheClient configured use an In Memory one. - - - - - Creates instance using straight Resolve approach. - This will throw an exception if resolution fails - - - - - Creates instance using the TryResolve approach if tryResolve = true. - Otherwise uses Resolve approach, which will throw an exception if resolution fails - - - - - Sets a persistent cookie which never expires - - - - - Sets a session cookie which expires after the browser session closes - - - - - Deletes a specified cookie by setting its value to empty and expiration to -1 days - - - - - Lets you Register new Services and the optional restPaths will be registered against - this default Request Type - - - - - Naming convention for the ResponseStatus property name on the response DTO - - - - - Create an instance of the service response dto type and inject it with the supplied responseStatus - - - - - - - - - - - - - - - - - Override to provide additional/less context about the Service Exception. - By default the request is serialized and appended to the ResponseStatus StackTrace. - - - - - Scans the supplied Assemblies to infer REST paths and HTTP verbs. - - The instance. - - The assemblies with REST services. - - The same instance; - never . - - - - Configure ServiceStack to have ISession support - - - - - Create the active Session or Permanent Session Id cookie. - - - - - - Create both Permanent and Session Id cookies and return the active sessionId - - - - - - This class interecepts 401 requests and changes them to 402 errors. When this happens the FormAuthentication module - will no longer hijack it and redirect back to login because it is a 402 error, not a 401. - When the request ends, this class sets the status code back to 401 and everything works as it should. - - PathToSupress is the path inside your website where the above swap should happen. - - If you can build for .net 4.5, you do not have to do this swap. You can take advantage of a new flag (SuppressFormsAuthenticationRedirect) - that tells the FormAuthenticationModule to not redirect, which also means you will not need the EndRequest code. - - - - - Converts the validation result to an error result which will be serialized by ServiceStack in a clean and human-readable way. - - The validation result - - - - - Converts the validation result to an error exception which will be serialized by ServiceStack in a clean and human-readable way - if the returned exception is thrown. - - The validation result - - - - - Creates a new instance of the RulesetValidatorSelector. - - - - - Determines whether or not a rule should execute. - - The rule - Property path (eg Customer.Address.Line1) - Contextual information - Whether or not the validator can execute. - - - - Activate the validation mechanism, so every request DTO with an existing validator - will be validated. - - The app host - - - - Override to provide additional/less context about the Service Exception. - By default the request is serialized and appended to the ResponseStatus StackTrace. - - - - - Auto-scans the provided assemblies for a - and registers it in the provided IoC container. - - The IoC container - The assemblies to scan for a validator - - - - Refresh file stats for this node if supported - - - - - In Memory Virtual Path Provider. - - - - - Context to capture IService action - - - - - Get an IAppHost container. - Note: Registering dependencies should only be done during setup/configuration - stage and remain immutable there after for thread-safety. - - - - - - - Ensure the same instance is used for subclasses - - - - - Called before page is executed - - - - - Called after page is executed but before it's merged with the - website template if any. - - - - - Don't HTML encode safe output - - - - - - - Return the output of a different view with the specified name - using the supplied model - - - - - - - - Resolve registered Assemblies - - - - - - Reference to MarkdownViewEngine - - - - - The AppHost so you can access configuration and resolve dependencies, etc. - - - - - This precompiled Markdown page with Metadata - - - - - ASP.NET MVC's HtmlHelper - - - - - All variables passed to and created by your page. - The Response DTO is stored and accessible via the 'Model' variable. - - All variables and outputs created are stored in ScopeArgs which is what's available - to your website template. The Generated page is stored in the 'Body' variable. - - - - - Whether HTML or Markdown output is requested - - - - - The Response DTO - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Container service is built-in and read-only.. - - - - - Looks up a localized string similar to Service type {0} does not inherit or implement {1}.. - - - - - Looks up a localized string similar to Required dependency of type {0} named '{1}' could not be resolved.. - - - - - Looks up a localized string similar to Required dependency of type {0} could not be resolved.. - - - - - Looks up a localized string similar to Unknown scope.. - - - - - Gets string value from Items[name] then Cookies[name] if exists. - Useful when *first* setting the users response cookie in the request filter. - To access the value for this initial request you need to set it in Items[]. - - string value or null if it doesn't exist - - - - Gets request paramater string value by looking in the following order: - - QueryString[name] - - FormData[name] - - Cookies[name] - - Items[name] - - string value or null if it doesn't exist - - + + + + End a ServiceStack Request + + + + + End a ServiceStack Request + + + + + End a HttpHandler Request + + + + + End a HttpHandler Request + + + + + End an MQ Request + + + + + End a ServiceStack Request with no content + + + + + Gets string value from Items[name] then Cookies[name] if exists. + Useful when *first* setting the users response cookie in the request filter. + To access the value for this initial request you need to set it in Items[]. + + string value or null if it doesn't exist + + + + Gets request paramater string value by looking in the following order: + - QueryString[name] + - FormData[name] + - Cookies[name] + - Items[name] + + string value or null if it doesn't exist + + * Input: http://localhost:96/Cambia3/Temp/Test.aspx/path/info?q=item#fragment @@ -8180,622 +5229,1979 @@ Test.aspx/ path/ info - * - - - - Duplicate Params are given a unique key by appending a #1 suffix - - - - - Duplicate params have their values joined together in a comma-delimited string - - - - - Use this to treat Request.Items[] as a cache by returning pre-computed items to save - calculating them multiple times. - - - - - Sets a persistent cookie which never expires - - - - - Sets a session cookie which expires after the browser session closes - - - - - Sets a persistent cookie which expires after the given time - - - - - Sets a persistent cookie with an expiresAt date - - - - - Deletes a specified cookie by setting its value to empty and expiration to -1 days - - - - - Returns the optimized result for the IRequestContext. - Does not use or store results in any cache. - - - - - - - - Overload for the method returning the most - optimized result based on the MimeType and CompressionType from the IRequestContext. - - - - - Overload for the method returning the most - optimized result based on the MimeType and CompressionType from the IRequestContext. - How long to cache for, null is no expiration - - - - - Clears all the serialized and compressed caches set - by the 'Resolve' method for the cacheKey provided - - - - - - - - Store an entry in the IHttpRequest.Items Dictionary - - - - - Get an entry from the IHttpRequest.Items Dictionary - - - - - For performance withPathInfoParts should already be a lower case string - to minimize redundant matching operations. - - - - - - - - For performance withPathInfoParts should already be a lower case string - to minimize redundant matching operations. - - - - - - - - - The number of segments separated by '/' determinable by path.Split('/').Length - e.g. /path/to/here.ext == 3 - - - - - The total number of segments after subparts have been exploded ('.') - e.g. /path/to/here.ext == 4 - - - - - Provide for quick lookups based on hashes that can be determined from a request url - - - - - Execute MQ - - - - - Execute MQ with requestContext - - - - - Execute using empty RequestContext - - - - - Gets the name of the base most type in the heirachy tree with the same. - - We get an exception when trying to create a schema with multiple types of the same name - like when inheriting from a DataContract with the same name. - - The type. - - - - - Inherit from this class if you want to host your web services inside an - ASP.NET application. - - - - - Exécute les tâches définies par l'application associées à la libération ou à la redéfinition des ressources non managées. - - 2 - - - - Load Embedded Resource Templates in ServiceStack. - To get ServiceStack to use your own instead just add a copy of one or more of the following to your Web Root: - ~/Templates/IndexOperations.html - ~/Templates/OperationControl.html - ~/Templates/HtmlFormat.html - - - - - when true, (most) bare plain URLs are auto-hyperlinked - WARNING: this is a significant deviation from the markdown spec - - - - - when true, RETURN becomes a literal newline - WARNING: this is a significant deviation from the markdown spec - - - - - use ">" for HTML output, or " />" for XHTML output - - - - - when true, problematic URL characters like [, ], (, and so forth will be encoded - WARNING: this is a significant deviation from the markdown spec - - - - - when false, email addresses will never be auto-linked - WARNING: this is a significant deviation from the markdown spec - - - - - when true, bold and italic require non-word characters on either side - WARNING: this is a significant deviation from the markdown spec - - - - - Markdown is a text-to-HTML conversion tool for web writers. - Markdown allows you to write using an easy-to-read, easy-to-write plain text format, - then convert it to structurally valid XHTML (or HTML). - - - - - Tabs are automatically converted to spaces as part of the transform - this constant determines how "wide" those tabs become in spaces - - - - - Create a new Markdown instance using default options - - - - - Create a new Markdown instance and optionally load options from a configuration - file. There they should be stored in the appSettings section, available options are: - - Markdown.StrictBoldItalic (true/false) - Markdown.EmptyElementSuffix (">" or " />" without the quotes) - Markdown.LinkEmails (true/false) - Markdown.AutoNewLines (true/false) - Markdown.AutoHyperlink (true/false) - Markdown.EncodeProblemUrlCharacters (true/false) - - - - - - Create a new Markdown instance and set the options from the MarkdownOptions object. - - - - - maximum nested depth of [] and () supported by the transform; implementation detail - - - - - In the static constuctor we'll initialize what stays the same across all transforms. - - - - - Transforms the provided Markdown-formatted text to HTML; - see http://en.wikipedia.org/wiki/Markdown - - - The order in which other subs are called here is - essential. Link and image substitutions need to happen before - EscapeSpecialChars(), so that any *'s or _'s in the a - and img tags get encoded. - - - - - Perform transformations that form block-level tags like paragraphs, headers, and list items. - - - - - Perform transformations that occur *within* block-level tags like paragraphs, headers, and list items. - - - - - splits on two or more newlines, to form "paragraphs"; - each paragraph is then unhashed (if it is a hash and unhashing isn't turned off) or wrapped in HTML p tag - - - - - Reusable pattern to match balanced [brackets]. See Friedl's - "Mastering Regular Expressions", 2nd Ed., pp. 328-331. - - - - - Reusable pattern to match balanced (parens). See Friedl's - "Mastering Regular Expressions", 2nd Ed., pp. 328-331. - - - - - Strips link definitions from text, stores the URLs and titles in hash references. - - - ^[id]: url "optional title" - - - - - derived pretty much verbatim from PHP Markdown - - - - - replaces any block-level HTML blocks with hash entries - - - - - returns an array of HTML tokens comprising the input string. Each token is - either a tag (possibly with nested, tags contained therein, such - as <a href="<MTFoo>">, or a run of text between tags. Each element of the - array is a two-element array; the first is either 'tag' or 'text'; the second is - the actual value. - - - - - Turn Markdown link shortcuts into HTML anchor tags - - - [link text](url "title") - [link text][id] - [id] - - - - - Turn Markdown image shortcuts into HTML img tags. - - - ![alt text][id] - ![alt text](url "optional title") - - - - - Turn Markdown headers into HTML header tags - - - Header 1 - ======== - - Header 2 - -------- - - # Header 1 - ## Header 2 - ## Header 2 with closing hashes ## - ... - ###### Header 6 - - - - - Turn Markdown horizontal rules into HTML hr tags - - - *** - * * * - --- - - - - - - - - - Turn Markdown lists into HTML ul and ol and li tags - - - - - Process the contents of a single ordered or unordered list, splitting it - into individual list items. - - - - - /// Turn Markdown 4-space indented code into HTML pre code blocks - - - - - Turn Markdown `code spans` into HTML code tags - - - - - Turn Markdown *italics* and **bold** into HTML strong and em tags - - - - - Turn markdown line breaks (two space at end of line) into HTML break tags - - - - - Turn Markdown > quoted blocks into HTML blockquote blocks - - - - - Turn angle-delimited URLs into HTML anchor tags - - - <http://www.example.com> - - - - - Remove one level of line-leading spaces - - - - - encodes email address randomly - roughly 10% raw, 45% hex, 45% dec - note that @ is always encoded and : never is - - - - - Encode/escape certain Markdown characters inside code blocks and spans where they are literals - - - - - Encode any ampersands (that aren't part of an HTML entity) and left or right angle brackets - - - - - Encodes any escaped characters such as \`, \*, \[ etc - - - - - swap back in all the special characters we've hidden - - - - - escapes Bold [ * ] and Italic [ _ ] characters - - - - - hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems - - - - - Within tags -- meaning between < and > -- encode [\ ` * _] so they - don't conflict with their use in Markdown for code, italics and strong. - We're replacing each such character with its corresponding hash - value; this is likely overkill, but it should prevent us from colliding - with the escape values by accident. - - - - - convert all tabs to _tabWidth spaces; - standardizes line endings from DOS (CR LF) or Mac (CR) to UNIX (LF); - makes sure text ends with a couple of newlines; - removes any blank lines (only spaces) in the text - - - - - this is to emulate what's evailable in PHP - - - - - use ">" for HTML output, or " />" for XHTML output - - - - - when false, email addresses will never be auto-linked - WARNING: this is a significant deviation from the markdown spec - - - - - when true, bold and italic require non-word characters on either side - WARNING: this is a significant deviation from the markdown spec - - - - - when true, RETURN becomes a literal newline - WARNING: this is a significant deviation from the markdown spec - - - - - when true, (most) bare plain URLs are auto-hyperlinked - WARNING: this is a significant deviation from the markdown spec - - - - - when true, problematic URL characters like [, ], (, and so forth will be encoded - WARNING: this is a significant deviation from the markdown spec - - - - - current version of MarkdownSharp; - see http://code.google.com/p/markdownsharp/ for the latest code or to contribute - - - - - Render Markdown for text/markdown and text/plain ContentTypes - - - - - Used in Unit tests - - - - - - Non ASP.NET requests - - - - - - - - ASP.NET requests - - - - - - Writes to response. - Response headers are customizable by implementing IHasOptions an returning Dictionary of Http headers. - - The response. - Whether or not it was implicity handled by ServiceStack's built-in handlers. - The default action. - The serialization context. - Add prefix to response body if any - Add suffix to response body if any - - - - - Highly optimized code to find if GZIP is supported from: - - http://dotnetperls.com/gzip-request - - Other resources for GZip, deflate resources: - - http://www.west-wind.com/Weblog/posts/10564.aspx - - http://www.west-wind.com/WebLog/posts/102969.aspx - - ICSharpCode - - - - - Changes the links for the servicestack/metadata page - - - - - Non ASP.NET requests - - - - - ASP.NET requests - - - - - Keep default file contents in-memory - - - - - - Call to signal the completion of a ServiceStack-handled Request - - - - - Resolves and auto-wires a ServiceStack Service from a ASP.NET HttpContext. - - - - - Resolves and auto-wires a ServiceStack Service from a HttpListenerContext. - - - - - Resolves and auto-wires a ServiceStack Service. - - - - - Read/Write Virtual FileSystem. Defaults to FileSystemVirtualPathProvider - - - - - Cascading collection of virtual file sources, inc. Embedded Resources, File System, In Memory, S3 - - - - - Callback to pre-configure any logic before IPlugin.Register() is fired - - - - + * + + + + Duplicate Params are given a unique key by appending a #1 suffix + + + + + Duplicate params have their values joined together in a comma-delimited string + + + + + Use this to treat Request.Items[] as a cache by returning pre-computed items to save + calculating them multiple times. + + + + + Sets a persistent cookie which never expires + + + + + Sets a session cookie which expires after the browser session closes + + + + + Sets a persistent cookie which expires after the given time + + + + + Sets a persistent cookie with an expiresAt date + + + + + Deletes a specified cookie by setting its value to empty and expiration to -1 days + + + + + Writes to response. + Response headers are customizable by implementing IHasOptions an returning Dictionary of Http headers. + + The response. + Whether or not it was implicity handled by ServiceStack's built-in handlers. + The default action. + The serialization context. + Add prefix to response body if any + Add suffix to response body if any + + + + + When HTTP Headers have already been written and only the Body can be written + + + + + Respond with a 'Soft redirect' so smart clients (e.g. ajax) have access to the response and + can decide whether or not they should redirect + + + + + Decorate the response with an additional client-side event to instruct participating + smart clients (e.g. ajax) with hints to transparently invoke client-side functionality + + + + + Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult + + + + + + + Alias of AsDto + + + + + Shortcut to get the ResponseDTO whether it's bare or inside a IHttpResult + + + TResponse if found; otherwise null + + + + Alias of AsDto + + + + + Whether the response is an IHttpError or Exception + + + + + rangeHeader should be of the format "bytes=0-" or "bytes=0-12345" or "bytes=123-456" + + + + + Adds 206 PartialContent Status, Content-Range and Content-Length headers + + + + + Writes partial range as specified by start-end, from fromStream to toStream. + + + + + Writes partial range as specified by start-end, from fromStream to toStream. + + + + + ASP.NET or HttpListener ServiceStack host + + + + + The assemblies reflected to find api services provided in the AppHost constructor + + + + + The AppHost config + + + + + The AppHost AppSettings. Defaults to App or Web.config appSettings. + + + + + Access Service Controller for ServiceStack + + + + + Register dependency in AppHost IOC on Startup + + + + + AutoWired Registration of an interface with a concrete type in AppHost IOC on Startup. + + + + + Allows the clean up for executed autowired services and filters. + Calls directly after services and filters are executed. + + + + + Called at the end of each request. Enables Request Scope. + + + + + Register callbacks to be called at the end of each request. + + + + + Register user-defined custom routes. + + + + + Inferred Metadata available from existing services + + + + + Register custom ContentType serializers + + + + + Add Request Filters, to be applied before the dto is deserialized + + + + + Add Request Converter to convert Request DTO's + + + + + Add Response Converter to convert Response DTO's + + + + + Add Request Filters for HTTP Requests + + + + + Add Async Request Filters for HTTP Requests + + + + + Add Response Filters for HTTP Responses + + + + + Add Async Response Filters for HTTP Responses + + + + + Add Request Filters for MQ/TCP Requests + + + + + Add Async Request Filters for MQ/TCP Requests + + + + + Add Response Filters for MQ/TCP Responses + + + + + Add Request Filter for a specific Request DTO Type + + + + + Add as a Typed Request Filter for a specific Request DTO Type + + The DTO Type. + The methods to resolve the . + + + + Add Request Filter for a specific Response DTO Type + + + + + Add as a Typed Request Filter for a specific Request DTO Type + + The DTO Type. + The methods to resolve the . + + + + Add Request Filter for a specific MQ Request DTO Type + + + + + Add Request Filter for a specific MQ Response DTO Type + + + + + Add Request Filter for Service Gateway Requests + + + + + Add Response Filter for Service Gateway Responses + + + + + Add alternative HTML View Engines + + + + + Register additional Virtual File Sources + + + + + Provide an exception handler for unhandled exceptions + + + + + Provide an exception handler for unhandled exceptions (Async) + + + + + Provide an exception handler for un-caught exceptions + + + + + Provide an exception handler for un-caught exceptions (Async) + + + + + Provide callbacks to be fired after the AppHost has finished initializing + + + + + Provide callbacks to be fired when AppHost is being disposed + + + + + Skip the ServiceStack Request Pipeline and process the returned IHttpHandler instead + + + + + Provide a catch-all handler that doesn't match any routes + + + + + Use a fall-back Error Handler for handling global errors + + + + + Use a Custom Error Handler for handling specific error HttpStatusCodes + + + + + Provide a custom model minder for a specific Request DTO + + + + + Allow specific configuration to be overridden at runtime in multi-tenancy Applications + by overriding GetRuntimeConfig in your AppHost + + + + + Register an Adhoc web service on Startup + + + + + Register all Services in Assembly + + + + + List of pre-registered and user-defined plugins to be enabled in this AppHost + + + + + Apply plugins to this AppHost + + + + + Returns the Absolute File Path, relative from your AppHost's Project Path + + + + + Cascading number of file sources, inc. Embedded Resources, File System, In Memory, S3 + + + + + Read/Write Virtual FileSystem. Defaults to FileSystemVirtualPathProvider + + + + + Create a service runner for IService actions + + + + + Resolve the absolute url for this request + + + + + Resolve localized text, returns itself by default. + The Request is provided when exists. + + + + + Execute MQ Message in ServiceStack + + + + + A convenient repository base class you can inherit from to reduce the boilerplate + with accessing a managed IDbConnection + + + + + A convenient base class for your injected service dependencies that reduces the boilerplate + with managed access to ServiceStack's built-in providers + + + + + Callback for Plugins to register necessary handlers with ServiceStack + + + + + Callback to pre-configure any logic before IPlugin.Register() is fired + + + + + Callback to post-configure any logic after IPlugin.Register() is fired + + + + + Callback for AuthProviders to register callbacks with AuthFeature + + + + + Resolve an alternate Web Service from ServiceStack's IOC container. + + + + + + + Inject logic into existing services by introspecting the request and injecting your own + validation logic. Exceptions thrown will have the same behaviour as if the service threw it. + + If a non-null object is returned the request will short-circuit and return that response. + + The instance of the service + GET,POST,PUT,DELETE + + Response DTO; non-null will short-circuit execution and return that response + + + + Encapsulates creating a new message handler + + + + + Processes all messages in a Normal and Priority Queue. + Expects to be called in 1 thread. i.e. Non Thread-Safe. + + + + + + Changes the links for the servicestack/metadata page + + + + + Get the static Parse(string) method on the type supplied + + + + + Gets the constructor info for T(string) if exists. + + + + + Returns the value returned by the 'T.Parse(string)' method if exists otherwise 'new T(string)'. + e.g. if T was a TimeSpan it will return TimeSpan.Parse(textValue). + If there is no Parse Method it will attempt to create a new instance of the destined type + + + + + Determines wheter the Config section identified by the sectionName exists. + + + + + Gets the connection string setting. + + + + + Only generate specified Verb entries for "ANY" routes + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Container service is built-in and read-only.. + + + + + Looks up a localized string similar to Service type {0} does not inherit or implement {1}.. + + + + + Looks up a localized string similar to Required dependency of type {0} named '{1}' could not be resolved.. + + + + + Looks up a localized string similar to Required dependency of type {0} could not be resolved.. + + + + + Looks up a localized string similar to Unknown scope.. + + + + + Transparently Proxy requests through to downstream HTTP Servers + + + + + Customize the HTTP Request Headers that are sent to downstream server + + + + + Customize the downstream HTTP Response Headers that are returned to client + + + + + Inspect or Transform the HTTP Request Body that's sent downstream + + + + + Inspect or Transform the downstream HTTP Response Body that's returned + + + + + Required filters to specify which requests to proxy and which url to use. + + Specify which requests should be proxied + Specify which downstream url to use + + + + Service error logs are kept in 'urn:ServiceErrors:{ServiceName}' + + + + + Combined service error logs are maintained in 'urn:ServiceErrors:All' + + + + + Enable the Registration feature and configure the RegistrationService. + + + + + Abstraction to provide a context per request. + in spnet.web its equivalent to .Current.Items falls back to CallContext + + + + + Tell ServiceStack to use ThreadStatic Items Collection for RequestScoped items. + Warning: ThreadStatic Items aren't pinned to the same request in async services which callback on different threads. + + + + + Start a new Request context, everything deeper in Async pipeline will get this new RequestContext dictionary. + + + + + Gets a list of items for this request. + + This list will be cleared on every request and is specific to the original thread that is handling the request. + If a handler uses additional threads, this data will not be available on those threads. + + + + + Track any IDisposable's to dispose of at the end of the request in IAppHost.OnEndRequest() + + + + + + Release currently registered dependencies for this request + + true if any dependencies were released + + + + Returns the optimized result for the IRequestContext. + Does not use or store results in any cache. + + + + + + + + Overload for the method returning the most + optimized result based on the MimeType and CompressionType from the IRequestContext. + + + + + Overload for the method returning the most + optimized result based on the MimeType and CompressionType from the IRequestContext. + How long to cache for, null is no expiration + + + + + Clears all the serialized and compressed caches set + by the 'Resolve' method for the cacheKey provided + + + + + + + + Store an entry in the IHttpRequest.Items Dictionary + + + + + Get an entry from the IHttpRequest.Items Dictionary + + + + + Base class to create request filter attributes only for specific HTTP methods (GET, POST...) + + + + + Creates a new + + Defines when the filter should be executed + + + + This method is only executed if the HTTP method matches the property. + + The http request wrapper + The http response wrapper + The request DTO + + + + Create a ShallowCopy of this instance. + + + + + + Base class to create request filter attributes only for specific HTTP methods (GET, POST...) + + + + + Creates a new + + Defines when the filter should be executed + + + + This method is only executed if the HTTP method matches the property. + + The http request wrapper + The http response wrapper + The request DTO + + + + Create a ShallowCopy of this instance. + + + + + + RequestLogs service Route, default is /requestlogs + + + + + Turn On/Off Session Tracking + + + + + Turn On/Off Logging of Raw Request Body, default is Off + + + + + Turn On/Off Tracking of Responses + + + + + Turn On/Off Tracking of Exceptions + + + + + Don't log matching requests + + + + + Size of InMemoryRollingRequestLogger circular buffer + + + + + Limit access to /requestlogs service to these roles + + + + + Change the RequestLogger provider. Default is InMemoryRollingRequestLogger + + + + + Don't log requests of these types. By default RequestLog's are excluded + + + + + Don't log request bodys for services with sensitive information. + By default Auth and Registration requests are hidden. + + + + + Limit logging to only Service Requests + + + + + Indicates that the request dto, which is associated with this attribute, + can only execute, if the user has specific permissions. + + + + + Indicates that the request dto, which is associated with this attribute, + can only execute, if the user has specific roles. + + + + + Check all session is in all supplied roles otherwise a 401 HttpError is thrown + + + + + Indicates that the request dto, which is associated with this attribute, + can only execute, if the user has specific permissions. + + + + + Indicates that the request dto, which is associated with this attribute, + can only execute, if the user has any of the specified roles. + + + + + Check all session is in any supplied roles otherwise a 401 HttpError is thrown + + + + + + + Base class to create response filter attributes only for specific HTTP methods (GET, POST...) + + + + + Creates a new + + Defines when the filter should be executed + + + + This method is only executed if the HTTP method matches the property. + + The http request wrapper + The http response wrapper + The response DTO + + + + Create a ShallowCopy of this instance. + + + + + + Base class to create response filter attributes only for specific HTTP methods (GET, POST...) + + + + + Creates a new + + Defines when the filter should be executed + + + + This method is only executed if the HTTP method matches the property. + + The http request wrapper + The http response wrapper + The response DTO + + + + Create a ShallowCopy of this instance. + + + + + + Generic + Useful IService base class + + + + + Returns . cache is only persisted for this running app instance. + + + + + Cascading collection of virtual file sources, inc. Embedded Resources, File System, In Memory, S3 + + + + + Read/Write Virtual FileSystem. Defaults to FileSystemVirtualPathProvider + + + + + Dynamic Session Bag + + + + + Typed UserSession + + + + + If user found in session for this request is authenticated. + + + + + Publish a MQ message over the implementation. + + + + + Disposes all created disposable properties of this service + and executes disposing of all request s + (warning, manualy triggering this might lead to unwanted disposing of all request related objects and services.) + + + + + Scans the supplied Assemblies to infer REST paths and HTTP verbs. + + The instance. + + The assemblies with REST services. + + The same instance; + never . + + + + Typed UserSession + + + + + Dynamic Session Bag + + + + + Configure ServiceStack to have ISession support + + + + + Create the active Session or Permanent Session Id cookie. + + + + + + Create both Permanent and Session Id cookies and return the active sessionId + + + + + + Optimized code to find if GZIP is supported from: + - http://dotnetperls.com/gzip-request + + Other resources for GZip, deflate resources: + - http://www.west-wind.com/Weblog/posts/10564.aspx + - http://www.west-wind.com/WebLog/posts/102969.aspx + - ICSharpCode + + + + + This class interecepts 401 requests and changes them to 402 errors. When this happens the FormAuthentication module + will no longer hijack it and redirect back to login because it is a 402 error, not a 401. + When the request ends, this class sets the status code back to 401 and everything works as it should. + + PathToSupress is the path inside your website where the above swap should happen. + + If you can build for .net 4.5, you do not have to do this swap. You can take advantage of a new flag (SuppressFormsAuthenticationRedirect) + that tells the FormAuthenticationModule to not redirect, which also means you will not need the EndRequest code. + + + + + Load Embedded Resource Templates in ServiceStack. + To get ServiceStack to use your own instead just add a copy of one or more of the following to your Web Root: + ~/Templates/IndexOperations.html + ~/Templates/OperationControl.html + ~/Templates/HtmlFormat.html + + + + + Converts the validation result to an error result which will be serialized by ServiceStack in a clean and human-readable way. + + The validation result + + + + + Converts the validation result to an error exception which will be serialized by ServiceStack in a clean and human-readable way + if the returned exception is thrown. + + The validation result + + + + + Creates a new instance of the RulesetValidatorSelector. + + + + + Determines whether or not a rule should execute. + + The rule + Property path (eg Customer.Address.Line1) + Contextual information + Whether or not the validator can execute. + + + + Activate the validation mechanism, so every request DTO with an existing validator + will be validated. + + The app host + + + + Override to provide additional/less context about the Service Exception. + By default the request is serialized and appended to the ResponseStatus StackTrace. + + + + + Auto-scans the provided assemblies for a + and registers it in the provided IoC container. + + The IoC container + The assemblies to scan for a validator + + + + Main container class for components, supporting container hierarchies and lifetime management of instances. + + + + + Register an autowired dependency + + + + + + Register an autowired dependency + + Name of dependency + + + + + Register an autowired dependency as a separate type + + + + + + Register an autowired dependency as a separate type + + + + + + Alias for RegisterAutoWiredAs + + + + + + Alias for RegisterAutoWiredAs + + + + + + Auto-wires an existing instance, + ie all public properties are tried to be resolved. + + + + + + Generates a function which creates and auto-wires . + + + + + + + + Auto-wires an existing instance of a specific type. + The auto-wiring progress is also cached to be faster + when calling next time with the same type. + + + + + + Initializes a new empty container. + + + + + Default owner for new registrations. by default. + + + + + Default reuse scope for new registrations. by default. + + + + + Creates a child container of the current one, which exposes its current service registration to the new child container. + + + + + Registers a service instance with the container. This instance will have and + behavior. + + Service instance to use. + + + + Registers a named service instance with the container. This instance + will have and behavior. + + Name of the service to register. + Service instance to use. + + + + Disposes the container and all instances owned by it (), as well as all child containers + created through . + + + + + Registers the given service by providing a factory delegate to instantiate it. + + The service type to register. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + Fourth argument that should be passed to the factory delegate to create the instace. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + Fourth argument that should be passed to the factory delegate to create the instace. + Fifth argument that should be passed to the factory delegate to create the instace. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + Fourth argument that should be passed to the factory delegate to create the instace. + Fifth argument that should be passed to the factory delegate to create the instace. + Sixth argument that should be passed to the factory delegate to create the instace. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given named service by providing a factory delegate to instantiate it. + + The service type to register. + A name used to differenciate this service registration. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given named service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + A name used to differenciate this service registration. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given named service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + A name used to differenciate this service registration. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given named service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + A name used to differenciate this service registration. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given named service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + Fouth argument that should be passed to the factory delegate to create the instace. + A name used to differenciate this service registration. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given named service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + Fouth argument that should be passed to the factory delegate to create the instace. + Fifth argument that should be passed to the factory delegate to create the instace. + A name used to differenciate this service registration. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Registers the given named service by providing a factory delegate that receives arguments to instantiate it. + + The service type to register. + First argument that should be passed to the factory delegate to create the instace. + Second argument that should be passed to the factory delegate to create the instace. + Third argument that should be passed to the factory delegate to create the instace. + Fouth argument that should be passed to the factory delegate to create the instace. + Fifth argument that should be passed to the factory delegate to create the instace. + Sixth argument that should be passed to the factory delegate to create the instace. + A name used to differenciate this service registration. + The factory delegate to initialize new instances of the service when needed. + The registration object to perform further configuration via its fluent interface. + + + + Resolves the given service by type, without passing any arguments for its construction. + + Type of the service to retrieve. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + Sixth argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type and name, without passing arguments for its initialization. + + Type of the service to retrieve. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type and name, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type and name, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type and name, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type and name, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type and name, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Resolves the given service by type and name, passing the given arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + Sixth argument to pass to the factory delegate that may create the instace. + The resolved service instance. + The given service could not be resolved. + + + + Attempts to resolve the given service by type, without passing arguments for its initialization. + + Type of the service to retrieve. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + The resolved service instance or if it cannot be resolved. + + + + Attempts to resolve the given service by type, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + Sixth argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type and name, without passing arguments arguments for its initialization. + + Type of the service to retrieve. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type and name, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type and name, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type and name, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type and name, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type and name, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Attempts to resolve the given service by type and name, passing the given arguments arguments for its initialization. + + Type of the service to retrieve. + First argument to pass to the factory delegate that may create the instace. + Second argument to pass to the factory delegate that may create the instace. + Third argument to pass to the factory delegate that may create the instace. + Fourth argument to pass to the factory delegate that may create the instace. + Fifth argument to pass to the factory delegate that may create the instace. + Sixth argument to pass to the factory delegate that may create the instace. + The resolved service instance or null if it cannot be resolved. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type when needed. + + Type of the service to retrieve. + The function that can resolve to the service instance when invoked. + The requested service has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + The function that can resolve to the service instance with the given constructor arguments when invoked. + The requested service with the given constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + The function that can resolve to the service instance with the given constructor arguments when invoked. + The requested service with the given constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + The function that can resolve to the service instance with the given constructor arguments when invoked. + The requested service with the given constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + Type of the four argument to pass to the factory delegate to create the instace. + The function that can resolve to the service instance with the given constructor arguments when invoked. + The requested service with the given constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + Type of the four argument to pass to the factory delegate to create the instace. + Type of the five argument to pass to the factory delegate to create the instace. + The function that can resolve to the service instance with the given constructor arguments when invoked. + The requested service with the given constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + Type of the four argument to pass to the factory delegate to create the instace. + Type of the five argument to pass to the factory delegate to create the instace. + Type of the six argument to pass to the factory delegate to create the instace. + The function that can resolve to the service instance with the given constructor arguments when invoked. + The requested service with the given constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service with the given name when needed. + + Type of the service to retrieve. + Name of the service to retrieve. + The function that can resolve to the service instance with the given name when invoked. + The requested service with the given name has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type, name and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Name of the service to retrieve. + The function that can resolve to the service instance with the given and service constructor arguments name when invoked. + The requested service with the given name and constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type, name and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Name of the service to retrieve. + The function that can resolve to the service instance with the given and service constructor arguments name when invoked. + The requested service with the given name and constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type, name and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + Name of the service to retrieve. + The function that can resolve to the service instance with the given and service constructor arguments name when invoked. + The requested service with the given name and constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type, name and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + Type of the four argument to pass to the factory delegate to create the instace. + Name of the service to retrieve. + The function that can resolve to the service instance with the given and service constructor arguments name when invoked. + The requested service with the given name and constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type, name and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + Type of the four argument to pass to the factory delegate to create the instace. + Type of the five argument to pass to the factory delegate to create the instace. + Name of the service to retrieve. + The function that can resolve to the service instance with the given and service constructor arguments name when invoked. + The requested service with the given name and constructor arguments has not been registered previously. + + + + Retrieves a function that can be used to lazily resolve an instance of the service of the given type, name and service constructor arguments when needed. + + Type of the service to retrieve. + Type of the one argument to pass to the factory delegate to create the instace. + Type of the two argument to pass to the factory delegate to create the instace. + Type of the three argument to pass to the factory delegate to create the instace. + Type of the four argument to pass to the factory delegate to create the instace. + Type of the five argument to pass to the factory delegate to create the instace. + Type of the six argument to pass to the factory delegate to create the instace. + Name of the service to retrieve. + The function that can resolve to the service instance with the given and service constructor arguments name when invoked. + The requested service with the given name and constructor arguments has not been registered previously. + + + + Encapsulates a method that has five parameters and returns a value of the + type specified by the parameter. + + + + + Encapsulates a method that has six parameters and returns a value of the + type specified by the parameter. + + + + + Encapsulates a method that has seven parameters and returns a value of the + type specified by the parameter. + + + + + Helper interface used to hide the base + members from the fluent API to make for much cleaner + Visual Studio intellisense experience. + + + + + Funqlets are a set of components provided as a package + to an existing container (like a module). + + + + + Configure the given container with the registrations provided by the funqlet. + + Container to register. + + + + Interface used by plugins to contribute registrations to an existing container. + + + + + Determines who is responsible for disposing instances registered with a container. + + + + + Container should dispose provided instances when it is disposed. This is the default. + + + + + Container does not dispose provided instances. + + + + + Default owner, which equals . + + + + + Exception thrown by the container when a service cannot be resolved. + + + + + Initializes the exception with the service that could not be resolved. + + + + + Initializes the exception with the service (and its name) that could not be resolved. + + + + + Initializes the exception with an arbitrary message. + + + + + Determines visibility and reuse of instances provided by the container. + + + + + Instances are reused within a container hierarchy. Instances are created (if necessary) in the container where the registration + was performed, and are reused by all descendent containers. + + + + + Instances are reused only at the given container. Descendent containers do not reuse parent container instances and get + a new instance at their level. + + + + + Each request to resolve the dependency will result in a new instance being returned. + + + + + Instaces are reused within the given request. + + + + + Default scope, which equals . + + + + + Ownership setting for the service. + + + + + Reuse scope setting for the service. + + + + + The container where the entry was registered. + + + + + Specifies the owner for instances, which determines how + they will be disposed. + + + + + Specifies the scope for instances, which determines + visibility of instances across containers and hierarchies. + + + + + The Func delegate that creates instances of the service. + + + + + The cached service instance if the scope is or . + + + + + The Func delegate that initializes the object after creation. + + + + + Clones the service entry assigning the to the + . Does not copy the . + + + + + Fluent API for customizing the registration of a service. + + + + + Fluent API for customizing the registration of a service. + + + + + Fluent API that allows registering an initializer for the + service. + + + + + Specifies an initializer that should be invoked after + the service instance has been created by the factory. + + + + + Fluent API that exposes both + and owner (). + + + + + Fluent API that allows specifying the reuse instances. + + + + + Specifies how instances are reused within a container or hierarchy. Default + scope is . + + + + + Fluent API that allows specifying the owner of instances + created from a registration. + + + + + Specifies the owner of instances created from this registration. Default + owner is . + + + + diff --git a/lib/System.Data.SQLite.dll b/lib/System.Data.SQLite.dll new file mode 100644 index 00000000..7e1836fc Binary files /dev/null and b/lib/System.Data.SQLite.dll differ diff --git a/lib/copy.bat b/lib/copy.bat new file mode 100644 index 00000000..51c699e1 --- /dev/null +++ b/lib/copy.bat @@ -0,0 +1,23 @@ +REM SET BUILD=Debug +SET BUILD=Release + +COPY ..\..\ServiceStack.Text\src\ServiceStack.Text\bin\%BUILD%\net45\ServiceStack.Text.* + +COPY ..\..\ServiceStack\src\ServiceStack.Interfaces\bin\%BUILD%\net45\ServiceStack.Interfaces.*" + +COPY ..\..\ServiceStack\src\ServiceStack.Client\bin\%BUILD%\net45\ServiceStack.Client.* + +COPY ..\..\ServiceStack\src\ServiceStack.Common\bin\%BUILD%\net45\ServiceStack.Common.* + +COPY ..\..\ServiceStack\src\ServiceStack\bin\%BUILD%\net45\ServiceStack.dll +COPY ..\..\ServiceStack\src\ServiceStack\bin\%BUILD%\net45\ServiceStack.xml + +COPY ..\..\ServiceStack.Redis\src\ServiceStack.Redis\bin\%BUILD%\net45\ServiceStack.Redis.* + +COPY ..\..\ServiceStack.OrmLite\src\ServiceStack.OrmLite\bin\%BUILD%\net45\ServiceStack.OrmLite.* +COPY ..\..\ServiceStack.OrmLite\src\ServiceStack.OrmLite.Sqlite\bin\%BUILD%\net45\ServiceStack.OrmLite.Sqlite.* +COPY ..\..\ServiceStack.OrmLite\src\ServiceStack.OrmLite.Sqlite\bin\%BUILD%\net45\System.Data.SQLite.dll +COPY ..\..\ServiceStack.OrmLite\src\ServiceStack.OrmLite.Sqlite\bin\%BUILD%\net45\x64\* x64 +COPY ..\..\ServiceStack.OrmLite\src\ServiceStack.OrmLite.Sqlite\bin\%BUILD%\net45\x86\* x86 + +COPY ..\..\ServiceStack\src\ServiceStack.Razor\bin\%BUILD%\net45\ServiceStack.Razor.* diff --git a/lib/x64/SQLite.Interop.dll b/lib/x64/SQLite.Interop.dll new file mode 100644 index 00000000..4853cd59 Binary files /dev/null and b/lib/x64/SQLite.Interop.dll differ diff --git a/lib/x86/SQLite.Interop.dll b/lib/x86/SQLite.Interop.dll new file mode 100644 index 00000000..73bff669 Binary files /dev/null and b/lib/x86/SQLite.Interop.dll differ diff --git a/src/ServiceStack.Northwind/.nuget/NuGet.Config b/src/.nuget/NuGet.Config similarity index 97% rename from src/ServiceStack.Northwind/.nuget/NuGet.Config rename to src/.nuget/NuGet.Config index 6a318ad9..67f8ea04 100644 --- a/src/ServiceStack.Northwind/.nuget/NuGet.Config +++ b/src/.nuget/NuGet.Config @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/src/ServiceStack.Northwind/.nuget/NuGet.targets b/src/.nuget/NuGet.targets similarity index 98% rename from src/ServiceStack.Northwind/.nuget/NuGet.targets rename to src/.nuget/NuGet.targets index d0ebc753..83fe9060 100644 --- a/src/ServiceStack.Northwind/.nuget/NuGet.targets +++ b/src/.nuget/NuGet.targets @@ -1,136 +1,136 @@ - - - - $(MSBuildProjectDirectory)\..\ - - - false - - - false - - - true - - - false - - - - - - - - - - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - - - - - $(SolutionDir).nuget - packages.config - - - - - $(NuGetToolsPath)\NuGet.exe - @(PackageSource) - - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) - - $(TargetDir.Trim('\\')) - - -RequireConsent - -NonInteractive - - "$(SolutionDir) " - "$(SolutionDir)" - - - $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) - $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + "$(SolutionDir) " + "$(SolutionDir)" + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) + $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/AllExamples.sln b/src/AllExamples.sln index 298e29bf..3146ad29 100644 --- a/src/AllExamples.sln +++ b/src/AllExamples.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2005 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ServiceStack.Northwind", "ServiceStack.Northwind", "{206CDF5A-68B2-431A-B28D-B8F43C0697A6}" EndProject @@ -94,6 +94,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{19FF9025 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomPath45", "StarterTemplates\CustomPath45\CustomPath45.csproj", "{E256695F-8607-4A79-ABA5-6FED3A400C71}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarterTemplates.Tests", "StarterTemplates\StarterTemplates.Tests\StarterTemplates.Tests.csproj", "{0BF3A819-1166-4471-89ED-0CE63867FD86}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -414,6 +416,18 @@ Global {E256695F-8607-4A79-ABA5-6FED3A400C71}.Release|Mixed Platforms.Build.0 = Release|Any CPU {E256695F-8607-4A79-ABA5-6FED3A400C71}.Release|x86.ActiveCfg = Release|Any CPU {E256695F-8607-4A79-ABA5-6FED3A400C71}.Release|x86.Build.0 = Release|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Debug|x86.ActiveCfg = Debug|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Debug|x86.Build.0 = Debug|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Release|Any CPU.Build.0 = Release|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Release|x86.ActiveCfg = Release|Any CPU + {0BF3A819-1166-4471-89ED-0CE63867FD86}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -453,6 +467,10 @@ Global {91D8B4E8-1973-40C6-AF44-DBFEEAAF0C7F} = {4721A7AC-65B8-48C0-A7CC-BF4B7A2B9D02} {19FF9025-F307-4507-9CCB-5D08D7D975E1} = {EBC6AB0B-D961-4E31-A2B4-09F74F102B37} {E256695F-8607-4A79-ABA5-6FED3A400C71} = {4721A7AC-65B8-48C0-A7CC-BF4B7A2B9D02} + {0BF3A819-1166-4471-89ED-0CE63867FD86} = {4721A7AC-65B8-48C0-A7CC-BF4B7A2B9D02} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EC33C33C-0ED1-425D-BFAC-FC0B64CCCCF1} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = ..\Client\RemoteInfoClient\RemoteInfoClient.csproj diff --git a/src/AllExamples.sln.DotSettings b/src/AllExamples.sln.DotSettings deleted file mode 100644 index 11f2c267..00000000 --- a/src/AllExamples.sln.DotSettings +++ /dev/null @@ -1,3 +0,0 @@ - - <data><IncludeFilters /><ExcludeFilters /></data> - <data /> \ No newline at end of file diff --git a/src/Backbone.Todos/Backbone.Todos.csproj b/src/Backbone.Todos/Backbone.Todos.csproj index 066a9f92..ef58ea42 100644 --- a/src/Backbone.Todos/Backbone.Todos.csproj +++ b/src/Backbone.Todos/Backbone.Todos.csproj @@ -26,6 +26,7 @@ + true @@ -48,28 +49,28 @@ - ..\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\lib\ServiceStack.dll - ..\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\lib\ServiceStack.Client.dll - ..\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\lib\ServiceStack.Common.dll - ..\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + False + ..\..\lib\ServiceStack.Interfaces.dll - ..\packages\ServiceStack.Redis.4.5.0\lib\net45\ServiceStack.Redis.dll - True + False + ..\..\lib\ServiceStack.Redis.dll - ..\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\lib\ServiceStack.Text.dll @@ -82,31 +83,18 @@ + - - - - - - - - - - - - - - - - - - - + + - + + + Designer + @@ -114,9 +102,6 @@ - - - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Backbone.Todos/Backbone.Todos.sln b/src/Backbone.Todos/Backbone.Todos.sln index 98d88ea1..706fdb84 100644 --- a/src/Backbone.Todos/Backbone.Todos.sln +++ b/src/Backbone.Todos/Backbone.Todos.sln @@ -1,6 +1,7 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2010 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Backbone.Todos", "Backbone.Todos.csproj", "{BDE04BD3-40A0-4B8E-A0B9-7729FFB7D1C2}" EndProject Global @@ -17,4 +18,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8D2B59CE-B2F6-489C-AC72-7711BB61042A} + EndGlobalSection EndGlobal diff --git a/src/Backbone.Todos/Content/Css/todos.css b/src/Backbone.Todos/Content/Css/default.css similarity index 98% rename from src/Backbone.Todos/Content/Css/todos.css rename to src/Backbone.Todos/Content/Css/default.css index 6c32c883..b1858ceb 100644 --- a/src/Backbone.Todos/Content/Css/todos.css +++ b/src/Backbone.Todos/Content/Css/default.css @@ -16,11 +16,13 @@ table, caption, tbody, tfoot, thead, tr, th, td { font-family: inherit; vertical-align: baseline; } -body { - line-height: 1; - color: black; - background: white; + +#logo { + position: absolute; + top: 5px; + left: 5px; } + ol, ul { list-style: none; } @@ -28,16 +30,13 @@ a img { border: none; } -html { - background: #eeeeee; -} - body { +body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.4em; - background: #eeeeee; + background: ghostwhite; color: #333333; - } +} #todoapp { width: 480px; @@ -218,7 +217,7 @@ html { */ .ui-tooltip, .ui-tooltip-top, .ui-tooltip-right, .ui-tooltip-bottom, .ui-tooltip-left { color:#ffffff; - cursor:normal; + cursor:default; display:-moz-inline-stack; display:inline-block; font-size:12px; diff --git a/src/Backbone.Todos/Content/Images/logo.png b/src/Backbone.Todos/Content/Images/logo.png new file mode 100644 index 00000000..08e81b4c Binary files /dev/null and b/src/Backbone.Todos/Content/Images/logo.png differ diff --git a/src/Backbone.Todos/Global.asax.cs b/src/Backbone.Todos/Global.asax.cs index ad400c15..e42c192a 100644 --- a/src/Backbone.Todos/Global.asax.cs +++ b/src/Backbone.Todos/Global.asax.cs @@ -1,10 +1,7 @@ using System; using ServiceStack; using ServiceStack.Redis; -using Funq; -using ServiceStack.Text; -//The entire C# source code for the ServiceStack + Redis TODO REST backend. There is no other .cs :) namespace Backbone.Todos { // Define your ServiceStack web service request (i.e. Request DTO). @@ -22,7 +19,7 @@ public class TodoService : Service public object Get(Todo todo) { //Return a single Todo if the id is provided. - if (todo.Id != default(long)) + if (todo.Id != 0) return Redis.As().GetById(todo.Id); //Return all Todos items. @@ -30,21 +27,21 @@ public object Get(Todo todo) } // Handles creating and updating the Todo items. - public Todo Post(Todo todo) + public object Post(Todo todo) { var redis = Redis.As(); - + //Get next id for new todo - if (todo.Id == default(long)) + if (todo.Id == 0) todo.Id = redis.GetNextSequence(); - + redis.Store(todo); - + return todo; } // Handles creating and updating the Todo items. - public Todo Put(Todo todo) + public object Put(Todo todo) { return Post(todo); } @@ -56,20 +53,23 @@ public void Delete(Todo todo) } } - // Create your ServiceStack web service application with a singleton AppHost. - public class AppHost : AppHostBase + /// + /// Create your ServiceStack web service application with a singleton AppHost. + /// + public class TodoAppHost : AppHostBase { // Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. - public AppHost() : base("Backbone.js TODO", typeof(TodoService).Assembly) { } - - // Configure the container with the necessary routes for your ServiceStack application. - public override void Configure(Container container) + public TodoAppHost() : base("Backbone.js TODO", typeof(TodoService).Assembly) { //Configure ServiceStack Json web services to return idiomatic Json camelCase properties. - JsConfig.EmitCamelCaseNames = true; + Config.UseCamelCase = true; + } + // Configure the container with the necessary routes for your ServiceStack application. + public override void Configure(Funq.Container container) + { //Register Redis factory in Funq IoC. The default port for Redis is 6379. - container.Register(new BasicRedisClientManager("localhost:6379")); + container.Register(new BasicRedisClientManager()); //Register user-defined REST Paths using the fluent configuration API Routes @@ -83,7 +83,7 @@ public class Global : System.Web.HttpApplication protected void Application_Start(object sender, EventArgs e) { //Initialize your ServiceStack AppHost - (new AppHost()).Init(); + new TodoAppHost().Init(); } } } diff --git a/src/Backbone.Todos/Scripts/backbone.js b/src/Backbone.Todos/Scripts/backbone.js index e0c5fed1..55ccb22b 100644 --- a/src/Backbone.Todos/Scripts/backbone.js +++ b/src/Backbone.Todos/Scripts/backbone.js @@ -1,614 +1,1188 @@ -// Backbone.js 0.3.3 -// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc. +// Backbone.js 1.3.3 + +// (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Backbone may be freely distributed under the MIT license. // For all details and documentation: -// http://documentcloud.github.com/backbone +// http://backbonejs.org + +(function(factory) { + + // Establish the root object, `window` (`self`) in the browser, or `global` on the server. + // We use `self` instead of `window` for `WebWorker` support. + var root = (typeof self == 'object' && self.self === self && self) || + (typeof global == 'object' && global.global === global && global); + + // Set up Backbone appropriately for the environment. Start with AMD. + if (typeof define === 'function' && define.amd) { + define(['underscore', 'jquery', 'exports'], function(_, $, exports) { + // Export global even in AMD case in case this script is loaded with + // others that may still expect a global Backbone. + root.Backbone = factory(root, exports, _, $); + }); + + // Next for Node.js or CommonJS. jQuery may not be needed as a module. + } else if (typeof exports !== 'undefined') { + var _ = require('underscore'), $; + try { $ = require('jquery'); } catch (e) {} + factory(root, exports, _, $); + + // Finally, as a browser global. + } else { + root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$)); + } -(function(){ +})(function(root, Backbone, _, $) { // Initial Setup // ------------- - // The top-level namespace. All public Backbone classes and modules will - // be attached to this. Exported for both CommonJS and the browser. - var Backbone; - if (typeof exports !== 'undefined') { - Backbone = exports; - } else { - Backbone = this.Backbone = {}; - } + // Save the previous value of the `Backbone` variable, so that it can be + // restored later on, if `noConflict` is used. + var previousBackbone = root.Backbone; + + // Create a local reference to a common array method we'll want to use later. + var slice = Array.prototype.slice; // Current version of the library. Keep in sync with `package.json`. - Backbone.VERSION = '0.3.3'; + Backbone.VERSION = '1.3.3'; - // Require Underscore, if we're on the server, and it's not already present. - var _ = this._; - if (!_ && (typeof require !== 'undefined')) _ = require('underscore')._; + // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns + // the `$` variable. + Backbone.$ = $; - // For Backbone's purposes, either jQuery or Zepto owns the `$` variable. - var $ = this.jQuery || this.Zepto; + // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable + // to its previous owner. Returns a reference to this Backbone object. + Backbone.noConflict = function() { + root.Backbone = previousBackbone; + return this; + }; - // Turn on `emulateHTTP` to use support legacy HTTP servers. Setting this option will - // fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and set a - // `X-Http-Method-Override` header. + // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option + // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and + // set a `X-Http-Method-Override` header. Backbone.emulateHTTP = false; // Turn on `emulateJSON` to support legacy servers that can't deal with direct - // `application/json` requests ... will encode the body as + // `application/json` requests ... this will encode the body as // `application/x-www-form-urlencoded` instead and will send the model in a // form param named `model`. Backbone.emulateJSON = false; + // Proxy Backbone class methods to Underscore functions, wrapping the model's + // `attributes` object or collection's `models` array behind the scenes. + // + // collection.filter(function(model) { return model.get('age') > 10 }); + // collection.each(this.addView); + // + // `Function#apply` can be slow so we use the method's arg count, if we know it. + var addMethod = function(length, method, attribute) { + switch (length) { + case 1: return function() { + return _[method](this[attribute]); + }; + case 2: return function(value) { + return _[method](this[attribute], value); + }; + case 3: return function(iteratee, context) { + return _[method](this[attribute], cb(iteratee, this), context); + }; + case 4: return function(iteratee, defaultVal, context) { + return _[method](this[attribute], cb(iteratee, this), defaultVal, context); + }; + default: return function() { + var args = slice.call(arguments); + args.unshift(this[attribute]); + return _[method].apply(_, args); + }; + } + }; + var addUnderscoreMethods = function(Class, methods, attribute) { + _.each(methods, function(length, method) { + if (_[method]) Class.prototype[method] = addMethod(length, method, attribute); + }); + }; + + // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`. + var cb = function(iteratee, instance) { + if (_.isFunction(iteratee)) return iteratee; + if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee); + if (_.isString(iteratee)) return function(model) { return model.get(iteratee); }; + return iteratee; + }; + var modelMatcher = function(attrs) { + var matcher = _.matches(attrs); + return function(model) { + return matcher(model.attributes); + }; + }; + // Backbone.Events - // ----------------- + // --------------- // A module that can be mixed in to *any object* in order to provide it with - // custom events. You may `bind` or `unbind` a callback function to an event; - // `trigger`-ing an event fires all callbacks in succession. + // a custom event channel. You may bind a callback to an event with `on` or + // remove with `off`; `trigger`-ing an event fires all callbacks in + // succession. // // var object = {}; // _.extend(object, Backbone.Events); - // object.bind('expand', function(){ alert('expanded'); }); + // object.on('expand', function(){ alert('expanded'); }); // object.trigger('expand'); // - Backbone.Events = { - - // Bind an event, specified by a string name, `ev`, to a `callback` function. - // Passing `"all"` will bind the callback to all events fired. - bind : function(ev, callback) { - var calls = this._callbacks || (this._callbacks = {}); - var list = this._callbacks[ev] || (this._callbacks[ev] = []); - list.push(callback); - return this; - }, + var Events = Backbone.Events = {}; + + // Regular expression used to split event strings. + var eventSplitter = /\s+/; + + // Iterates over the standard `event, callback` (as well as the fancy multiple + // space-separated events `"change blur", callback` and jQuery-style event + // maps `{event: callback}`). + var eventsApi = function(iteratee, events, name, callback, opts) { + var i = 0, names; + if (name && typeof name === 'object') { + // Handle event maps. + if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback; + for (names = _.keys(name); i < names.length ; i++) { + events = eventsApi(iteratee, events, names[i], name[names[i]], opts); + } + } else if (name && eventSplitter.test(name)) { + // Handle space-separated event names by delegating them individually. + for (names = name.split(eventSplitter); i < names.length; i++) { + events = iteratee(events, names[i], callback, opts); + } + } else { + // Finally, standard events. + events = iteratee(events, name, callback, opts); + } + return events; + }; + + // Bind an event to a `callback` function. Passing `"all"` will bind + // the callback to all events fired. + Events.on = function(name, callback, context) { + return internalOn(this, name, callback, context); + }; + + // Guard the `listening` argument from the public API. + var internalOn = function(obj, name, callback, context, listening) { + obj._events = eventsApi(onApi, obj._events || {}, name, callback, { + context: context, + ctx: obj, + listening: listening + }); + + if (listening) { + var listeners = obj._listeners || (obj._listeners = {}); + listeners[listening.id] = listening; + } + + return obj; + }; + + // Inversion-of-control versions of `on`. Tell *this* object to listen to + // an event in another object... keeping track of what it's listening to + // for easier unbinding later. + Events.listenTo = function(obj, name, callback) { + if (!obj) return this; + var id = obj._listenId || (obj._listenId = _.uniqueId('l')); + var listeningTo = this._listeningTo || (this._listeningTo = {}); + var listening = listeningTo[id]; + + // This object is not listening to any other events on `obj` yet. + // Setup the necessary references to track the listening callbacks. + if (!listening) { + var thisId = this._listenId || (this._listenId = _.uniqueId('l')); + listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0}; + } + + // Bind callbacks on obj, and keep track of them on listening. + internalOn(obj, name, callback, this, listening); + return this; + }; + + // The reducing API that adds a callback to the `events` object. + var onApi = function(events, name, callback, options) { + if (callback) { + var handlers = events[name] || (events[name] = []); + var context = options.context, ctx = options.ctx, listening = options.listening; + if (listening) listening.count++; + + handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening}); + } + return events; + }; + + // Remove one or many callbacks. If `context` is null, removes all + // callbacks with that function. If `callback` is null, removes all + // callbacks for the event. If `name` is null, removes all bound + // callbacks for all events. + Events.off = function(name, callback, context) { + if (!this._events) return this; + this._events = eventsApi(offApi, this._events, name, callback, { + context: context, + listeners: this._listeners + }); + return this; + }; + + // Tell this object to stop listening to either specific events ... or + // to every object it's currently listening to. + Events.stopListening = function(obj, name, callback) { + var listeningTo = this._listeningTo; + if (!listeningTo) return this; + + var ids = obj ? [obj._listenId] : _.keys(listeningTo); + + for (var i = 0; i < ids.length; i++) { + var listening = listeningTo[ids[i]]; - // Remove one or many callbacks. If `callback` is null, removes all - // callbacks for the event. If `ev` is null, removes all bound callbacks - // for all events. - unbind : function(ev, callback) { - var calls; - if (!ev) { - this._callbacks = {}; - } else if (calls = this._callbacks) { - if (!callback) { - calls[ev] = []; + // If listening doesn't exist, this object is not currently + // listening to obj. Break out early. + if (!listening) break; + + listening.obj.off(name, callback, this); + } + + return this; + }; + + // The reducing API that removes a callback from the `events` object. + var offApi = function(events, name, callback, options) { + if (!events) return; + + var i = 0, listening; + var context = options.context, listeners = options.listeners; + + // Delete all events listeners and "drop" events. + if (!name && !callback && !context) { + var ids = _.keys(listeners); + for (; i < ids.length; i++) { + listening = listeners[ids[i]]; + delete listeners[listening.id]; + delete listening.listeningTo[listening.objId]; + } + return; + } + + var names = name ? [name] : _.keys(events); + for (; i < names.length; i++) { + name = names[i]; + var handlers = events[name]; + + // Bail out if there are no events stored. + if (!handlers) break; + + // Replace events if there are any remaining. Otherwise, clean up. + var remaining = []; + for (var j = 0; j < handlers.length; j++) { + var handler = handlers[j]; + if ( + callback && callback !== handler.callback && + callback !== handler.callback._callback || + context && context !== handler.context + ) { + remaining.push(handler); } else { - var list = calls[ev]; - if (!list) return this; - for (var i = 0, l = list.length; i < l; i++) { - if (callback === list[i]) { - list.splice(i, 1); - break; - } + listening = handler.listening; + if (listening && --listening.count === 0) { + delete listeners[listening.id]; + delete listening.listeningTo[listening.objId]; } } } - return this; - }, - // Trigger an event, firing all bound callbacks. Callbacks are passed the - // same arguments as `trigger` is, apart from the event name. - // Listening for `"all"` passes the true event name as the first argument. - trigger : function(ev) { - var list, calls, i, l; - if (!(calls = this._callbacks)) return this; - if (calls[ev]) { - list = calls[ev].slice(0); - for (i = 0, l = list.length; i < l; i++) { - list[i].apply(this, Array.prototype.slice.call(arguments, 1)); - } - } - if (calls['all']) { - list = calls['all'].slice(0); - for (i = 0, l = list.length; i < l; i++) { - list[i].apply(this, arguments); - } + // Update tail event if the list has any events. Otherwise, clean up. + if (remaining.length) { + events[name] = remaining; + } else { + delete events[name]; } - return this; } + return events; + }; + + // Bind an event to only be triggered a single time. After the first time + // the callback is invoked, its listener will be removed. If multiple events + // are passed in using the space-separated syntax, the handler will fire + // once for each event, not once for a combination of all events. + Events.once = function(name, callback, context) { + // Map the event into a `{event: once}` object. + var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this)); + if (typeof name === 'string' && context == null) callback = void 0; + return this.on(events, callback, context); + }; + + // Inversion-of-control versions of `once`. + Events.listenToOnce = function(obj, name, callback) { + // Map the event into a `{event: once}` object. + var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj)); + return this.listenTo(obj, events); + }; + + // Reduces the event callbacks into a map of `{event: onceWrapper}`. + // `offer` unbinds the `onceWrapper` after it has been called. + var onceMap = function(map, name, callback, offer) { + if (callback) { + var once = map[name] = _.once(function() { + offer(name, once); + callback.apply(this, arguments); + }); + once._callback = callback; + } + return map; + }; + + // Trigger one or many events, firing all bound callbacks. Callbacks are + // passed the same arguments as `trigger` is, apart from the event name + // (unless you're listening on `"all"`, which will cause your callback to + // receive the true name of the event as the first argument). + Events.trigger = function(name) { + if (!this._events) return this; + + var length = Math.max(0, arguments.length - 1); + var args = Array(length); + for (var i = 0; i < length; i++) args[i] = arguments[i + 1]; + + eventsApi(triggerApi, this._events, name, void 0, args); + return this; + }; + + // Handles triggering the appropriate event callbacks. + var triggerApi = function(objEvents, name, callback, args) { + if (objEvents) { + var events = objEvents[name]; + var allEvents = objEvents.all; + if (events && allEvents) allEvents = allEvents.slice(); + if (events) triggerEvents(events, args); + if (allEvents) triggerEvents(allEvents, [name].concat(args)); + } + return objEvents; + }; + // A difficult-to-believe, but optimized internal dispatch function for + // triggering events. Tries to keep the usual cases speedy (most internal + // Backbone events have 3 arguments). + var triggerEvents = function(events, args) { + var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; + switch (args.length) { + case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; + case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; + case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; + case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; + default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; + } }; + // Aliases for backwards compatibility. + Events.bind = Events.on; + Events.unbind = Events.off; + + // Allow the `Backbone` object to serve as a global event bus, for folks who + // want global "pubsub" in a convenient place. + _.extend(Backbone, Events); + // Backbone.Model // -------------- - // Create a new model, with defined attributes. A client id (`cid`) + // Backbone **Models** are the basic data object in the framework -- + // frequently representing a row in a table in a database on your server. + // A discrete chunk of data and a bunch of useful, related methods for + // performing computations and transformations on that data. + + // Create a new model with the specified attributes. A client id (`cid`) // is automatically generated and assigned for you. - Backbone.Model = function(attributes, options) { - var defaults; - attributes || (attributes = {}); - if (defaults = this.defaults) { - if (_.isFunction(defaults)) defaults = defaults(); - attributes = _.extend({}, defaults, attributes); - } + var Model = Backbone.Model = function(attributes, options) { + var attrs = attributes || {}; + options || (options = {}); + this.cid = _.uniqueId(this.cidPrefix); this.attributes = {}; - this._escapedAttributes = {}; - this.cid = _.uniqueId('c'); - this.set(attributes, {silent : true}); - this._changed = false; - this._previousAttributes = _.clone(this.attributes); - if (options && options.collection) this.collection = options.collection; - this.initialize(attributes, options); + if (options.collection) this.collection = options.collection; + if (options.parse) attrs = this.parse(attrs, options) || {}; + var defaults = _.result(this, 'defaults'); + attrs = _.defaults(_.extend({}, defaults, attrs), defaults); + this.set(attrs, options); + this.changed = {}; + this.initialize.apply(this, arguments); }; // Attach all inheritable methods to the Model prototype. - _.extend(Backbone.Model.prototype, Backbone.Events, { + _.extend(Model.prototype, Events, { - // A snapshot of the model's previous attributes, taken immediately - // after the last `"change"` event was fired. - _previousAttributes : null, + // A hash of attributes whose current and previous value differ. + changed: null, - // Has the item been changed since the last `"change"` event? - _changed : false, + // The value returned during the last failed validation. + validationError: null, // The default name for the JSON `id` attribute is `"id"`. MongoDB and // CouchDB users may want to set this to `"_id"`. - idAttribute : 'id', + idAttribute: 'id', + + // The prefix is used to create the client id which is used to identify models locally. + // You may want to override this if you're experiencing name clashes with model ids. + cidPrefix: 'c', // Initialize is an empty function by default. Override it with your own // initialization logic. - initialize : function(){}, + initialize: function(){}, // Return a copy of the model's `attributes` object. - toJSON : function() { + toJSON: function(options) { return _.clone(this.attributes); }, + // Proxy `Backbone.sync` by default -- but override this if you need + // custom syncing semantics for *this* particular model. + sync: function() { + return Backbone.sync.apply(this, arguments); + }, + // Get the value of an attribute. - get : function(attr) { + get: function(attr) { return this.attributes[attr]; }, // Get the HTML-escaped value of an attribute. - escape : function(attr) { - var html; - if (html = this._escapedAttributes[attr]) return html; - var val = this.attributes[attr]; - return this._escapedAttributes[attr] = escapeHTML(val == null ? '' : '' + val); + escape: function(attr) { + return _.escape(this.get(attr)); }, // Returns `true` if the attribute contains a value that is not null // or undefined. - has : function(attr) { - return this.attributes[attr] != null; + has: function(attr) { + return this.get(attr) != null; }, - // Set a hash of model attributes on the object, firing `"change"` unless you - // choose to silence it. - set : function(attrs, options) { + // Special-cased proxy to underscore's `_.matches` method. + matches: function(attrs) { + return !!_.iteratee(attrs, this)(this.attributes); + }, + + // Set a hash of model attributes on the object, firing `"change"`. This is + // the core primitive operation of a model, updating the data and notifying + // anyone who needs to know about the change in state. The heart of the beast. + set: function(key, val, options) { + if (key == null) return this; + + // Handle both `"key", value` and `{key: value}` -style arguments. + var attrs; + if (typeof key === 'object') { + attrs = key; + options = val; + } else { + (attrs = {})[key] = val; + } - // Extract attributes and options. options || (options = {}); - if (!attrs) return this; - if (attrs.attributes) attrs = attrs.attributes; - var now = this.attributes, escaped = this._escapedAttributes; // Run validation. - if (!options.silent && this.validate && !this._performValidation(attrs, options)) return false; + if (!this._validate(attrs, options)) return false; + + // Extract attributes and options. + var unset = options.unset; + var silent = options.silent; + var changes = []; + var changing = this._changing; + this._changing = true; + + if (!changing) { + this._previousAttributes = _.clone(this.attributes); + this.changed = {}; + } - // Check for changes of `id`. - if (this.idAttribute in attrs) this.id = attrs[this.idAttribute]; + var current = this.attributes; + var changed = this.changed; + var prev = this._previousAttributes; - // Update attributes. + // For each `set` attribute, update or delete the current value. for (var attr in attrs) { - var val = attrs[attr]; - if (!_.isEqual(now[attr], val)) { - now[attr] = val; - delete escaped[attr]; - this._changed = true; - if (!options.silent) this.trigger('change:' + attr, this, val, options); + val = attrs[attr]; + if (!_.isEqual(current[attr], val)) changes.push(attr); + if (!_.isEqual(prev[attr], val)) { + changed[attr] = val; + } else { + delete changed[attr]; } + unset ? delete current[attr] : current[attr] = val; } - // Fire the `"change"` event, if the model has been changed. - if (!options.silent && this._changed) this.change(options); - return this; - }, + // Update the `id`. + if (this.idAttribute in attrs) this.id = this.get(this.idAttribute); - // Remove an attribute from the model, firing `"change"` unless you choose - // to silence it. `unset` is a noop if the attribute doesn't exist. - unset : function(attr, options) { - if (!(attr in this.attributes)) return this; - options || (options = {}); - var value = this.attributes[attr]; + // Trigger all relevant attribute changes. + if (!silent) { + if (changes.length) this._pending = options; + for (var i = 0; i < changes.length; i++) { + this.trigger('change:' + changes[i], this, current[changes[i]], options); + } + } - // Run validation. - var validObj = {}; - validObj[attr] = void 0; - if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false; - - // Remove the attribute. - delete this.attributes[attr]; - delete this._escapedAttributes[attr]; - if (attr == this.idAttribute) delete this.id; - this._changed = true; - if (!options.silent) { - this.trigger('change:' + attr, this, void 0, options); - this.change(options); + // You might be wondering why there's a `while` loop here. Changes can + // be recursively nested within `"change"` events. + if (changing) return this; + if (!silent) { + while (this._pending) { + options = this._pending; + this._pending = false; + this.trigger('change', this, options); + } } + this._pending = false; + this._changing = false; return this; }, - // Clear all attributes on the model, firing `"change"` unless you choose - // to silence it. - clear : function(options) { - options || (options = {}); - var old = this.attributes; + // Remove an attribute from the model, firing `"change"`. `unset` is a noop + // if the attribute doesn't exist. + unset: function(attr, options) { + return this.set(attr, void 0, _.extend({}, options, {unset: true})); + }, - // Run validation. - var validObj = {}; - for (attr in old) validObj[attr] = void 0; - if (!options.silent && this.validate && !this._performValidation(validObj, options)) return false; + // Clear all attributes on the model, firing `"change"`. + clear: function(options) { + var attrs = {}; + for (var key in this.attributes) attrs[key] = void 0; + return this.set(attrs, _.extend({}, options, {unset: true})); + }, - this.attributes = {}; - this._escapedAttributes = {}; - this._changed = true; - if (!options.silent) { - for (attr in old) { - this.trigger('change:' + attr, this, void 0, options); - } - this.change(options); + // Determine if the model has changed since the last `"change"` event. + // If you specify an attribute name, determine if that attribute has changed. + hasChanged: function(attr) { + if (attr == null) return !_.isEmpty(this.changed); + return _.has(this.changed, attr); + }, + + // Return an object containing all the attributes that have changed, or + // false if there are no changed attributes. Useful for determining what + // parts of a view need to be updated and/or what attributes need to be + // persisted to the server. Unset attributes will be set to undefined. + // You can also pass an attributes object to diff against the model, + // determining if there *would be* a change. + changedAttributes: function(diff) { + if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; + var old = this._changing ? this._previousAttributes : this.attributes; + var changed = {}; + for (var attr in diff) { + var val = diff[attr]; + if (_.isEqual(old[attr], val)) continue; + changed[attr] = val; } - return this; + return _.size(changed) ? changed : false; }, - // Fetch the model from the server. If the server's representation of the - // model differs from its current attributes, they will be overriden, - // triggering a `"change"` event. - fetch : function(options) { - options || (options = {}); + // Get the previous value of an attribute, recorded at the time the last + // `"change"` event was fired. + previous: function(attr) { + if (attr == null || !this._previousAttributes) return null; + return this._previousAttributes[attr]; + }, + + // Get all of the attributes of the model at the time of the previous + // `"change"` event. + previousAttributes: function() { + return _.clone(this._previousAttributes); + }, + + // Fetch the model from the server, merging the response with the model's + // local attributes. Any changed attributes will trigger a "change" event. + fetch: function(options) { + options = _.extend({parse: true}, options); var model = this; var success = options.success; options.success = function(resp) { - if (!model.set(model.parse(resp), options)) return false; - if (success) success(model, resp); + var serverAttrs = options.parse ? model.parse(resp, options) : resp; + if (!model.set(serverAttrs, options)) return false; + if (success) success.call(options.context, model, resp, options); + model.trigger('sync', model, resp, options); }; - options.error = wrapError(options.error, model, options); - (this.sync || Backbone.sync).call(this, 'read', this, options); - return this; + wrapError(this, options); + return this.sync('read', this, options); }, // Set a hash of model attributes, and sync the model to the server. // If the server returns an attributes hash that differs, the model's // state will be `set` again. - save : function(attrs, options) { - options || (options = {}); - if (attrs && !this.set(attrs, options)) return false; + save: function(key, val, options) { + // Handle both `"key", value` and `{key: value}` -style arguments. + var attrs; + if (key == null || typeof key === 'object') { + attrs = key; + options = val; + } else { + (attrs = {})[key] = val; + } + + options = _.extend({validate: true, parse: true}, options); + var wait = options.wait; + + // If we're not waiting and attributes exist, save acts as + // `set(attr).save(null, opts)` with validation. Otherwise, check if + // the model will be valid when the attributes, if any, are set. + if (attrs && !wait) { + if (!this.set(attrs, options)) return false; + } else if (!this._validate(attrs, options)) { + return false; + } + + // After a successful server-side save, the client is (optionally) + // updated with the server-side state. var model = this; var success = options.success; + var attributes = this.attributes; options.success = function(resp) { - if (!model.set(model.parse(resp), options)) return false; - if (success) success(model, resp); + // Ensure attributes are restored during synchronous saves. + model.attributes = attributes; + var serverAttrs = options.parse ? model.parse(resp, options) : resp; + if (wait) serverAttrs = _.extend({}, attrs, serverAttrs); + if (serverAttrs && !model.set(serverAttrs, options)) return false; + if (success) success.call(options.context, model, resp, options); + model.trigger('sync', model, resp, options); }; - options.error = wrapError(options.error, model, options); - var method = this.isNew() ? 'create' : 'update'; - (this.sync || Backbone.sync).call(this, method, this, options); - return this; + wrapError(this, options); + + // Set temporary attributes if `{wait: true}` to properly find new ids. + if (attrs && wait) this.attributes = _.extend({}, attributes, attrs); + + var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update'); + if (method === 'patch' && !options.attrs) options.attrs = attrs; + var xhr = this.sync(method, this, options); + + // Restore attributes. + this.attributes = attributes; + + return xhr; }, - // Destroy this model on the server. Upon success, the model is removed - // from its collection, if it has one. - destroy : function(options) { - options || (options = {}); + // Destroy this model on the server if it was already persisted. + // Optimistically removes the model from its collection, if it has one. + // If `wait: true` is passed, waits for the server to respond before removal. + destroy: function(options) { + options = options ? _.clone(options) : {}; var model = this; var success = options.success; - options.success = function(resp) { + var wait = options.wait; + + var destroy = function() { + model.stopListening(); model.trigger('destroy', model, model.collection, options); - if (success) success(model, resp); }; - options.error = wrapError(options.error, model, options); - (this.sync || Backbone.sync).call(this, 'delete', this, options); - return this; + + options.success = function(resp) { + if (wait) destroy(); + if (success) success.call(options.context, model, resp, options); + if (!model.isNew()) model.trigger('sync', model, resp, options); + }; + + var xhr = false; + if (this.isNew()) { + _.defer(options.success); + } else { + wrapError(this, options); + xhr = this.sync('delete', this, options); + } + if (!wait) destroy(); + return xhr; }, // Default URL for the model's representation on the server -- if you're // using Backbone's restful methods, override this to change the endpoint // that will be called. - url : function() { - var base = getUrl(this.collection) || this.urlRoot || urlError(); + url: function() { + var base = + _.result(this, 'urlRoot') || + _.result(this.collection, 'url') || + urlError(); if (this.isNew()) return base; - return base + (base.charAt(base.length - 1) == '/' ? '' : '/') + encodeURIComponent(this.id); + var id = this.get(this.idAttribute); + return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id); }, // **parse** converts a response into the hash of attributes to be `set` on // the model. The default implementation is just to pass the response along. - parse : function(resp) { + parse: function(resp, options) { return resp; }, // Create a new model with identical attributes to this one. - clone : function() { - return new this.constructor(this); - }, - - // A model is new if it has never been saved to the server, and has a negative - // ID. - isNew : function() { - return !this.id; - }, - - // Call this method to manually fire a `change` event for this model. - // Calling this will cause all objects observing the model to update. - change : function(options) { - this.trigger('change', this, options); - this._previousAttributes = _.clone(this.attributes); - this._changed = false; - }, - - // Determine if the model has changed since the last `"change"` event. - // If you specify an attribute name, determine if that attribute has changed. - hasChanged : function(attr) { - if (attr) return this._previousAttributes[attr] != this.attributes[attr]; - return this._changed; - }, - - // Return an object containing all the attributes that have changed, or false - // if there are no changed attributes. Useful for determining what parts of a - // view need to be updated and/or what attributes need to be persisted to - // the server. - changedAttributes : function(now) { - now || (now = this.attributes); - var old = this._previousAttributes; - var changed = false; - for (var attr in now) { - if (!_.isEqual(old[attr], now[attr])) { - changed = changed || {}; - changed[attr] = now[attr]; - } - } - return changed; + clone: function() { + return new this.constructor(this.attributes); }, - // Get the previous value of an attribute, recorded at the time the last - // `"change"` event was fired. - previous : function(attr) { - if (!attr || !this._previousAttributes) return null; - return this._previousAttributes[attr]; + // A model is new if it has never been saved to the server, and lacks an id. + isNew: function() { + return !this.has(this.idAttribute); }, - // Get all of the attributes of the model at the time of the previous - // `"change"` event. - previousAttributes : function() { - return _.clone(this._previousAttributes); + // Check if the model is currently in a valid state. + isValid: function(options) { + return this._validate({}, _.extend({}, options, {validate: true})); }, - // Run validation against a set of incoming attributes, returning `true` - // if all is well. If a specific `error` callback has been passed, - // call that instead of firing the general `"error"` event. - _performValidation : function(attrs, options) { - var error = this.validate(attrs); - if (error) { - if (options.error) { - options.error(this, error); - } else { - this.trigger('error', this, error, options); - } - return false; - } - return true; + // Run validation against the next complete set of model attributes, + // returning `true` if all is well. Otherwise, fire an `"invalid"` event. + _validate: function(attrs, options) { + if (!options.validate || !this.validate) return true; + attrs = _.extend({}, this.attributes, attrs); + var error = this.validationError = this.validate(attrs, options) || null; + if (!error) return true; + this.trigger('invalid', this, error, _.extend(options, {validationError: error})); + return false; } }); + // Underscore methods that we want to implement on the Model, mapped to the + // number of arguments they take. + var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, + omit: 0, chain: 1, isEmpty: 1}; + + // Mix in each Underscore method as a proxy to `Model#attributes`. + addUnderscoreMethods(Model, modelMethods, 'attributes'); + // Backbone.Collection // ------------------- - // Provides a standard collection class for our sets of models, ordered - // or unordered. If a `comparator` is specified, the Collection will maintain + // If models tend to represent a single row of data, a Backbone Collection is + // more analogous to a table full of data ... or a small slice or page of that + // table, or a collection of rows that belong together for a particular reason + // -- all of the messages in this particular folder, all of the documents + // belonging to this particular author, and so on. Collections maintain + // indexes of their models, both in order, and for lookup by `id`. + + // Create a new **Collection**, perhaps to contain a specific type of `model`. + // If a `comparator` is specified, the Collection will maintain // its models in sort order, as they're added and removed. - Backbone.Collection = function(models, options) { + var Collection = Backbone.Collection = function(models, options) { options || (options = {}); - if (options.comparator) { - this.comparator = options.comparator; - delete options.comparator; - } - _.bindAll(this, '_onModelEvent', '_removeReference'); + if (options.model) this.model = options.model; + if (options.comparator !== void 0) this.comparator = options.comparator; this._reset(); - if (models) this.refresh(models, {silent: true}); - this.initialize(models, options); + this.initialize.apply(this, arguments); + if (models) this.reset(models, _.extend({silent: true}, options)); + }; + + // Default options for `Collection#set`. + var setOptions = {add: true, remove: true, merge: true}; + var addOptions = {add: true, remove: false}; + + // Splices `insert` into `array` at index `at`. + var splice = function(array, insert, at) { + at = Math.min(Math.max(at, 0), array.length); + var tail = Array(array.length - at); + var length = insert.length; + var i; + for (i = 0; i < tail.length; i++) tail[i] = array[i + at]; + for (i = 0; i < length; i++) array[i + at] = insert[i]; + for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i]; }; // Define the Collection's inheritable methods. - _.extend(Backbone.Collection.prototype, Backbone.Events, { + _.extend(Collection.prototype, Events, { // The default model for a collection is just a **Backbone.Model**. // This should be overridden in most cases. - model : Backbone.Model, + model: Model, // Initialize is an empty function by default. Override it with your own // initialization logic. - initialize : function(){}, + initialize: function(){}, // The JSON representation of a Collection is an array of the // models' attributes. - toJSON : function() { - return this.map(function(model){ return model.toJSON(); }); + toJSON: function(options) { + return this.map(function(model) { return model.toJSON(options); }); }, - // Add a model, or list of models to the set. Pass **silent** to avoid - // firing the `added` event for every new model. - add : function(models, options) { - if (_.isArray(models)) { - for (var i = 0, l = models.length; i < l; i++) { - this._add(models[i], options); - } - } else { - this._add(models, options); + // Proxy `Backbone.sync` by default. + sync: function() { + return Backbone.sync.apply(this, arguments); + }, + + // Add a model, or list of models to the set. `models` may be Backbone + // Models or raw JavaScript objects to be converted to Models, or any + // combination of the two. + add: function(models, options) { + return this.set(models, _.extend({merge: false}, options, addOptions)); + }, + + // Remove a model, or a list of models from the set. + remove: function(models, options) { + options = _.extend({}, options); + var singular = !_.isArray(models); + models = singular ? [models] : models.slice(); + var removed = this._removeModels(models, options); + if (!options.silent && removed.length) { + options.changes = {added: [], merged: [], removed: removed}; + this.trigger('update', this, options); } - return this; + return singular ? removed[0] : removed; }, - // Remove a model, or a list of models from the set. Pass silent to avoid - // firing the `removed` event for every model removed. - remove : function(models, options) { - if (_.isArray(models)) { - for (var i = 0, l = models.length; i < l; i++) { - this._remove(models[i], options); + // Update a collection by `set`-ing a new list of models, adding new ones, + // removing models that are no longer present, and merging models that + // already exist in the collection, as necessary. Similar to **Model#set**, + // the core operation for updating the data contained by the collection. + set: function(models, options) { + if (models == null) return; + + options = _.extend({}, setOptions, options); + if (options.parse && !this._isModel(models)) { + models = this.parse(models, options) || []; + } + + var singular = !_.isArray(models); + models = singular ? [models] : models.slice(); + + var at = options.at; + if (at != null) at = +at; + if (at > this.length) at = this.length; + if (at < 0) at += this.length + 1; + + var set = []; + var toAdd = []; + var toMerge = []; + var toRemove = []; + var modelMap = {}; + + var add = options.add; + var merge = options.merge; + var remove = options.remove; + + var sort = false; + var sortable = this.comparator && at == null && options.sort !== false; + var sortAttr = _.isString(this.comparator) ? this.comparator : null; + + // Turn bare objects into model references, and prevent invalid models + // from being added. + var model, i; + for (i = 0; i < models.length; i++) { + model = models[i]; + + // If a duplicate is found, prevent it from being added and + // optionally merge it into the existing model. + var existing = this.get(model); + if (existing) { + if (merge && model !== existing) { + var attrs = this._isModel(model) ? model.attributes : model; + if (options.parse) attrs = existing.parse(attrs, options); + existing.set(attrs, options); + toMerge.push(existing); + if (sortable && !sort) sort = existing.hasChanged(sortAttr); + } + if (!modelMap[existing.cid]) { + modelMap[existing.cid] = true; + set.push(existing); + } + models[i] = existing; + + // If this is a new, valid model, push it to the `toAdd` list. + } else if (add) { + model = models[i] = this._prepareModel(model, options); + if (model) { + toAdd.push(model); + this._addReference(model, options); + modelMap[model.cid] = true; + set.push(model); + } + } + } + + // Remove stale models. + if (remove) { + for (i = 0; i < this.length; i++) { + model = this.models[i]; + if (!modelMap[model.cid]) toRemove.push(model); } - } else { - this._remove(models, options); + if (toRemove.length) this._removeModels(toRemove, options); } - return this; + + // See if sorting is needed, update `length` and splice in new models. + var orderChanged = false; + var replace = !sortable && add && remove; + if (set.length && replace) { + orderChanged = this.length !== set.length || _.some(this.models, function(m, index) { + return m !== set[index]; + }); + this.models.length = 0; + splice(this.models, set, 0); + this.length = this.models.length; + } else if (toAdd.length) { + if (sortable) sort = true; + splice(this.models, toAdd, at == null ? this.length : at); + this.length = this.models.length; + } + + // Silently sort the collection if appropriate. + if (sort) this.sort({silent: true}); + + // Unless silenced, it's time to fire all appropriate add/sort/update events. + if (!options.silent) { + for (i = 0; i < toAdd.length; i++) { + if (at != null) options.index = at + i; + model = toAdd[i]; + model.trigger('add', model, this, options); + } + if (sort || orderChanged) this.trigger('sort', this, options); + if (toAdd.length || toRemove.length || toMerge.length) { + options.changes = { + added: toAdd, + removed: toRemove, + merged: toMerge + }; + this.trigger('update', this, options); + } + } + + // Return the added (or merged) model (or models). + return singular ? models[0] : models; + }, + + // When you have more items than you want to add or remove individually, + // you can reset the entire set with a new list of models, without firing + // any granular `add` or `remove` events. Fires `reset` when finished. + // Useful for bulk operations and optimizations. + reset: function(models, options) { + options = options ? _.clone(options) : {}; + for (var i = 0; i < this.models.length; i++) { + this._removeReference(this.models[i], options); + } + options.previousModels = this.models; + this._reset(); + models = this.add(models, _.extend({silent: true}, options)); + if (!options.silent) this.trigger('reset', this, options); + return models; + }, + + // Add a model to the end of the collection. + push: function(model, options) { + return this.add(model, _.extend({at: this.length}, options)); + }, + + // Remove a model from the end of the collection. + pop: function(options) { + var model = this.at(this.length - 1); + return this.remove(model, options); + }, + + // Add a model to the beginning of the collection. + unshift: function(model, options) { + return this.add(model, _.extend({at: 0}, options)); + }, + + // Remove a model from the beginning of the collection. + shift: function(options) { + var model = this.at(0); + return this.remove(model, options); + }, + + // Slice out a sub-array of models from the collection. + slice: function() { + return slice.apply(this.models, arguments); }, - // Get a model from the set by id. - get : function(id) { - if (id == null) return null; - return this._byId[id.id != null ? id.id : id]; + // Get a model from the set by id, cid, model object with id or cid + // properties, or an attributes object that is transformed through modelId. + get: function(obj) { + if (obj == null) return void 0; + return this._byId[obj] || + this._byId[this.modelId(obj.attributes || obj)] || + obj.cid && this._byId[obj.cid]; }, - // Get a model from the set by client id. - getByCid : function(cid) { - return cid && this._byCid[cid.cid || cid]; + // Returns `true` if the model is in the collection. + has: function(obj) { + return this.get(obj) != null; }, // Get the model at the given index. at: function(index) { + if (index < 0) index += this.length; return this.models[index]; }, - // Force the collection to re-sort itself. You don't need to call this under normal - // circumstances, as the set will maintain sort order as each item is added. - sort : function(options) { - options || (options = {}); - if (!this.comparator) throw new Error('Cannot sort a set without a comparator'); - this.models = this.sortBy(this.comparator); - if (!options.silent) this.trigger('refresh', this, options); - return this; + // Return models with matching attributes. Useful for simple cases of + // `filter`. + where: function(attrs, first) { + return this[first ? 'find' : 'filter'](attrs); }, - // Pluck an attribute from each model in the collection. - pluck : function(attr) { - return _.map(this.models, function(model){ return model.get(attr); }); + // Return the first model with matching attributes. Useful for simple cases + // of `find`. + findWhere: function(attrs) { + return this.where(attrs, true); }, - // When you have more items than you want to add or remove individually, - // you can refresh the entire set with a new list of models, without firing - // any `added` or `removed` events. Fires `refresh` when finished. - refresh : function(models, options) { - models || (models = []); + // Force the collection to re-sort itself. You don't need to call this under + // normal circumstances, as the set will maintain sort order as each item + // is added. + sort: function(options) { + var comparator = this.comparator; + if (!comparator) throw new Error('Cannot sort a set without a comparator'); options || (options = {}); - this.each(this._removeReference); - this._reset(); - this.add(models, {silent: true}); - if (!options.silent) this.trigger('refresh', this, options); + + var length = comparator.length; + if (_.isFunction(comparator)) comparator = _.bind(comparator, this); + + // Run sort based on type of `comparator`. + if (length === 1 || _.isString(comparator)) { + this.models = this.sortBy(comparator); + } else { + this.models.sort(comparator); + } + if (!options.silent) this.trigger('sort', this, options); return this; }, - // Fetch the default set of models for this collection, refreshing the - // collection when they arrive. If `add: true` is passed, appends the - // models to the collection instead of refreshing. - fetch : function(options) { - options || (options = {}); - var collection = this; + // Pluck an attribute from each model in the collection. + pluck: function(attr) { + return this.map(attr + ''); + }, + + // Fetch the default set of models for this collection, resetting the + // collection when they arrive. If `reset: true` is passed, the response + // data will be passed through the `reset` method instead of `set`. + fetch: function(options) { + options = _.extend({parse: true}, options); var success = options.success; + var collection = this; options.success = function(resp) { - collection[options.add ? 'add' : 'refresh'](collection.parse(resp), options); - if (success) success(collection, resp); + var method = options.reset ? 'reset' : 'set'; + collection[method](resp, options); + if (success) success.call(options.context, collection, resp, options); + collection.trigger('sync', collection, resp, options); }; - options.error = wrapError(options.error, collection, options); - (this.sync || Backbone.sync).call(this, 'read', this, options); - return this; + wrapError(this, options); + return this.sync('read', this, options); }, - // Create a new instance of a model in this collection. After the model - // has been created on the server, it will be added to the collection. - create : function(model, options) { - var coll = this; - options || (options = {}); - if (!(model instanceof Backbone.Model)) { - var attrs = model; - model = new this.model(null, {collection: coll}); - if (!model.set(attrs)) return false; - } else { - model.collection = coll; - } + // Create a new instance of a model in this collection. Add the model to the + // collection immediately, unless `wait: true` is passed, in which case we + // wait for the server to agree. + create: function(model, options) { + options = options ? _.clone(options) : {}; + var wait = options.wait; + model = this._prepareModel(model, options); + if (!model) return false; + if (!wait) this.add(model, options); + var collection = this; var success = options.success; - options.success = function(nextModel, resp) { - coll.add(nextModel); - if (success) success(nextModel, resp); + options.success = function(m, resp, callbackOpts) { + if (wait) collection.add(m, callbackOpts); + if (success) success.call(callbackOpts.context, m, resp, callbackOpts); }; - return model.save(null, options); + model.save(null, options); + return model; }, // **parse** converts a response into a list of models to be added to the // collection. The default implementation is just to pass it through. - parse : function(resp) { + parse: function(resp, options) { return resp; }, - // Proxy to _'s chain. Can't be proxied the same way the rest of the - // underscore methods are proxied because it relies on the underscore - // constructor. - chain: function () { - return _(this.models).chain(); + // Create a new collection with an identical list of models as this one. + clone: function() { + return new this.constructor(this.models, { + model: this.model, + comparator: this.comparator + }); + }, + + // Define how to uniquely identify models in the collection. + modelId: function(attrs) { + return attrs[this.model.prototype.idAttribute || 'id']; }, - // Reset all internal state. Called when the collection is refreshed. - _reset : function(options) { + // Private method to reset all internal state. Called when the collection + // is first initialized or reset. + _reset: function() { this.length = 0; this.models = []; this._byId = {}; - this._byCid = {}; }, - // Internal implementation of adding a single model to the set, updating - // hash indexes for `id` and `cid` lookups. - _add : function(model, options) { - options || (options = {}); - if (!(model instanceof Backbone.Model)) { - model = new this.model(model, {collection: this}); + // Prepare a hash of attributes (or other model) to be added to this + // collection. + _prepareModel: function(attrs, options) { + if (this._isModel(attrs)) { + if (!attrs.collection) attrs.collection = this; + return attrs; } - var already = this.getByCid(model); - if (already) throw new Error(["Can't add the same model to a set twice", already.id]); - this._byId[model.id] = model; - this._byCid[model.cid] = model; - if (!model.collection) { - model.collection = this; + options = options ? _.clone(options) : {}; + options.collection = this; + var model = new this.model(attrs, options); + if (!model.validationError) return model; + this.trigger('invalid', this, model.validationError, options); + return false; + }, + + // Internal method called by both remove and set. + _removeModels: function(models, options) { + var removed = []; + for (var i = 0; i < models.length; i++) { + var model = this.get(models[i]); + if (!model) continue; + + var index = this.indexOf(model); + this.models.splice(index, 1); + this.length--; + + // Remove references before triggering 'remove' event to prevent an + // infinite loop. #3693 + delete this._byId[model.cid]; + var id = this.modelId(model.attributes); + if (id != null) delete this._byId[id]; + + if (!options.silent) { + options.index = index; + model.trigger('remove', model, this, options); + } + + removed.push(model); + this._removeReference(model, options); } - var index = this.comparator ? this.sortedIndex(model, this.comparator) : this.length; - this.models.splice(index, 0, model); - model.bind('all', this._onModelEvent); - this.length++; - if (!options.silent) model.trigger('add', model, this, options); - return model; + return removed; }, - // Internal implementation of removing a single model from the set, updating - // hash indexes for `id` and `cid` lookups. - _remove : function(model, options) { - options || (options = {}); - model = this.getByCid(model) || this.get(model); - if (!model) return null; - delete this._byId[model.id]; - delete this._byCid[model.cid]; - this.models.splice(this.indexOf(model), 1); - this.length--; - if (!options.silent) model.trigger('remove', model, this, options); - this._removeReference(model); - return model; + // Method for checking whether an object should be considered a model for + // the purposes of adding to the collection. + _isModel: function(model) { + return model instanceof Model; }, - // Internal method to remove a model's ties to a collection. - _removeReference : function(model) { - if (this == model.collection) { - delete model.collection; - } - model.unbind('all', this._onModelEvent); + // Internal method to create a model's ties to a collection. + _addReference: function(model, options) { + this._byId[model.cid] = model; + var id = this.modelId(model.attributes); + if (id != null) this._byId[id] = model; + model.on('all', this._onModelEvent, this); + }, + + // Internal method to sever a model's ties to a collection. + _removeReference: function(model, options) { + delete this._byId[model.cid]; + var id = this.modelId(model.attributes); + if (id != null) delete this._byId[id]; + if (this === model.collection) delete model.collection; + model.off('all', this._onModelEvent, this); }, // Internal method called every time a model in the set fires an event. // Sets need to update their indexes when models change ids. All other // events simply proxy through. "add" and "remove" events that originate // in other collections are ignored. - _onModelEvent : function(ev, model, collection, options) { - if ((ev == 'add' || ev == 'remove') && collection != this) return; - if (ev == 'destroy') { - this._remove(model, options); - } - if (ev === 'change:' + model.idAttribute) { - delete this._byId[model.previous(model.idAttribute)]; - this._byId[model.id] = model; + _onModelEvent: function(event, model, collection, options) { + if (model) { + if ((event === 'add' || event === 'remove') && collection !== this) return; + if (event === 'destroy') this.remove(model, options); + if (event === 'change') { + var prevId = this.modelId(model.previousAttributes()); + var id = this.modelId(model.attributes); + if (prevId !== id) { + if (prevId != null) delete this._byId[prevId]; + if (id != null) this._byId[id] = model; + } + } } this.trigger.apply(this, arguments); } @@ -616,42 +1190,301 @@ }); // Underscore methods that we want to implement on the Collection. - var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find', 'detect', - 'filter', 'select', 'reject', 'every', 'all', 'some', 'any', 'include', - 'invoke', 'max', 'min', 'sortBy', 'sortedIndex', 'toArray', 'size', - 'first', 'rest', 'last', 'without', 'indexOf', 'lastIndexOf', 'isEmpty']; + // 90% of the core usefulness of Backbone Collections is actually implemented + // right here: + var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0, + foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3, + select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3, + contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3, + head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3, + without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3, + isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3, + sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3}; // Mix in each Underscore method as a proxy to `Collection#models`. - _.each(methods, function(method) { - Backbone.Collection.prototype[method] = function() { - return _[method].apply(_, [this.models].concat(_.toArray(arguments))); - }; + addUnderscoreMethods(Collection, collectionMethods, 'models'); + + // Backbone.View + // ------------- + + // Backbone Views are almost more convention than they are actual code. A View + // is simply a JavaScript object that represents a logical chunk of UI in the + // DOM. This might be a single item, an entire list, a sidebar or panel, or + // even the surrounding frame which wraps your whole app. Defining a chunk of + // UI as a **View** allows you to define your DOM events declaratively, without + // having to worry about render order ... and makes it easy for the view to + // react to specific changes in the state of your models. + + // Creating a Backbone.View creates its initial element outside of the DOM, + // if an existing element is not provided... + var View = Backbone.View = function(options) { + this.cid = _.uniqueId('view'); + _.extend(this, _.pick(options, viewOptions)); + this._ensureElement(); + this.initialize.apply(this, arguments); + }; + + // Cached regex to split keys for `delegate`. + var delegateEventSplitter = /^(\S+)\s*(.*)$/; + + // List of view options to be set as properties. + var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; + + // Set up all inheritable **Backbone.View** properties and methods. + _.extend(View.prototype, Events, { + + // The default `tagName` of a View's element is `"div"`. + tagName: 'div', + + // jQuery delegate for element lookup, scoped to DOM elements within the + // current view. This should be preferred to global lookups where possible. + $: function(selector) { + return this.$el.find(selector); + }, + + // Initialize is an empty function by default. Override it with your own + // initialization logic. + initialize: function(){}, + + // **render** is the core function that your view should override, in order + // to populate its element (`this.el`), with the appropriate HTML. The + // convention is for **render** to always return `this`. + render: function() { + return this; + }, + + // Remove this view by taking the element out of the DOM, and removing any + // applicable Backbone.Events listeners. + remove: function() { + this._removeElement(); + this.stopListening(); + return this; + }, + + // Remove this view's element from the document and all event listeners + // attached to it. Exposed for subclasses using an alternative DOM + // manipulation API. + _removeElement: function() { + this.$el.remove(); + }, + + // Change the view's element (`this.el` property) and re-delegate the + // view's events on the new element. + setElement: function(element) { + this.undelegateEvents(); + this._setElement(element); + this.delegateEvents(); + return this; + }, + + // Creates the `this.el` and `this.$el` references for this view using the + // given `el`. `el` can be a CSS selector or an HTML string, a jQuery + // context or an element. Subclasses can override this to utilize an + // alternative DOM manipulation API and are only required to set the + // `this.el` property. + _setElement: function(el) { + this.$el = el instanceof Backbone.$ ? el : Backbone.$(el); + this.el = this.$el[0]; + }, + + // Set callbacks, where `this.events` is a hash of + // + // *{"event selector": "callback"}* + // + // { + // 'mousedown .title': 'edit', + // 'click .button': 'save', + // 'click .open': function(e) { ... } + // } + // + // pairs. Callbacks will be bound to the view, with `this` set properly. + // Uses event delegation for efficiency. + // Omitting the selector binds the event to `this.el`. + delegateEvents: function(events) { + events || (events = _.result(this, 'events')); + if (!events) return this; + this.undelegateEvents(); + for (var key in events) { + var method = events[key]; + if (!_.isFunction(method)) method = this[method]; + if (!method) continue; + var match = key.match(delegateEventSplitter); + this.delegate(match[1], match[2], _.bind(method, this)); + } + return this; + }, + + // Add a single event listener to the view's element (or a child element + // using `selector`). This only works for delegate-able events: not `focus`, + // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer. + delegate: function(eventName, selector, listener) { + this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener); + return this; + }, + + // Clears all callbacks previously bound to the view by `delegateEvents`. + // You usually don't need to use this, but may wish to if you have multiple + // Backbone views attached to the same DOM element. + undelegateEvents: function() { + if (this.$el) this.$el.off('.delegateEvents' + this.cid); + return this; + }, + + // A finer-grained `undelegateEvents` for removing a single delegated event. + // `selector` and `listener` are both optional. + undelegate: function(eventName, selector, listener) { + this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener); + return this; + }, + + // Produces a DOM element to be assigned to your view. Exposed for + // subclasses using an alternative DOM manipulation API. + _createElement: function(tagName) { + return document.createElement(tagName); + }, + + // Ensure that the View has a DOM element to render into. + // If `this.el` is a string, pass it through `$()`, take the first + // matching element, and re-assign it to `el`. Otherwise, create + // an element from the `id`, `className` and `tagName` properties. + _ensureElement: function() { + if (!this.el) { + var attrs = _.extend({}, _.result(this, 'attributes')); + if (this.id) attrs.id = _.result(this, 'id'); + if (this.className) attrs['class'] = _.result(this, 'className'); + this.setElement(this._createElement(_.result(this, 'tagName'))); + this._setAttributes(attrs); + } else { + this.setElement(_.result(this, 'el')); + } + }, + + // Set attributes from a hash on this view's element. Exposed for + // subclasses using an alternative DOM manipulation API. + _setAttributes: function(attributes) { + this.$el.attr(attributes); + } + }); - // Backbone.Controller - // ------------------- + // Backbone.sync + // ------------- + + // Override this function to change the manner in which Backbone persists + // models to the server. You will be passed the type of request, and the + // model in question. By default, makes a RESTful Ajax request + // to the model's `url()`. Some possible customizations could be: + // + // * Use `setTimeout` to batch rapid-fire updates into a single request. + // * Send up the models as XML instead of JSON. + // * Persist models via WebSockets instead of Ajax. + // + // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests + // as `POST`, with a `_method` parameter containing the true HTTP method, + // as well as all requests with the body as `application/x-www-form-urlencoded` + // instead of `application/json` with the model in a param named `model`. + // Useful when interfacing with server-side languages like **PHP** that make + // it difficult to read the body of `PUT` requests. + Backbone.sync = function(method, model, options) { + var type = methodMap[method]; + + // Default options, unless specified. + _.defaults(options || (options = {}), { + emulateHTTP: Backbone.emulateHTTP, + emulateJSON: Backbone.emulateJSON + }); + + // Default JSON-request options. + var params = {type: type, dataType: 'json'}; - // Controllers map faux-URLs to actions, and fire events when routes are + // Ensure that we have a URL. + if (!options.url) { + params.url = _.result(model, 'url') || urlError(); + } + + // Ensure that we have the appropriate request data. + if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) { + params.contentType = 'application/json'; + params.data = JSON.stringify(options.attrs || model.toJSON(options)); + } + + // For older servers, emulate JSON by encoding the request into an HTML-form. + if (options.emulateJSON) { + params.contentType = 'application/x-www-form-urlencoded'; + params.data = params.data ? {model: params.data} : {}; + } + + // For older servers, emulate HTTP by mimicking the HTTP method with `_method` + // And an `X-HTTP-Method-Override` header. + if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) { + params.type = 'POST'; + if (options.emulateJSON) params.data._method = type; + var beforeSend = options.beforeSend; + options.beforeSend = function(xhr) { + xhr.setRequestHeader('X-HTTP-Method-Override', type); + if (beforeSend) return beforeSend.apply(this, arguments); + }; + } + + // Don't process data on a non-GET request. + if (params.type !== 'GET' && !options.emulateJSON) { + params.processData = false; + } + + // Pass along `textStatus` and `errorThrown` from jQuery. + var error = options.error; + options.error = function(xhr, textStatus, errorThrown) { + options.textStatus = textStatus; + options.errorThrown = errorThrown; + if (error) error.call(options.context, xhr, textStatus, errorThrown); + }; + + // Make the request, allowing the user to override any Ajax options. + var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); + model.trigger('request', model, xhr, options); + return xhr; + }; + + // Map from CRUD to HTTP for our default `Backbone.sync` implementation. + var methodMap = { + 'create': 'POST', + 'update': 'PUT', + 'patch': 'PATCH', + 'delete': 'DELETE', + 'read': 'GET' + }; + + // Set the default implementation of `Backbone.ajax` to proxy through to `$`. + // Override this if you'd like to use a different library. + Backbone.ajax = function() { + return Backbone.$.ajax.apply(Backbone.$, arguments); + }; + + // Backbone.Router + // --------------- + + // Routers map faux-URLs to actions, and fire events when routes are // matched. Creating a new one sets its `routes` hash, if not set statically. - Backbone.Controller = function(options) { + var Router = Backbone.Router = function(options) { options || (options = {}); if (options.routes) this.routes = options.routes; this._bindRoutes(); - this.initialize(options); + this.initialize.apply(this, arguments); }; // Cached regular expressions for matching named param parts and splatted // parts of route strings. - var namedParam = /:([\w\d]+)/g; - var splatParam = /\*([\w\d]+)/g; - var escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g; + var optionalParam = /\((.*?)\)/g; + var namedParam = /(\(\?)?:\w+/g; + var splatParam = /\*\w+/g; + var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; - // Set up all inheritable **Backbone.Controller** properties and methods. - _.extend(Backbone.Controller.prototype, Backbone.Events, { + // Set up all inheritable **Backbone.Router** properties and methods. + _.extend(Router.prototype, Events, { // Initialize is an empty function by default. Override it with your own // initialization logic. - initialize : function(){}, + initialize: function(){}, // Manually bind a single named route to a callback. For example: // @@ -659,49 +1492,71 @@ // ... // }); // - route : function(route, name, callback) { - Backbone.history || (Backbone.history = new Backbone.History); + route: function(route, name, callback) { if (!_.isRegExp(route)) route = this._routeToRegExp(route); - Backbone.history.route(route, _.bind(function(fragment) { - var args = this._extractParameters(route, fragment); - callback.apply(this, args); - this.trigger.apply(this, ['route:' + name].concat(args)); - }, this)); + if (_.isFunction(name)) { + callback = name; + name = ''; + } + if (!callback) callback = this[name]; + var router = this; + Backbone.history.route(route, function(fragment) { + var args = router._extractParameters(route, fragment); + if (router.execute(callback, args, name) !== false) { + router.trigger.apply(router, ['route:' + name].concat(args)); + router.trigger('route', name, args); + Backbone.history.trigger('route', router, name, args); + } + }); + return this; }, - // Simple proxy to `Backbone.history` to save a fragment into the history, - // without triggering routes. - saveLocation : function(fragment) { - Backbone.history.saveLocation(fragment); + // Execute a route handler with the provided parameters. This is an + // excellent place to do pre-route setup or post-route cleanup. + execute: function(callback, args, name) { + if (callback) callback.apply(this, args); + }, + + // Simple proxy to `Backbone.history` to save a fragment into the history. + navigate: function(fragment, options) { + Backbone.history.navigate(fragment, options); + return this; }, // Bind all defined routes to `Backbone.history`. We have to reverse the // order of the routes here to support behavior where the most general // routes can be defined at the bottom of the route map. - _bindRoutes : function() { + _bindRoutes: function() { if (!this.routes) return; - var routes = []; - for (var route in this.routes) { - routes.unshift([route, this.routes[route]]); - } - for (var i = 0, l = routes.length; i < l; i++) { - this.route(routes[i][0], routes[i][1], this[routes[i][1]]); + this.routes = _.result(this, 'routes'); + var route, routes = _.keys(this.routes); + while ((route = routes.pop()) != null) { + this.route(route, this.routes[route]); } }, // Convert a route string into a regular expression, suitable for matching - // against the current location fragment. - _routeToRegExp : function(route) { - route = route.replace(escapeRegExp, "\\$&") - .replace(namedParam, "([^\/]*)") - .replace(splatParam, "(.*?)"); - return new RegExp('^' + route + '$'); + // against the current location hash. + _routeToRegExp: function(route) { + route = route.replace(escapeRegExp, '\\$&') + .replace(optionalParam, '(?:$1)?') + .replace(namedParam, function(match, optional) { + return optional ? match : '([^/?]+)'; + }) + .replace(splatParam, '([^?]*?)'); + return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); }, // Given a route, and a URL fragment that it matches, return the array of - // extracted parameters. - _extractParameters : function(route, fragment) { - return route.exec(fragment).slice(1); + // extracted decoded parameters. Empty or unmatched parameters will be + // treated as `null` to normalize cross-browser behavior. + _extractParameters: function(route, fragment) { + var params = route.exec(fragment).slice(1); + return _.map(params, function(param, i) { + // Don't decode the search params. + if (i === params.length - 1) return param || null; + return param ? decodeURIComponent(param) : null; + }); } }); @@ -709,377 +1564,357 @@ // Backbone.History // ---------------- - // Handles cross-browser history management, based on URL hashes. If the - // browser does not support `onhashchange`, falls back to polling. - Backbone.History = function() { + // Handles cross-browser history management, based on either + // [pushState](http://diveintohtml5.info/history.html) and real URLs, or + // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) + // and URL fragments. If the browser supports neither (old IE, natch), + // falls back to polling. + var History = Backbone.History = function() { this.handlers = []; - this.fragment = this.getFragment(); - _.bindAll(this, 'checkUrl'); + this.checkUrl = _.bind(this.checkUrl, this); + + // Ensure that `History` can be used outside of the browser. + if (typeof window !== 'undefined') { + this.location = window.location; + this.history = window.history; + } }; - // Cached regex for cleaning hashes. - var hashStrip = /^#*/; + // Cached regex for stripping a leading hash/slash and trailing space. + var routeStripper = /^[#\/]|\s+$/g; + + // Cached regex for stripping leading and trailing slashes. + var rootStripper = /^\/+|\/+$/g; + + // Cached regex for stripping urls of hash. + var pathStripper = /#.*$/; // Has the history handling already been started? - var historyStarted = false; + History.started = false; // Set up all inheritable **Backbone.History** properties and methods. - _.extend(Backbone.History.prototype, { + _.extend(History.prototype, Events, { // The default interval to poll for hash changes, if necessary, is // twenty times a second. interval: 50, - // Get the cross-browser normalized URL fragment. - getFragment : function(loc) { - return (loc || window.location).hash.replace(hashStrip, ''); + // Are we at the app root? + atRoot: function() { + var path = this.location.pathname.replace(/[^\/]$/, '$&/'); + return path === this.root && !this.getSearch(); }, - // Start the hash change handling, returning `true` if the current URL matches - // an existing route, and `false` otherwise. - start : function() { - if (historyStarted) throw new Error("Backbone.history has already been started"); - var docMode = document.documentMode; - var oldIE = ($.browser.msie && (!docMode || docMode <= 7)); - if (oldIE) { - this.iframe = $(' +
+ + + + + + + + Get Microsoft Silverlight + + +

4. View the source code online or Download:

The complete source code for this example is - + viewable online or available to download as zip package from the link below: - - Download ServiceStack.Examples.zip + + Download ServiceStack.Examples.zip

- - diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx index 407cde11..ea6cf1f1 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx @@ -10,23 +10,22 @@ - Service Stack Demo + ServiceStack /></a>
 
     <h1>Trying ServiceStack's SOAP 1.1 Web Service Examples</h1>
     
     <div class= Testing ServiceStack's SOAP 1.1 Web services using VS.NET 'Add Service Reference' code-generated proxy.
- The source code for this ASP.NET page is
available here. + The source code for this ASP.NET page is available here.
@@ -133,7 +132,7 @@ or available to download as zip package from the link below: - Download ServiceStack.Examples.zip + Download ServiceStack.Examples.zip

@@ -144,7 +143,7 @@ Ajax Stack | - Service Stack + Service Stack diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.cs b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.cs index e637488e..2e819e24 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.cs +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.cs @@ -21,11 +21,9 @@ public partial class Soap11 : System.Web.UI.Page }, new EndpointAddress(EndpointUri)); - protected void Page_Load(object sender, EventArgs e) - { - } + protected void Page_Load(object sender, EventArgs e) { } - protected void btnGetFactorial_Click(object sender, EventArgs e) + protected void BtnGetFactorial_Click(object sender, EventArgs e) { litGetFactorialResult.Text = litGetFactorialError.Text = ""; try @@ -40,7 +38,7 @@ protected void btnGetFactorial_Click(object sender, EventArgs e) } } - protected void btnGetFibonacci_Click(object sender, EventArgs e) + protected void BtnGetFibonacci_Click(object sender, EventArgs e) { litGetFibonacciResult.Text = litGetFibonacciError.Text = ""; try @@ -61,7 +59,7 @@ protected void btnGetFibonacci_Click(object sender, EventArgs e) } } - protected void btnStoreNewUser_Click(object sender, EventArgs e) + protected void BtnStoreNewUser_Click(object sender, EventArgs e) { litStoreNewUserResult.Text = litStoreNewUserError.Text = ""; try @@ -96,7 +94,7 @@ protected void btnStoreNewUser_Click(object sender, EventArgs e) } } - protected void btnDeleteAllUsers_Click(object sender, EventArgs e) + protected void BtnDeleteAllUsers_Click(object sender, EventArgs e) { litStoreNewUserResult.Text = litStoreNewUserError.Text = ""; try @@ -111,7 +109,7 @@ protected void btnDeleteAllUsers_Click(object sender, EventArgs e) } } - protected void btnGetUsers_Click(object sender, EventArgs e) + protected void BtnGetUsers_Click(object sender, EventArgs e) { litGetUsersResult.Text = litGetUsersError.Text = ""; try diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.designer.cs b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.designer.cs index 9f695642..fc1f890c 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.designer.cs +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap11.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4952 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx index f18f5693..f65ac195 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx @@ -10,24 +10,22 @@ - Service Stack Demo + ServiceStack

Trying ServiceStack's SOAP 1.2 Web Service Examples

Testing ServiceStack's SOAP 1.2 Web services using VS.NET 'Add Service Reference' code-generated proxy.
- The source code for this ASP.NET page is available here. + The source code for this ASP.NET page is available here.
@@ -133,7 +131,7 @@ or available to download as zip package from the link below: - Download ServiceStack.Examples.zip + Download ServiceStack.Examples.zip

@@ -144,7 +142,7 @@ Ajax Stack | - Service Stack + Service Stack diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx.designer.cs b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx.designer.cs index 072fdb26..589f4eee 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx.designer.cs +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/Soap12.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4952 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/clientaccesspolicy.xml b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/clientaccesspolicy.xml index 513ee371..a5c67474 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/clientaccesspolicy.xml +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/clientaccesspolicy.xml @@ -1,7 +1,8 @@ - + + - + diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.css b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.css index 408ccbff..f6ff43d8 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.css +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.css @@ -1,36 +1,49 @@ -BODY -{ - background: #fff url(img/bg-body-1024.png) repeat-y top left; +body { + background: #fff url(img/bg-body-1024.png) repeat-y top center; font: normal normal normal 13.34px/normal helvetica, arial, freesans, clean, sans-serif; - padding: 10px 5px 20px 10px; width: 940px; + margin:0 auto; } -#header-links -{ - top: 10px; - left:270px; - position: absolute; + +p { + padding: 0 10px; } -#header-links A, #footer-links A -{ + +#logo { + position: relative; + top: 5px; + left: 10px; + text-decoration: none; +} + +#header-links { + position: relative; + display: inline; + left: 240px; +} + +#header-links A { color: #0000FF; margin-left: 0.5em; } + +#github { + clear: right; + padding: 12px 18px 0 0; + float: right; +} +#github img { + height: 64px; +} + #footer-links { - margin: 9em 0 2em; - padding-top: 1em; + padding: 1em; text-align: center; font-size: larger; border-top: 1px solid #DCDCDC; - margin-left: -10px; - padding-left: 10px; -} -#footer-links IMG -{ - float: left; - margin-top: -10px; } + .r { clear: both; @@ -40,27 +53,24 @@ A IMG { border: none; } -P -{ - width: 768px; -} + CODE { display: block; background-color: #F1F9F1; white-space: pre; color: #333; - width: 880px; + padding: 10px; } -H1 -{ + +h1 { font: 28px/34px "Trebuchet MS"; color: #063; border-top: 1px solid #DCDCDC; padding-top: 5px; - padding-left: 10px; - margin-left: -10px; + margin-top: 60px; } + H4 { clear: left; @@ -80,10 +90,9 @@ ACRONYM { background-color: rgb(249, 246, 183); border: 1px solid rgb(196, 194, 149); - margin: 1ex 0px; + margin: 10px; min-height: 35px; - width: 700px; - padding: 5px 30px; + padding: 5px; } .service { @@ -137,8 +146,7 @@ ACRONYM { display: none; position: absolute; - margin: 10px 0; - left: 2em; + margin: 10px; border: 5px solid #555; border-top: none; } @@ -166,10 +174,7 @@ ACRONYM { background-color: #F5F9C7; } -#silverlightControlHost -{ - width: 1041px; -} + .soap-page FORM { @@ -203,4 +208,5 @@ ACRONYM display: block; margin: 15px 0; text-align: center; + text-decoration :none; } diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.htm b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.htm index e074f64f..afe143ac 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.htm +++ b/src/ServiceStack.Examples/ServiceStack.Examples.Clients/default.htm @@ -19,7 +19,6 @@ $(function() { - $("#btnGetFactorial").click(function() { gateway.getFromService({ @@ -27,7 +26,8 @@ }, function(e) { $("#serviceGetFactorial .result").html(e.Result); - }); + } + ); }); $("#btnGetFibonacciNumbers").click(function() @@ -108,7 +108,7 @@ var codePreview = link.next(); if (codePreview.is(":visible")) { - codePreview.slideUp(function() + codePreview.slideUp(function () { link.html("show"); }); @@ -125,30 +125,33 @@ }); }); - --> + + - Service Stack Demo + + GitHub +

Calling ServiceStack Web Services with Ajax

For performance reasons, the preferred to call ServiceStack services for Ajax clients - is using JSON via the JSON endpoint at:
- ~/servicestack/json/reply/{ServiceName} + is using JSON via the JSON endpoint at:  + /servicestack/json/reply/{ServiceName}

As this endpoint is just a standard JSON service we can use any ajax client to call them with. @@ -156,69 +159,64 @@

Calling ServiceStack Web Services with Ajax

1. First step is to initialize the ServiceClient

- - //Create a ClientGateway passing in the baseUrl where your services are hosted. - var gateway = new servicestack.ClientGateway( - location.protocol + "//" + location.host + '/ServiceStack.Examples.Host.Web/ServiceStack/'); - + //Create a ClientGateway passing in the baseUrl where your services are hosted. +var gateway = new servicestack.ClientGateway( + location.protocol + "//" + location.host + '/ServiceStack/');

2. After that calling a service becomes as easy as:

- - gateway.getFromService({ - GetFactorial: { ForNumber: $("#txtGetFactorial").val() } - }, - function(e) { - $("#serviceGetFactorial .result").html(e.Result); - }); - + gateway.getFromService({ + GetFactorial: { ForNumber: $("#txtGetFactorial").val() } + }, + function(e) { + $("#serviceGetFactorial .result").html(e.Result); +});

3. Try the live examples yourself:

-
public class GetFactorialService : Service { - public GetFactorialResponse Any(GetFactorial request) + public object Any(GetFactorial request) { return new GetFactorialResponse { Result = GetFactorial(request.ForNumber) }; } static long GetFactorial(long n) { - return n > 1 ? n * GetFactorial(n - 1) : 1; + var result = 1L; + while (n >= 2) + { + checked { result *= n; n--; } + } + return result; } } } \ No newline at end of file diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetFibonacciNumbersService.cs b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetFibonacciNumbersService.cs index f22415b9..3eda7567 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetFibonacciNumbersService.cs +++ b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetFibonacciNumbersService.cs @@ -19,7 +19,7 @@ public GetFibonacciNumbersService(ExampleConfig config) this.config = config; } - public GetFibonacciNumbersResponse Any(GetFibonacciNumbers request) + public object Any(GetFibonacciNumbers request) { var skip = request.Skip.GetValueOrDefault(0); var take = request.Take.GetValueOrDefault(config.DefaultFibonacciLimit); diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetUsersService.cs b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetUsersService.cs index 02a96d71..332fc48d 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetUsersService.cs +++ b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/GetUsersService.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; +using ServiceStack.OrmLite; using ServiceStack.Examples.ServiceModel; using ServiceStack.Examples.ServiceModel.Types; -using ServiceStack.OrmLite; namespace ServiceStack.Examples.ServiceInterface { @@ -13,7 +13,7 @@ namespace ServiceStack.Examples.ServiceInterface ///
public class GetUsersService : Service { - public GetUsersResponse Any(GetUsers request) + public object Any(GetUsers request) { var users = new List(); diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/MovieRestService.cs b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/MovieRestService.cs index 9c8ee644..b57958f5 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/MovieRestService.cs +++ b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/MovieRestService.cs @@ -1,7 +1,6 @@ +using ServiceStack.OrmLite; using ServiceStack.Examples.ServiceModel; using ServiceStack.Examples.ServiceModel.Types; -using ServiceStack.Logging; -using ServiceStack.OrmLite; namespace ServiceStack.Examples.ServiceInterface { @@ -14,8 +13,6 @@ namespace ServiceStack.Examples.ServiceInterface ///
public class MovieRestService : Service { - private static readonly ILog Log = LogManager.GetLogger(typeof(MovieRestService)); - public object Any(Movies request) { return Get(request); @@ -29,10 +26,6 @@ public object Any(Movies request) /// public object Get(Movies request) { - //Alternatively you can infer the HTTP method by inspecting the RequestContext attributes - Log.InfoFormat("Using RequestContext to inspect Endpoint attributes: {0}", - this.Request.RequestAttributes); - var response = new MoviesResponse(); if (request.Id != null) @@ -60,7 +53,7 @@ public object Get(Movies request) /// public object Put(Movies request) { - Db.Insert(request.Movie); + Db.Update(request.Movie); return new MoviesResponse(); } @@ -84,7 +77,7 @@ public object Delete(Movies request) /// public object Post(Movies request) { - Db.Update(request.Movie); + Db.Insert(request.Movie); return new MoviesResponse(); } diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ResetMovieDatabaseService.cs b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ResetMovieDatabaseService.cs index e808a595..c7efcd49 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ResetMovieDatabaseService.cs +++ b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ResetMovieDatabaseService.cs @@ -1,8 +1,8 @@ using ServiceStack.Data; +using ServiceStack.OrmLite; using ServiceStack.Examples.ServiceInterface.Support; using ServiceStack.Examples.ServiceModel; using ServiceStack.Examples.ServiceModel.Types; -using ServiceStack.OrmLite; namespace ServiceStack.Examples.ServiceInterface { diff --git a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ServiceStack.Examples.ServiceInterface.csproj b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ServiceStack.Examples.ServiceInterface.csproj index 49d7fdb4..f9082c79 100644 --- a/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ServiceStack.Examples.ServiceInterface.csproj +++ b/src/ServiceStack.Examples/ServiceStack.Examples.ServiceInterface/ServiceStack.Examples.ServiceInterface.csproj @@ -56,28 +56,28 @@ - ..\..\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\..\lib\ServiceStack.dll - ..\..\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\..\lib\ServiceStack.Client.dll - ..\..\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\..\lib\ServiceStack.Common.dll - ..\..\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + False + ..\..\..\lib\ServiceStack.Interfaces.dll - ..\..\packages\ServiceStack.OrmLite.4.5.0\lib\net45\ServiceStack.OrmLite.dll - True + False + ..\..\..\lib\ServiceStack.OrmLite.dll - ..\..\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\..\lib\ServiceStack.Text.dll @@ -96,7 +96,6 @@ - @@ -131,9 +130,6 @@ true - - - + - + + - - - + - - - - - + - \ No newline at end of file diff --git a/src/ServiceStack.Hello/default.htm b/src/ServiceStack.Hello/default.htm index ae0d8649..12e3551c 100644 --- a/src/ServiceStack.Hello/default.htm +++ b/src/ServiceStack.Hello/default.htm @@ -1,89 +1,82 @@ - + Tutorial - Creating a Hello World ServiceStack Web Service - - ServiceStack Home + + - - -

- Creating a Web service from scratch with Service Stack

+ + + GitHub + + +

Creating a Web Service from Scratch with ServiceStack

- This tutorial will go through and develop and call a simple Hello world Web Service - from scratch using Service Stack and VS.NET. + This tutorial will go through and develop and call a simple hello world web service + from scratch using ServiceStack and VS.NET.

- -

- Installing via NuGet

+

Install Automatically

- If you have NuGet you can skip steps 1 - 3 below by installing one of the NuGet - Host packages below: + You can skip steps 1 - 3 below by installing one of the NuGet Host packages below:

- Install ServiceStack Only at root path - / + Install ServiceStack Only at root path /

Create an empty ASP.NET Web Application and

-

PM> Install-Package ServiceStack.Host.AspNet
+
PM> Install-Package ServiceStack.Host.AspNet

- Install ServiceStack Side-by-Side with ASP.NET MVC at custom path /api + Install ServiceStack Side-by-Side with ASP.NET MVC at custom path /api

Create an empty ASP.NET MVC Web Application and

-

PM> Install-Package ServiceStack.Host.Mvc
+
PM> Install-Package ServiceStack.Host.Mvc

- Completing the NuGet Installation

+ Completing the NuGet Installation +

The NuGet package provides an AppHost template in your project at App_Start\AppHost.cs - and some App_Start\WebServiceExamples.cs to get you started. -

-

- After looking at the README.txt - Skip the Manual Installation instructions + and some WebServiceExamples.cs to get you started. After looking at the README.txt - Skip the Manual Installation instructions below and start exploring ServiceStack features at:

-

- Viewing your Web Service >>

+

Viewing your Web Service >>

- -

- Install Manually - 1. Creating your application

+

Install Manually - 1. Creating your application

Create a new ASP.NET Web Application by going into Visual Studio and selecting File -> New -> Project on the File menu.

- New ASP.NET Project

-

- 2. Configuring Service Stack to run in your application

+ New ASP.NET Project +

+

2. Configuring ServiceStack to run in your application

Add a reference to the ServiceStack dlls with:

-

PM> Install-Package ServiceStack
+
PM> Install-Package ServiceStack

@@ -91,173 +84,167 @@

application Web.config:

- a) You do not require an existing Web Framework - Host from - the root path: /

+ a) You do not require an existing Web Framework - Host from the root path: /

You can host at the root path / when you don't need to use an existing Web Framework with your ServiceStack web services (i.e. project only has static files)

- The configuration below allows you to host your webservices from the root path: - /

+ The configuration below allows you to host your webservices from the root path:/ + -    <system.web> -      <httpHandlers> -        <add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*"/> -      </httpHandlers> -    </system.web> +  <!-- ServiceStack: Required for IIS 6/Mono --> +  <system.web> +    <httpHandlers> +      <add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*"/> +    </httpHandlers> +  </system.web> -    <!-- Required for IIS7 --> -    <system.webServer> -      <modules runAllManagedModulesForAllRequests="true"/> -      <validation validateIntegratedModeConfiguration="false" /> -      <handlers> -        <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /> -      </handlers> -    </system.webServer> +  <!-- ServiceStack: Required for IIS 7+ --> +  <system.webServer> +    <modules runAllManagedModulesForAllRequests="true"/> +    <validation validateIntegratedModeConfiguration="false"/> +    <handlers> +      <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true"/> +    </handlers> +  </system.webServer>

b) You want to use ServiceStack with an existing Web Framework - Host web services at: /custompath

-

+

In order to avoid conflicts with your existing ASP.NET web framework it is recommended - to host your ServiceStack web services at a custom path.
- This will allow you to use ServiceStack together with an existing web framework - e.g. ASP.NET MVC 3 or - FUBU MVC, etc. + to host your ServiceStack web services at a custom path. This will allow you to use ServiceStack together with an existing web framework + e.g. ASP.NET MVC or FUBU MVC, etc.

- The location configuration below hosts your webservices at custom path: /api

+ The location configuration below hosts your webservices at custom path: /servicestack -  <!-- ServiceStack: Required to host at: /servicestack --> -  <location path="api"> +  <!-- ServiceStack: Required to host at: /custompath --> +  <location path="servicestack">     <system.web>       <httpHandlers>         <add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*"/>       </httpHandlers>     </system.web> -    <!-- Required for IIS7 --> +    <!-- ServiceStack: Required for IIS 7+ -->     <system.webServer>       <modules runAllManagedModulesForAllRequests="true"/> -      <validation validateIntegratedModeConfiguration="false" />       <handlers> -        <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /> +        <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true"/>       </handlers>     </system.webServer>   </location> -  <!-- Required for MONO --> +  <!-- ServiceStack: Required for MONO -->   <system.web>     <httpHandlers> -      <add path="api*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*"/> +      <add path="servicestack*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*"/>     </httpHandlers>   </system.web> -  <!-- Required for IIS7 --> +  <!-- ServiceStack: Required for IIS 7+ -->   <system.webServer> -    <!-- ServiceStack: Required -->     <validation validateIntegratedModeConfiguration="false"/>   </system.webServer>

Note: Due to limitations in IIS 6 - the /custompath must end with .ashx, - e.g: path="api.ashx" + e.g: path="servicestack.ashx"

To avoid conflicts with ASP.NET MVC add ignore rule in Global.asax RegisterRoutes - method e.g: routes.IgnoreRoute ("api/{*pathInfo}"); + method e.g: routes.IgnoreRoute ("servicestack/{*pathInfo}");

-

- 3. Creating your first Web Service

+

3. Creating your first Web Service

For simplicity we will add the Web Service and the start up script all in the same - Global.asax.cs. To do this Right-click on your project and go -
- Add -> New Item then select the Global Application class. + Global.asax.cs. To do this Right-click on your project and go Add -> New Item then select the Global Application class.

Within the same file add the following code:

1. Create the name of your Web Service (i.e. the Request DTO)

-     /// <summary> -    /// Define your ServiceStack web service request (i.e. the Request DTO). -    /// </summary>     -    public class Hello -    { -        public string Name { getset; } -    } +   /// <summary> +  /// Define your ServiceStack web service request (i.e. the Request DTO). +  /// </summary>     +  public class Hello +  { +    public string Name { getset; } +  }

2. Define what your Web Service will return (i.e. Response DTO)

-     /// <summary> -    /// Define your ServiceStack web service response (i.e. Response DTO). -    /// </summary> -    public class HelloResponse -    { -        public string Result { getset; } -    } +   /// <summary> +  /// Define your ServiceStack web service response (i.e. Response DTO). +  /// </summary> +  public class HelloResponse +  { +    public string Result { getset; } +  }

3. Create your Web Service implementation

-     /// <summary> -    /// Create your ServiceStack web service implementation. -    /// </summary> -    public class HelloService : IService +   /// <summary> +  /// Create your ServiceStack web service implementation. +  /// </summary> +  public class HelloService : IService +  { +    public object Any(Hello request)     { -        public object Any(Hello request) -        { -            //Looks strange when the name is null so we replace with a generic name. -            var name = request.Name ?? "John Doe"; -            return new HelloResponse { Result = "Hello, " + name }; -        } +      //Looks strange when the name is null so we replace with a generic name. +      return new HelloResponse { Result = "Hello, " + request.Name ?? "John Doe" };     } +  } -

- Registering your web services and starting your application

- The final step is to Configure setup to tell Service Stack where to find your web - services: +

+ 4. Registering your web services and starting your application

+

+ The final step is to configure setup to tell ServiceStack where to find your web services: +

Web Service AppHost Singleton

-     public class Global : System.Web.HttpApplication +   public class Global : System.Web.HttpApplication +  { +    /// <summary> +    /// Create your ServiceStack web service application with a singleton AppHost. +    /// </summary>         +    public class HelloAppHost : AppHostBase     { -        /// <summary> -        /// Create your ServiceStack web service application with a singleton AppHost. -        /// </summary>         -        public class HelloAppHost : AppHostBase -        { -            /// <summary> -            /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. -            /// </summary> -            public HelloAppHost() : base("Hello Web Services"typeof(HelloService).Assembly) { } - -            /// <summary> -            /// Configure the container with the necessary routes for your ServiceStack application. -            /// </summary> -            /// <param name="container">The built-in IoC used with ServiceStack.</param> -            public override void Configure(Container container) -            { -                //Register user-defined REST-ful urls. You can access the service at the url similar to the following. -                //http://localhost/ServiceStack.Hello/servicestack/hello or http://localhost/ServiceStack.Hello/servicestack/hello/John%20Doe -                //You can change /servicestack/ to a custom path in the web.config. -                Routes -                  .Add<Hello>("/hello") -                  .Add<Hello>("/hello/{Name}"); -            } -        } - -        protected void Application_Start(object sender, EventArgs e) -        { -            //Initialize your application -            (new HelloAppHost()).Init(); -        } +      /// <summary> +      /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. +      /// </summary> +      public HelloAppHost() : base("Hello Web Services"typeof(HelloService).Assembly) { } + +      /// <summary> +      /// Configure the container with the necessary routes for your ServiceStack application. +      /// </summary> +      /// <param name="container">The built-in IoC used with ServiceStack.</param> +      public override void Configure(Container container) +      { +        Plugins.Add(new SoapFormat()); + +        //Register user-defined REST-ful urls. You can access the service at the url similar to the following. +        //http://localhost:62577/servicestack/hello or http://localhost:62577/servicestack/hello/John%20Doe +        //You can change /servicestack/ to a custom path in the web.config. +        Routes +          .Add<Hello>("/hello") +          .Add<Hello>("/hello/{Name}"); +      }     } + +    protected void Application_Start(object sender, EventArgs e) +    { +      //Initialize your application +      new HelloAppHost().Init(); +    } +  }

Done! You now have a working application :)

-

- Viewing your Web Services

+

Viewing your Web Services

Now that you have a working Web Service lets see what ServiceStack does for you out of the box: @@ -266,22 +253,21 @@

The Web Service Index Metadata page

If everything is configured correctly you can go to the - /api/metadata to see a list of your web services and the - various end points its available on. + /servicestack/metadata to see a list of your web services and the + various end points it's available on.

- Service Stack Metadata page

-

- The Metadata page contains: + ServiceStack Metadata page

+
+ The metadata page contains:
    -
  • A list of all your webservices and the endpoints they are available on.
  • +
  • A list of all your web services and the endpoints they are available on.
  • A list of coding examples showing you how to call each endpoint a number of different ways.
  • Links to all the XSD types used by your web services
  • Links to the web services SOAP 1.1 / 1.2 WSDLs
-

+

The different ways of calling your Web Service

@@ -292,28 +278,26 @@

XML (POX), JSON, JSV, CSV urls

- /api/[xml|json|html|jsv|csv]/[reply|oneway]/[servicename] + /servicestack/[xml|json|html|jsv|csv]/[reply|oneway]/[servicename]

- SOAP Web Service urls

+ SOAP Web Service WSDL urls

- /api/[soap11|soap12] + /servicestack/[soap11|soap12]

User defined REST-ful urls

- Accessible via any REST-ful urls defined using the [RestService] Attribute. e.g. - in this case: + Accessible via any REST-ful urls defined using the [Route] Attribute. e.g. in this case:

- /api/hello/{Name} + /servicestack/hello/{Name}

-

- XML, JSON, - HTML5, - JSV, + XML, JSON, + HTML5, + JSV, CSV Web Services via HTTP GET or POST

@@ -338,15 +322,14 @@

XML

- /api/xml/reply/Hello?Name=World + /servicestack/xml/reply/Hello?Name=World - /api/xml/reply/Hello + /servicestack/xml/metadata?op=Hello - - + + @@ -357,15 +340,14 @@

JSON

- /api/json/reply/Hello?Name=World + /servicestack/json/reply/Hello?Name=World - /api/json/reply/Hello + /servicestack/json/metadata?op=Hello -
- + +
@@ -376,15 +358,14 @@

HTML

- /api/html/reply/Hello?Name=World + /servicestack/html/reply/Hello?Name=World - /api/html/reply/Hello + -
- + +
@@ -395,15 +376,14 @@

JSV

- /api/jsv/reply/Hello?Name=World + /servicestack/jsv/reply/Hello?Name=World - /api/jsv/reply/Hello + /servicestack/jsv/metadata?op=Hello -
- + +
@@ -414,15 +394,14 @@

CSV

- /api/csv/reply/Hello?Name=World + /servicestack/csv/reply/Hello?Name=World - /api/csv/reply/Hello + /servicestack/csv/metadata?op=Hello -
- + +
@@ -442,9 +421,9 @@

the request.

- NOTE: Service Stack also lets you submit any arbitary complex type (using JSV format) - via the query string or form data: + NOTE: ServiceStack also lets you submit any arbitary complex type (using JSV format) + via the query string or form data: see this example.

@@ -460,22 +439,22 @@

Content-Types allowing you to call each web service using a HTML FORM. Here is the HTML for the live examples:

- <form action="api/xml/syncreply/Hello" method="post"> + <form action="servicestack/xml/reply/Hello" method="post">    <label>Name:</label>    <input type="text" name="Name" value="World!" />    <input type="submit" /> </form> -

- Example:
-

- +
+ Example: + + -

-

- SOAP Web Services

+
+

SOAP Web Services

+

If you want to support SOAP, you have to ensure you adhere to some additional constraints where each method needs to be defined with the Any() or Post() and each DTO needs to be + decorated with [DataContract] and [DataMember] attributes so their metadata is generated in your Services XSD and WSDL metadata.

@@ -496,10 +475,10 @@

SOAP 1.1

@@ -507,10 +486,10 @@

SOAP 1.2

@@ -530,23 +509,23 @@

REST Web Services

- A new addition to Service Stack is the ability to define your own custom urls letting + A new addition to ServiceStack is the ability to define your own custom urls letting you expose your web services via REST-ful urls.

-

+

Defining user-defined REST-ful urls can be done in one of two ways:
  • Using the MVC-like Routes config property in your AppHost
  • -
  • Using the [RestService] Attribute on your Request DTOs
  • +
  • Using the [RouteAttribute] Attribute on your Request DTOs
-

+

e.g: the following mapping:

[Route("/hello/{Name}")]

Allows this web service to be called with: - /api/hello/World! + /servicestack/hello/World!

Just like the other endpoints, REST-ful urls can also be called with a HTML FORM @@ -558,20 +537,19 @@

Which lets us now call this web service using the following HTML:

- <form action="api/hello?format=json" method="post"> + <form action="servicestack/hello?format=json" method="post">    <label>Name:</label>    <input type="text" name="Name" value="World!" />    <input type="submit" /> </form> -

+

Example:
- + -

+

This makes it very easy to Ajax-ify your existing HTML forms, cleanly, without messy configuration and generated code mandated by other options. @@ -587,28 +565,27 @@

All REST and ServiceClients share the same interfaces so they can easily be replaced (for increased perf/debuggability/etc) with a single line of code as seen in the - + Hello Service Integration tests.

- C#/.NET Clients can call the above Hello Service using any of the + C#/.NET Clients can call the above Hello Service using any of the JSON, JSV, XML or SOAP Service Clients as well as a - Silverlight, - JavaScript, - Dart or even - MQ Client. + Silverlight, + JavaScript, + Dart or even + MQ Client. +

-

- Where to now?

-

- Northwind Database Examples

+

Where to now?

+

Northwind Database Examples

Now that you've got the hang of how easy it is to create a simple web service, check - out the Northwind Database + out the Northwind Database examples to see how useful servicestack becomes with just a little db code.

- + - + \ No newline at end of file diff --git a/src/ServiceStack.Hello/packages.config b/src/ServiceStack.Hello/packages.config deleted file mode 100644 index 6b7d575f..00000000 --- a/src/ServiceStack.Hello/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/ServiceStack.MovieRest.sln b/src/ServiceStack.MovieRest/ServiceStack.MovieRest.sln index 478b505f..4a8ef66a 100644 --- a/src/ServiceStack.MovieRest/ServiceStack.MovieRest.sln +++ b/src/ServiceStack.MovieRest/ServiceStack.MovieRest.sln @@ -1,15 +1,10 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2002 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.MovieRest", "Web\ServiceStack.MovieRest.csproj", "{EE3EB8BB-A24E-4F71-8277-1C6DAE652E2C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{5C8E3CA4-FE3E-4E64-B089-047A8DC53974}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.Config = .nuget\NuGet.Config - .nuget\NuGet.exe = .nuget\NuGet.exe - .nuget\NuGet.targets = .nuget\NuGet.targets - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -24,6 +19,9 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7CB5ED52-F8F4-4A44-BFD0-BD842C819187} + EndGlobalSection GlobalSection(CodealikeProperties) = postSolution SolutionGuid = e2c4be4e-fd9d-4744-8aa5-3a4c14aca0ef EndGlobalSection diff --git a/src/ServiceStack.MovieRest/Web/App_Start/AppHost.cs b/src/ServiceStack.MovieRest/Web/App_Start/AppHost.cs deleted file mode 100644 index fa7840fb..00000000 --- a/src/ServiceStack.MovieRest/Web/App_Start/AppHost.cs +++ /dev/null @@ -1,39 +0,0 @@ - -namespace ServiceStack.MovieRest.App_Start -{ - using Funq; - using OrmLite; - using Text; - using Data; - - public class AppHost - : AppHostBase - { - /// - /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. - /// - public AppHost() : base("ServiceStack REST at the Movies!", typeof (MovieService).Assembly) {} - - public override void Configure(Container container) - { - JsConfig.DateHandler = DateHandler.ISO8601; - - //Set JSON web services to return idiomatic JSON camelCase properties - JsConfig.EmitCamelCaseNames = true; - - container.Register( - c => new OrmLiteConnectionFactory("~/App_Data/db.sqlite".MapHostAbsolutePath(), SqliteDialect.Provider)); - - using (var resetMovies = container.Resolve()) - { - resetMovies.Any(null); - } - - Plugins.Add(new CorsFeature()); //Enable CORS - - SetConfig(new HostConfig { - DebugMode = true //Show StackTraces for easier debugging (default auto inferred by Debug/Release builds) - }); - } - } -} \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/App_Start/MovieRestAppHost.cs b/src/ServiceStack.MovieRest/Web/App_Start/MovieRestAppHost.cs new file mode 100644 index 00000000..3451092e --- /dev/null +++ b/src/ServiceStack.MovieRest/Web/App_Start/MovieRestAppHost.cs @@ -0,0 +1,36 @@ +using Funq; +using ServiceStack.Data; +using ServiceStack.OrmLite; +using ServiceStack.Text; + +namespace ServiceStack.MovieRest.App_Start +{ + public class MovieRestAppHost : AppHostBase + { + /// + /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. + /// + public MovieRestAppHost() : base("ServiceStack REST at the Movies!", typeof (MovieService).Assembly) + { + Config.DebugMode = true; //Show StackTraces for easier debugging (default auto inferred by Debug/Release builds) + Config.UseCamelCase = true; //Set JSON web services to return idiomatic JSON camelCase properties + JsConfig.DateHandler = DateHandler.ISO8601DateOnly; + } + + public override void Configure(Container container) + { + container.Register( + c => new OrmLiteConnectionFactory("~/App_Data/db.sqlite".MapHostAbsolutePath(), SqliteDialect.Provider)); + + Plugins.Add(new CorsFeature()); //Enable CORS + } + + protected override void OnAfterInit() + { + using (var resetMovies = Resolve()) + { + resetMovies.Any(new ResetMovies()); + } + } + } +} \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/Content/Css/default.css b/src/ServiceStack.MovieRest/Web/Content/Css/default.css index 48f5dc47..8742be9c 100644 --- a/src/ServiceStack.MovieRest/Web/Content/Css/default.css +++ b/src/ServiceStack.MovieRest/Web/Content/Css/default.css @@ -1,53 +1,80 @@ -BODY { - background: #fff url(../Images/bg-body-1024.png) repeat-y top left; +body { + background: #fff url(../Images/bg-body-1024.png) repeat-y top center; font: normal normal normal 13.34px/normal helvetica, arial, freesans, clean, sans-serif; - padding: 0 5px 20px 10px; width: 940px; + margin:0 auto; } -A IMG { - border: none; +h1 { + font-size: 170% !important; + margin-top: 1em; + padding-top: 0.5em; +} + +h4 { + position: relative; + top: 60px; + left: 560px; +} + +a img { + border: none; +} + +#existing h2 { + border-top: 4px solid #E0E0E0 !important; + font-size: 150% !important; + margin-top: 1.5em !important; + padding-top: 0.5em !important; +} + +#logo { + position:relative; + top: 5px; + left: 10px; + text-decoration: none; } #header-links { - top: 10px; - left: 270px; - position: absolute; -} - - #header-links A, #footer-links A { - color: #00F; - margin-left: 0.5em; - } - -code { - background-color: ghostWhite !important; - border: 1px solid #DEDEDE !important; - color: #444 !important; - font-size: 12px !important; - line-height: 1.5em !important; - margin: 1em 0 !important; - overflow: auto !important; - padding: 0.5em !important; - display: block; - font-family: monospace; - white-space: pre; + display: inline; + position: relative; + left: 240px; +} +#header-links A { + color: #00F; + margin-left: 0.5em; } -H1 { - font-size: 170% !important; - margin-top: 0.65em; - padding-top: 0.5em; +#github { + clear: right; + padding: 12px 18px 0 0; + float: right; +} +#github img { + height: 64px; +} + +#summary { + margin: 30px 0 20px 0; + padding: 10px; + background: #ffc; + color: green; + font-size: 16px; + border: solid 1px #ccc; + font-weight: bold; + text-align: center; +} +#summary A { + color: #00F; } -H2 { - border-top: 4px solid #E0E0E0 !important; - font-size: 150% !important; - margin-top: 1.5em !important; - padding-top: 0.5em !important; +#btnReset { + clear: right; + float: right; } -INPUT[type=text] { + +input[type=text] { width: 400px; padding: 2px 5px; } @@ -71,40 +98,7 @@ INPUT[type=text] { display: inline; } -H1 A { - background: url(http://www.servicestack.net/logo-servicestack.png) no-repeat; - display: block; - height: 40px; - padding: 70px 30px 0 120px; - color: #051; - margin: 0 50px 20px 0; - text-decoration: none; -} - -#summary { - margin: 0 0 20px 0; - padding: 10px; - background: #ffc; - color: green; - font-size: 16px; - border: solid 1px #ccc; - font-weight: bold; - text-align: center; -} - - #summary A { - color: #00F; - } - - #summary B { - } - -#btnReset { - float: right; - margin: 20px 0 0 0; -} - -DT { +dt { margin: 10px 0 5px 0; } @@ -119,36 +113,37 @@ DT { cursor: pointer; } -H4 { - position: absolute; - top: 270px; - left: 580px; -} - #restlog { - position: absolute; - top: 290px; - left: 580px; - width: 360px; - height: 600px; - overflow-y: scroll; - font-size: 14px !important; - line-height: 18px !important; -} - - #restlog B { - width: 70px; - } - -FORM { + width: 360px; + height: 600px; + overflow-y: scroll; + font-size: 14px !important; + line-height: 18px !important; + clear: both; + float: right; + background-color: ghostWhite !important; + border: 1px solid #DEDEDE !important; + color: #444 !important; + font-size: 12px !important; + line-height: 1.5em !important; + margin: 4em 0 !important; + overflow: auto !important; + padding: 0.5em !important; + /*display: block;*/ + font-family: monospace; + white-space: pre; +} +#restlog B { + width: 70px; +} + +#addMovie { display: none; } SELECT[name=genres] { - padding: 4px; - position: absolute; + position: relative; left: 345px; - margin-top: 20px; } #btn-download { @@ -159,13 +154,12 @@ SELECT[name=genres] { } #csvformat { - background: url(http://www.servicestack.net/excel16x16.gif) no-repeat top left; + background: url(https://servicestack.net/excel16x16.gif) no-repeat top left; padding: 0 0 0 20px; margin: 15px 0 0 0; } - - #csvformat B { - color: #00f; - text-decoration: underline; - cursor: pointer; - } +#csvformat B { + color: #00f; + text-decoration: underline; + cursor: pointer; +} diff --git a/src/ServiceStack.MovieRest/Web/Content/Images/btn-download.gif b/src/ServiceStack.MovieRest/Web/Content/Images/btn-download.gif new file mode 100644 index 00000000..92a7e3d8 Binary files /dev/null and b/src/ServiceStack.MovieRest/Web/Content/Images/btn-download.gif differ diff --git a/src/ServiceStack.MovieRest/Web/Content/Images/btn-github.png b/src/ServiceStack.MovieRest/Web/Content/Images/btn-github.png index 1cec3751..e7605b02 100644 Binary files a/src/ServiceStack.MovieRest/Web/Content/Images/btn-github.png and b/src/ServiceStack.MovieRest/Web/Content/Images/btn-github.png differ diff --git a/src/ServiceStack.MovieRest/Web/Content/Images/logo-24x24.png b/src/ServiceStack.MovieRest/Web/Content/Images/logo-24x24.png new file mode 100644 index 00000000..9ac02fde Binary files /dev/null and b/src/ServiceStack.MovieRest/Web/Content/Images/logo-24x24.png differ diff --git a/src/ServiceStack.MovieRest/Web/Global.asax.cs b/src/ServiceStack.MovieRest/Web/Global.asax.cs index 8e1908ed..24cc63bf 100644 --- a/src/ServiceStack.MovieRest/Web/Global.asax.cs +++ b/src/ServiceStack.MovieRest/Web/Global.asax.cs @@ -1,16 +1,15 @@ using System; +using System.Web; using ServiceStack.MovieRest.App_Start; namespace ServiceStack.MovieRest { - using System.Web; - public class Global : HttpApplication { - protected void Application_Start(object sender, EventArgs e) - { - //Initialize your application - (new AppHost()).Init(); - } + protected void Application_Start(object sender, EventArgs e) + { + //Initialize your application + new MovieRestAppHost().Init(); + } } } \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/MovieService.cs b/src/ServiceStack.MovieRest/Web/MovieService.cs index 2b8adc16..2ae202ae 100644 --- a/src/ServiceStack.MovieRest/Web/MovieService.cs +++ b/src/ServiceStack.MovieRest/Web/MovieService.cs @@ -1,167 +1,164 @@ +using System; +using System.Collections.Generic; +using System.Net; using System.Runtime.Serialization; +using ServiceStack.DataAnnotations; +using ServiceStack.OrmLite; namespace ServiceStack.MovieRest { - using System; - using System.Collections.Generic; - using System.Net; - using DataAnnotations; - using OrmLite; - - /// - /// Define your ServiceStack web service request (i.e. Request DTO). - /// - /// The route is defined here rather than in the AppHost. - [Api("GET or DELETE a single movie by Id. Use POST to create a new Movie and PUT to update it")] - [Route("/movies", "POST,PUT,PATCH,DELETE")] - [Route("/movies/{Id}")] - public class Movie : IReturn - { - /// - /// Initializes a new instance of the movie. - /// - public Movie() - { - this.Genres = new List(); - } - - /// - /// Gets or sets the id of the movie. The id will be automatically incremented when added. - /// - [AutoIncrement] - public int Id { get; set; } - - public string ImdbId { get; set; } - public string Title { get; set; } - public decimal Rating { get; set; } - public string Director { get; set; } - public DateTime ReleaseDate { get; set; } - public string TagLine { get; set; } - public List Genres { get; set; } - } - - /// - /// Define your ServiceStack web service response (i.e. Response DTO). - /// - public class MovieResponse - { - /// - /// Gets or sets the movie. - /// - public Movie Movie { get; set; } - } - - /// - /// Define your ServiceStack web service request (i.e. Request DTO). - /// - /// The route is defined here rather than in the AppHost. - [Api("Find movies by genre, or all movies if no genre is provided")] - [Route("/movies", "GET, OPTIONS")] - [Route("/movies/genres/{Genre}")] - public class Movies : IReturn - { - public string Genre { get; set; } - } - - /// - /// Define your ServiceStack web service response (i.e. Response DTO). - /// - [DataContract] - public class MoviesResponse - { - /// - /// Gets or sets the list of movies. - /// - [DataMember] - public List Movies { get; set; } - } - - /// - /// Create your ServiceStack restful web service implementation. - /// - public class MovieService : Service - { - /// - /// GET /movies - /// GET /movies/genres/{Genre} - /// - public object Get(Movies request) - { - return new MoviesResponse { - Movies = request.Genre.IsNullOrEmpty() - ? Db.Select() - : Db.Select("Genres LIKE {0}", "%{0}%".Fmt(request.Genre)) - }; - } - - /// - /// GET /movies/{Id} - /// - public MovieResponse Get(Movie movie) - { - return new MovieResponse - { - Movie = Db.SingleById(movie.Id), - }; - } - - /// - /// POST /movies - /// returns HTTP Response => - /// 201 Created - /// Location: http://localhost/ServiceStack.MovieRest/movies/{newMovieId} - /// {newMovie DTO in [xml|json|jsv|etc]} - /// - public object Post(Movie movie) - { - Db.Save(movie); - var newMovieId = movie.Id; - - var newMovie = new MovieResponse - { - Movie = Db.SingleById(newMovieId), - }; - - return new HttpResult(newMovie) - { - StatusCode = HttpStatusCode.Created, - Headers = { - {HttpHeaders.Location, base.Request.AbsoluteUri.CombineWith(newMovieId.ToString())} + /// + /// Define your ServiceStack web service request (i.e. Request DTO). + /// + /// The route is defined here rather than in the AppHost. + [Api("GET or DELETE a single movie by Id. Use POST to create a new Movie and PUT to update it")] + [Route("/movies", "POST,PUT,PATCH,DELETE")] + [Route("/movies/{Id}")] + public class Movie : IReturn + { + /// + /// Initializes a new instance of the movie. + /// + public Movie() + { + this.Genres = new List(); + } + + /// + /// Gets or sets the id of the movie. The id will be automatically incremented when added. + /// + [AutoIncrement] + public int Id { get; set; } + public string ImdbId { get; set; } + public string Title { get; set; } + public decimal Rating { get; set; } + public string Director { get; set; } + public DateTime ReleaseDate { get; set; } + public string TagLine { get; set; } + public List Genres { get; set; } + } + + /// + /// Define your ServiceStack web service response (i.e. Response DTO). + /// + public class MovieResponse + { + /// + /// Gets or sets the movie. + /// + public Movie Movie { get; set; } + } + + /// + /// Define your ServiceStack web service request (i.e. Request DTO). + /// + /// The route is defined here rather than in the AppHost. + [Api("Find movies by genre, or all movies if no genre is provided")] + [Route("/movies", "GET, OPTIONS")] + [Route("/movies/genres/{Genre}")] + public class Movies : IReturn + { + public string Genre { get; set; } + } + + /// + /// Define your ServiceStack web service response (i.e. Response DTO). + /// + [DataContract] + public class MoviesResponse + { + /// + /// Gets or sets the list of movies. + /// + [DataMember] + public List Movies { get; set; } + } + + /// + /// Create your ServiceStack restful web service implementation. + /// + public class MovieService : Service + { + /// + /// GET /movies + /// GET /movies/genres/{Genre} + /// + public object Get(Movies request) + { + return new MoviesResponse { + Movies = request.Genre.IsNullOrEmpty() + ? Db.Select() + : Db.Select("Genres LIKE {0}", "%{0}%".Fmt(request.Genre)) + }; + } + + /// + /// GET /movies/{Id} + /// + public object Get(Movie movie) + { + return new MovieResponse + { + Movie = Db.SingleById(movie.Id), + }; + } + + /// + /// POST /movies + /// returns HTTP Response => + /// 201 Created + /// Location: http://localhost/ServiceStack.MovieRest/movies/{newMovieId} + /// {newMovie DTO in [xml|json|jsv|etc]} + /// + public object Post(Movie movie) + { + Db.Save(movie); + var newMovieId = movie.Id; + + var newMovie = new MovieResponse + { + Movie = Db.SingleById(newMovieId), + }; + + return new HttpResult(newMovie) + { + StatusCode = HttpStatusCode.Created, + Headers = { + { HttpHeaders.Location, base.Request.AbsoluteUri.AppendPath(newMovieId.ToString()) } } - }; - } - - /// - /// PUT /movies/{id} - /// - public object Put(Movie movie) - { - Db.Update(movie); - - return new HttpResult - { - StatusCode = HttpStatusCode.NoContent, - Headers = - { - {HttpHeaders.Location, this.Request.AbsoluteUri.CombineWith(movie.Id.ToString())} - } - }; - } - - /// - /// DELETE /movies/{Id} - /// - public object Delete(Movie request) - { - Db.DeleteById(request.Id); - - return new HttpResult - { - StatusCode = HttpStatusCode.NoContent, - Headers = { - {HttpHeaders.Location, this.Request.AbsoluteUri.CombineWith(request.Id.ToString())} + }; + } + + /// + /// PUT /movies/{id} + /// + public object Put(Movie movie) + { + Db.Update(movie); + + return new HttpResult + { + StatusCode = HttpStatusCode.NoContent, + Headers = { + { HttpHeaders.Location, this.Request.AbsoluteUri.AppendPath(movie.Id.ToString()) } + } + }; + } + + /// + /// DELETE /movies/{Id} + /// + public object Delete(Movie request) + { + Db.DeleteById(request.Id); + + return new HttpResult + { + StatusCode = HttpStatusCode.NoContent, + Headers = { + { HttpHeaders.Location, this.Request.AbsoluteUri.AppendPath(request.Id.ToString()) } } - }; - } - } + }; + } + } } \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/ResetMovies.cs b/src/ServiceStack.MovieRest/Web/ResetMovies.cs deleted file mode 100644 index 5971b0a6..00000000 --- a/src/ServiceStack.MovieRest/Web/ResetMovies.cs +++ /dev/null @@ -1,80 +0,0 @@ -namespace ServiceStack.MovieRest -{ - using System; - using System.Collections.Generic; - using OrmLite; - - /// - /// Define your ServiceStack web service request (i.e. Request DTO). - /// - /// The route is defined here rather than in the AppHost. - [Route("/reset-movies", "GET,POST")] - [Api("Resets the database back to the original Top 5 movies.")] - public class ResetMovies : IReturnVoid {} - - /// - /// Create your ServiceStack rest-ful web service implementation. - /// - public class ResetMoviesService : Service - { - public static List Top5Movies = new List { - new Movie - { - ImdbId = "tt1375666", - Title = "Inception", - Rating = 9.2m, - Director = "Christopher Nolan", - ReleaseDate = new DateTime(2010, 7, 16), - TagLine = "Your mind is the scene of the crime", - Genres = new List {"Action", "Thriller", "Sci-Fi"}, - }, - new Movie - { - ImdbId = "tt0111161", - Title = "The Shawshank Redemption", - Rating = 9.2m, - Director = "Frank Darabont", - ReleaseDate = new DateTime(1995, 2, 17), - TagLine = "Fear can hold you prisoner. Hope can set you free.", - Genres = new List {"Crime", "Drama"}, - }, - new Movie - { - ImdbId = "tt0071562", - Title = "The Godfather: Part II", - Rating = 9.0m, - Director = "Francis Ford Coppola", - ReleaseDate = new DateTime(1974, 12, 20), - Genres = new List {"Crime", "Drama", "Thriller"}, - }, - new Movie - { - ImdbId = "tt0068646", - Title = "The Godfather", - Rating = 9.2m, - Director = "Francis Ford Coppola", - ReleaseDate = new DateTime(1972, 3, 24), - TagLine = "An offer you can't refuse.", - Genres = new List {"Crime", "Drama", "Thriller"}, - }, - new Movie - { - ImdbId = "tt0060196", - Title = "The Good, the Bad and the Ugly", - Rating = 9.0m, - Director = "Sergio Leone", - ReleaseDate = new DateTime(1967, 12, 29), - TagLine = - "They formed an alliance of hate to steal a fortune in dead man's gold", - Genres = new List {"Adventure", "Western"}, - }, - }; - - public void Any(ResetMovies request) - { - //Executes the specified delegate against the configured database. - Db.DropAndCreateTable(); - Db.SaveAll(Top5Movies); - } - } -} \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/ResetMoviesService.cs b/src/ServiceStack.MovieRest/Web/ResetMoviesService.cs new file mode 100644 index 00000000..2e2abb6d --- /dev/null +++ b/src/ServiceStack.MovieRest/Web/ResetMoviesService.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using ServiceStack.OrmLite; + +namespace ServiceStack.MovieRest +{ + /// + /// Define your ServiceStack web service request (i.e. Request DTO). + /// + /// The route is defined here rather than in the AppHost. + [Route("/reset-movies", "GET,POST")] + [Api("Resets the database back to the original Top 5 movies.")] + public class ResetMovies : IReturnVoid { } + + /// + /// Create your ServiceStack rest-ful web service implementation. + /// + public class ResetMoviesService : Service + { + public static List Top5Movies = new List { + new Movie + { + ImdbId = "tt1375666", + Title = "Inception", + Rating = 9.2m, + Director = "Christopher Nolan", + ReleaseDate = new DateTime(2010, 7, 16), + TagLine = "Your mind is the scene of the crime", + Genres = new List {"Action", "Thriller", "Sci-Fi"}, + }, + new Movie + { + ImdbId = "tt0111161", + Title = "The Shawshank Redemption", + Rating = 9.2m, + Director = "Frank Darabont", + ReleaseDate = new DateTime(1995, 2, 17), + TagLine = "Fear can hold you prisoner. Hope can set you free.", + Genres = new List {"Crime", "Drama"}, + }, + new Movie + { + ImdbId = "tt0071562", + Title = "The Godfather: Part II", + Rating = 9.0m, + Director = "Francis Ford Coppola", + ReleaseDate = new DateTime(1974, 12, 20), + Genres = new List {"Crime", "Drama", "Thriller"}, + }, + new Movie + { + ImdbId = "tt0068646", + Title = "The Godfather", + Rating = 9.2m, + Director = "Francis Ford Coppola", + ReleaseDate = new DateTime(1972, 3, 24), + TagLine = "An offer you can't refuse.", + Genres = new List {"Crime", "Drama", "Thriller"}, + }, + new Movie + { + ImdbId = "tt0060196", + Title = "The Good, the Bad and the Ugly", + Rating = 9.0m, + Director = "Sergio Leone", + ReleaseDate = new DateTime(1967, 12, 29), + TagLine = + "They formed an alliance of hate to steal a fortune in dead man's gold", + Genres = new List {"Adventure", "Western"}, + }, + }; + + public void Any(ResetMovies request) + { + //Executes the specified delegate against the configured database. + Db.DropAndCreateTable(); + Db.SaveAll(Top5Movies); + } + } +} \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/Scripts/MovieRest.js b/src/ServiceStack.MovieRest/Web/Scripts/MovieRest.js new file mode 100644 index 00000000..b863f2eb --- /dev/null +++ b/src/ServiceStack.MovieRest/Web/Scripts/MovieRest.js @@ -0,0 +1,143 @@ +//Simple string formatting enhancement +if (!String.format) { String.prototype.format = function () { var args = arguments; return this.replace(/\{(\d+)\}/g, function (match, number) { return (typeof args[number] !== 'undefined') ? args[number] : match; }); }; } + +$(function () { + $.ajaxSetup({ cache: false }); + + var restLog = function (method, url) { + if (method === "GET") { + url = '{0}'.format(url); + } + $("#restlog").prepend("
{0}{1}
".format(method, url)); + }; + + var allGenres = []; + + var refreshExistingMovies = function () { + var moviesUrl = "movies", jqFilter = $("SELECT[name=genres]"), filterGenre = jqFilter.val(); + if (filterGenre) { + moviesUrl += "/genres/" + filterGenre; + } + + restLog("GET", moviesUrl); + $.getJSON(moviesUrl, function (r) { + var html = ""; + GLOBALMOVIES = r; + for (var i = 0, count = r.movies.length; i < count; i++) { + var movie = r.movies[i]; + html += "
updatedelete
".format(movie.id, movie.title); + + $.each(movie.genres, function (i, genre) { + if ($.inArray(genre, allGenres) == -1) { + allGenres.push(genre); + } + }); + + var genreHtml = ''; + $.each(allGenres, function (i, genre) { + var selected = filterGenre === genre ? ' selected="selected"' : ''; + genreHtml += ''.format(genre, selected); + }); + jqFilter.html(genreHtml); + } + + $("#existing-movies").html(html); + + $("#existing-movies .lnk-delete").on('click', function () { + var request = { type: 'delete', url: "movies/" + $(this).parent().attr('id') }; + restLog("DELETE", request.url); + request.success = refreshExistingMovies; + $.ajax(request); + }); + + $("#existing-movies .lnk-update").on('click', function () { + var movieId = $(this).parent().attr('id'); + restLog("GET", "movies/" + movieId); + $.getJSON("movies/" + movieId, function (r) { + showDetailsForm(r.movie); + }); + }); + }); + }; + + $("SELECT[name=genres]").change(function () { + refreshExistingMovies(); + }); + + $("#btnReset").click(function () { + restLog("POST", "reset-movies"); + $.post("reset-movies", function (r) { + refreshExistingMovies(); + }); + }); + + var showDetailsForm = function (updateMovie) { + var isUpdate = !!updateMovie; + var newMovie = { + id: 0, + imdbId: "tt0110912", + title: "Pulp Fiction", + rating: 8.9, + director: "Quentin Tarantino", + releaseDate: new Date(1994, 10, 24), + tagLine: "Girls like me don't make invitations like this to just anyone!", + genres: ["Crime", "Drama", "Thriller"] + }; + + var movie = updateMovie || newMovie; + + $("FORM INPUT[type=submit]").val(isUpdate ? "Update movie" : "Add new movie"); + var action = "movies"; + $("FORM").attr('action', isUpdate ? action + "/" + movie.id : action); + $("FORM").attr('method', isUpdate ? 'PUT' : 'POST'); + + var title = isUpdate ? "Update " + movie.title : "Add a new movie"; + $("FORM H2").html(title); + + for (var name in movie) { + $("INPUT[name=" + name + "]").val(movie[name]); + } + + if (movie['releaseDate'] != null) { + var convertedDate = typeof movie['releaseDate'] == "string" ? new Date(movie['releaseDate']) : movie['releaseDate']; + + convertedDate = (convertedDate.getFullYear() + "-" + (convertedDate.getMonth() + 1) + "-" + convertedDate.getDate()); + $("INPUT[name=releaseDate]").val(convertedDate); + } + + $("FORM").fadeIn('fast'); + }; + + $("#btnAdd").click(function () { + showDetailsForm(); + }); + + $("FORM").submit(function (e) { + e.preventDefault(); + + var data = {}, form = $(this); + $("FORM INPUT[type=text]").each(function () { + data[this.name] = this.value; + }); + + $.ajax({ + url: form.attr("action"), + type: form.attr('method'), + data: data, + dataType: "json", + success: function () { + restLog(form.attr('method'), form.attr('action')); + form.hide(); + refreshExistingMovies(); + } + }); + }); + + + $("#csvformat B").click(function () { + restLog("GET", "movies?format=csv"); + location.href = "movies?format=csv"; + }); + + refreshExistingMovies(); +}); \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/ServiceStack.MovieRest.csproj b/src/ServiceStack.MovieRest/Web/ServiceStack.MovieRest.csproj index e9eff990..f5526716 100644 --- a/src/ServiceStack.MovieRest/Web/ServiceStack.MovieRest.csproj +++ b/src/ServiceStack.MovieRest/Web/ServiceStack.MovieRest.csproj @@ -27,6 +27,7 @@ true + true @@ -52,37 +53,33 @@ false - - ..\..\packages\ServiceStack.OrmLite.Sqlite.Mono.4.5.0\lib\net45\Mono.Data.Sqlite.dll - True - - ..\..\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\..\lib\ServiceStack.dll - ..\..\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\..\lib\ServiceStack.Client.dll - ..\..\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\..\lib\ServiceStack.Common.dll - - ..\..\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + + False + ..\..\..\lib\ServiceStack.Interfaces.dll - ..\..\packages\ServiceStack.OrmLite.4.5.0\lib\net45\ServiceStack.OrmLite.dll - True + False + ..\..\..\lib\ServiceStack.OrmLite.dll - ..\..\packages\ServiceStack.OrmLite.Sqlite.Mono.4.5.0\lib\net45\ServiceStack.OrmLite.Sqlite.dll - True + False + ..\..\..\lib\ServiceStack.OrmLite.Sqlite.dll - ..\..\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\..\lib\ServiceStack.Text.dll @@ -101,34 +98,32 @@ + + - + - - PreserveNewest - + Designer - - + + Global.asax - - - + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/ServiceStack.MovieRest/Web/default.htm b/src/ServiceStack.MovieRest/Web/default.htm index 410371e1..48fbea7a 100644 --- a/src/ServiceStack.MovieRest/Web/default.htm +++ b/src/ServiceStack.MovieRest/Web/default.htm @@ -1,236 +1,81 @@ - + ServiceStack Movie Database - - + + - - ServiceStack Home - - - -

- Nothing but REST!

-
- Clean mark-up, No config & No code-gen - Complete Ajax CRUD app in 1 page of jQuery and 1 page of C# server code. - -
- -

HTTP REST LOG

- -
- -

Existing Movies

-
- -
-
-

- -
-
Imdb Id
-
- -
-
Title
-
- -
-
Rating
-
- -
-
Director
-
- -
-
Release Date
-
- -
-
Tag Line
-
- -
-
Genres
-
- -
-
- - -
- Download movies in the new CSV Format or - View movies in the new HTML5 Format -
- - Download ServiceStack.Examples.zip - - - + + + + GitHub + +

Nothing but REST!

+
+ Clean mark-up, No config & No code-gen - Complete Ajax CRUD app in 1 page of jQuery and 1 page of C# server code. +
+ +

HTTP REST LOG

+ +
+

Existing Movies

+ +
+ +
+ +
+

+ +
+
Imdb Id
+
+ +
+
Title
+
+ +
+
Rating
+
+ +
+
Director
+
+ +
+
Release Date
+
+ +
+
Tag Line
+
+ +
+
Genres
+
+ +
+
+ + +
+ Download movies in the new CSV Format or + View movies in the new HTML5 Format +
+ + Download ServiceStack.Examples.zip + \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/packages.config b/src/ServiceStack.MovieRest/Web/packages.config deleted file mode 100644 index 877f9ce2..00000000 --- a/src/ServiceStack.MovieRest/Web/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/ServiceStack.MovieRest/Web/sqlite3.dll b/src/ServiceStack.MovieRest/Web/sqlite3.dll deleted file mode 100644 index 1058a2b1..00000000 Binary files a/src/ServiceStack.MovieRest/Web/sqlite3.dll and /dev/null differ diff --git a/src/ServiceStack.Northwind/.nuget/NuGet.exe b/src/ServiceStack.Northwind/.nuget/NuGet.exe deleted file mode 100644 index f1cec45e..00000000 Binary files a/src/ServiceStack.Northwind/.nuget/NuGet.exe and /dev/null differ diff --git a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CachedServices.cs b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CachedServices.cs index f2c29b62..ebbf0121 100644 --- a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CachedServices.cs +++ b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CachedServices.cs @@ -1,49 +1,46 @@ - - +using ServiceStack.Caching; +using ServiceStack.Northwind.ServiceModel.Operations; -namespace ServiceStack.Northwind.ServiceInterface +namespace ServiceStack.Northwind.ServiceInterface { - using Caching; - using ServiceModel.Operations; + public class CachedCustomersService : Service + { + public ICacheClient CacheClient { get; set; } - public class CachedCustomersService : Service - { - public ICacheClient CacheClient { get; set; } - - public object Get(CachedCustomers request) - { - return base.Request.ToOptimizedResultUsingCache( - this.CacheClient, "urn:customers", () => { - var service = this.ResolveService(); - return service.Get(new Customers()); - }); - } + public object Get(CachedCustomers request) + { + return base.Request.ToOptimizedResultUsingCache( + this.CacheClient, "urn:customers", () => { + var service = this.ResolveService(); + return service.Get(new Customers()); + }); + } } - public class CachedCustomerDetailsService : Service - { - public ICacheClient CacheClient { get; set; } - - public object Get(CachedCustomerDetails request) - { - var cacheKey = UrnId.Create(request.Id); - return base.Request.ToOptimizedResultUsingCache( - this.CacheClient, cacheKey, () => - this.ResolveService().Get(new CustomerDetails { Id = request.Id })); - } + public class CachedCustomerDetailsService : Service + { + public ICacheClient CacheClient { get; set; } + + public object Get(CachedCustomerDetails request) + { + var cacheKey = UrnId.Create(request.Id); + return base.Request.ToOptimizedResultUsingCache( + this.CacheClient, cacheKey, () => + this.ResolveService().Get(new CustomerDetails { Id = request.Id })); + } + } + + public class CachedOrdersService : Service + { + public ICacheClient CacheClient { get; set; } + + public object Get(CachedOrders request) + { + var cacheKey = UrnId.Create(request.CustomerId ?? "all", request.Page.GetValueOrDefault(0).ToString()); + return base.Request.ToOptimizedResultUsingCache(CacheClient, cacheKey, + () => (OrdersResponse) ResolveService() + .Get(new Orders { CustomerId = request.CustomerId, Page = request.Page })); + } } - public class CachedOrdersService : Service - { - public ICacheClient CacheClient { get; set; } - - public object Get(CachedOrders request) - { - var cacheKey = UrnId.Create(request.CustomerId ?? "all", request.Page.GetValueOrDefault(0).ToString()); - return base.Request.ToOptimizedResultUsingCache(CacheClient, cacheKey, - () => (OrdersResponse) ResolveService() - .Get(new Orders { CustomerId = request.CustomerId, Page = request.Page })); - } - } - -} +} diff --git a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomerDetailsService.cs b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomerDetailsService.cs index 378d30dd..d05a3a18 100644 --- a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomerDetailsService.cs +++ b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomerDetailsService.cs @@ -1,10 +1,9 @@ using System; using System.Net; +using ServiceStack.OrmLite; using ServiceStack.Northwind.ServiceModel.Operations; using ServiceStack.Northwind.ServiceModel.Types; -using ServiceStack.OrmLite; - namespace ServiceStack.Northwind.ServiceInterface { public class CustomerDetailsService : Service @@ -17,7 +16,7 @@ public CustomerDetailsResponse Get(CustomerDetails request) new ArgumentException("Customer does not exist: " + request.Id)); var ordersService = base.ResolveService(); - var ordersResponse = (OrdersResponse) ordersService.Get(new Orders {CustomerId = customer.Id}); + var ordersResponse = (OrdersResponse) ordersService.Get(new Orders { CustomerId = customer.Id }); return new CustomerDetailsResponse { diff --git a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomersService.cs b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomersService.cs index 2f09e2f6..c00cfd78 100644 --- a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomersService.cs +++ b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/CustomersService.cs @@ -1,10 +1,10 @@ +using ServiceStack.OrmLite; using ServiceStack.Northwind.ServiceModel.Operations; using ServiceStack.Northwind.ServiceModel.Types; -using ServiceStack.OrmLite; namespace ServiceStack.Northwind.ServiceInterface { - public class CustomersService : ServiceStack.Service + public class CustomersService : Service { public CustomersResponse Get(Customers request) { diff --git a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/OrdersService.cs b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/OrdersService.cs index 4819fe41..6cd60891 100644 --- a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/OrdersService.cs +++ b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/OrdersService.cs @@ -1,9 +1,8 @@ using System.Linq; -using ServiceStack.Northwind.ServiceModel.Operations; -using ServiceStack.Northwind.ServiceModel.Types; using ServiceStack.OrmLite; using ServiceStack.OrmLite.Legacy; - +using ServiceStack.Northwind.ServiceModel.Operations; +using ServiceStack.Northwind.ServiceModel.Types; namespace ServiceStack.Northwind.ServiceInterface { @@ -14,11 +13,11 @@ public class OrdersService : Service public object Get(Orders request) { var orders = request.CustomerId.IsNullOrEmpty() - ? Db.Select(order => order.OrderByDescending(o => o.OrderDate)) - .Skip((request.Page.GetValueOrDefault(1) - 1)*PageCount) + ? Db.Select(Db.From().OrderByDescending(o => o.OrderDate)) + .Skip((request.Page.GetValueOrDefault(1) - 1) * PageCount) .Take(PageCount) .ToList() - : Db.Select(order => order.Where(o => o.CustomerId == request.CustomerId)); + : Db.Select(Db.From().Where(o => o.CustomerId == request.CustomerId)); if (orders.Count == 0) return new OrdersResponse(); diff --git a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/ServiceStack.Northwind.ServiceInterface.csproj b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/ServiceStack.Northwind.ServiceInterface.csproj index abb959ff..099e67a6 100644 --- a/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/ServiceStack.Northwind.ServiceInterface.csproj +++ b/src/ServiceStack.Northwind/ServiceStack.Northwind.ServiceInterface/ServiceStack.Northwind.ServiceInterface.csproj @@ -58,28 +58,28 @@
- ..\..\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\..\lib\ServiceStack.dll - ..\..\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\..\lib\ServiceStack.Client.dll - ..\..\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\..\lib\ServiceStack.Common.dll - ..\..\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + False + ..\..\..\lib\ServiceStack.Interfaces.dll - ..\..\packages\ServiceStack.OrmLite.4.5.0\lib\net45\ServiceStack.OrmLite.dll - True + False + ..\..\..\lib\ServiceStack.OrmLite.dll - ..\..\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\..\lib\ServiceStack.Text.dll @@ -122,9 +122,6 @@ true - - - @@ -669,20 +672,6 @@

Todos

<% } %> - - - - diff --git a/src/StarterTemplates/ConsoleAppHost/packages.config b/src/StarterTemplates/ConsoleAppHost/packages.config deleted file mode 100644 index 6b7d575f..00000000 --- a/src/StarterTemplates/ConsoleAppHost/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/CustomPath40/CustomPath40.csproj b/src/StarterTemplates/CustomPath40/CustomPath40.csproj deleted file mode 100644 index 42148fbd..00000000 --- a/src/StarterTemplates/CustomPath40/CustomPath40.csproj +++ /dev/null @@ -1,138 +0,0 @@ - - - - - Debug - AnyCPU - - - 2.0 - {787130A2-1797-403F-BB3F-EA2AFDB14B12} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - CustomPath40 - CustomPath40 - v4.0 - true - - - - - 4.0 - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - ..\..\packages\ServiceStack.Interfaces.4.0.60\lib\portable-wp80+sl5+net40+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - - - ..\..\packages\ServiceStack.Text.4.0.60\lib\net40\ServiceStack.Text.dll - - - ..\..\packages\ServiceStack.Common.4.0.60\lib\net40\ServiceStack.Common.dll - - - ..\..\packages\ServiceStack.Client.4.0.60\lib\net40\ServiceStack.Client.dll - - - ..\..\packages\ServiceStack.4.0.60\lib\net40\ServiceStack.dll - - - - - - - - - - Global.asax - - - - - - {ACBF3D12-379A-41D7-87DB-C376CFCBD131} - StarterTemplates.Common - - - - - Designer - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - True - True - 37015 - / - http://localhost:37015/ - False - False - - - False - - - - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/CustomPath40/Global.asax b/src/StarterTemplates/CustomPath40/Global.asax deleted file mode 100644 index 620d1935..00000000 --- a/src/StarterTemplates/CustomPath40/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="CustomPath40.Global" Language="C#" %> diff --git a/src/StarterTemplates/CustomPath40/Global.asax.cs b/src/StarterTemplates/CustomPath40/Global.asax.cs deleted file mode 100644 index dc9b0b13..00000000 --- a/src/StarterTemplates/CustomPath40/Global.asax.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using ServiceStack; -using StarterTemplates.Common; -using Funq; - -namespace CustomPath40 -{ - /// - /// Create your ServiceStack web service application with a singleton AppHost. - /// - public class AppHost : AppHostBase - { - /// - /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. - /// - public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { } - - /// - /// Configure the container with the necessary routes for your ServiceStack application. - /// - /// The built-in IoC used with ServiceStack. - public override void Configure(Container container) - { - container.Register(new TodoRepository()); - } - } - - public class Global : System.Web.HttpApplication - { - void Application_Start(object sender, EventArgs e) - { - //Initialize your application - (new AppHost()).Init(); - } - } -} diff --git a/src/StarterTemplates/CustomPath40/Properties/AssemblyInfo.cs b/src/StarterTemplates/CustomPath40/Properties/AssemblyInfo.cs deleted file mode 100644 index 1bcebc85..00000000 --- a/src/StarterTemplates/CustomPath40/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CustomPath40")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomPath40")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3aa72eec-8090-4f61-839f-80188938d52d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/StarterTemplates/CustomPath40/Web.config b/src/StarterTemplates/CustomPath40/Web.config deleted file mode 100644 index 285ebad7..00000000 --- a/src/StarterTemplates/CustomPath40/Web.config +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/CustomPath40/default.htm b/src/StarterTemplates/CustomPath40/default.htm deleted file mode 100644 index eef079c8..00000000 --- a/src/StarterTemplates/CustomPath40/default.htm +++ /dev/null @@ -1,688 +0,0 @@ - - - - - Backbone Demo: Todos - - - - - - - - - - - - - - - -
- -
-

Todos

-
- -
- -
- - -
- -
-
    -
    - -
    - -
    - -
    - - - -
    - Created by -
    - Jérôme Gravel-Niquet -
    -
    - Powered By Open Source -
    - servicestack.net - | redis - | mono -
    - - - - - - - - - - - - - - diff --git a/src/StarterTemplates/CustomPath40/packages.config b/src/StarterTemplates/CustomPath40/packages.config deleted file mode 100644 index 87ecd704..00000000 --- a/src/StarterTemplates/CustomPath40/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/CustomPath45/CustomPath45.csproj b/src/StarterTemplates/CustomPath45/CustomPath45.csproj index c2c442cb..a4ec26e0 100644 --- a/src/StarterTemplates/CustomPath45/CustomPath45.csproj +++ b/src/StarterTemplates/CustomPath45/CustomPath45.csproj @@ -26,6 +26,7 @@ + true @@ -49,24 +50,24 @@ - ..\..\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\..\lib\ServiceStack.dll - ..\..\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\..\lib\ServiceStack.Client.dll - ..\..\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\..\lib\ServiceStack.Common.dll - ..\..\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + False + ..\..\..\lib\ServiceStack.Interfaces.dll - ..\..\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\..\lib\ServiceStack.Text.dll @@ -104,9 +105,6 @@ Designer - - - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/StarterTemplates/CustomPath45/Global.asax.cs b/src/StarterTemplates/CustomPath45/Global.asax.cs index c1a4d635..c13f256d 100644 --- a/src/StarterTemplates/CustomPath45/Global.asax.cs +++ b/src/StarterTemplates/CustomPath45/Global.asax.cs @@ -1,5 +1,4 @@ using System; -using Funq; using ServiceStack; using StarterTemplates.Common; @@ -19,7 +18,7 @@ public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Ass /// Configure the container with the necessary routes for your ServiceStack application. /// /// The built-in IoC used with ServiceStack. - public override void Configure(Container container) + public override void Configure(Funq.Container container) { container.Register(new TodoRepository()); } @@ -30,7 +29,7 @@ public class Global : System.Web.HttpApplication void Application_Start(object sender, EventArgs e) { //Initialize your application - (new AppHost()).Init(); + new AppHost().Init(); } } } diff --git a/src/StarterTemplates/CustomPath45/default.htm b/src/StarterTemplates/CustomPath45/default.htm index eef079c8..75617229 100644 --- a/src/StarterTemplates/CustomPath45/default.htm +++ b/src/StarterTemplates/CustomPath45/default.htm @@ -5,7 +5,7 @@ Backbone Demo: Todos - + @@ -621,7 +621,10 @@

    Todos

    @@ -632,9 +635,9 @@

    Todos


    Powered By Open Source
    - servicestack.net + servicestack.net | redis - | mono + | backbone.js
    diff --git a/src/StarterTemplates/CustomPath45/packages.config b/src/StarterTemplates/CustomPath45/packages.config deleted file mode 100644 index 6b7d575f..00000000 --- a/src/StarterTemplates/CustomPath45/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/README.md b/src/StarterTemplates/README.md index cb0fdb6d..95798c5c 100644 --- a/src/StarterTemplates/README.md +++ b/src/StarterTemplates/README.md @@ -2,14 +2,9 @@ These starter templates show the default configuration required to run ServiceStack under a number of different hosts: + * ConsoleAppHost - Host as a stand-alone Console Application using HttpListener * RootPath45 - Host at '/' on .NET 4.5 - * RootPath40 - Host at '/' on .NET 4.0 * CustomPath45 - Host at '/api' on .NET 4.5 - * CustomPath40 - Host at '/api' on .NET 4.0 - * ConsoleAppHost - Host as a stand-alone Console Application using HttpListener - -Run run the script below to start the hosts above on VS.NET WebDev.WebServer.EXE at ports 5001-5004: -start_vs2010_webserver.bat -When embedding static files in a Console or Windows Service host, remember to set the Build Action = "Content" and Copy to Output Directory settings. +When adding static files in a Console or Windows Service host, remember to set the Build Action = "Content" and Copy to Output Directory settings. diff --git a/src/StarterTemplates/RootPath40/Global.asax b/src/StarterTemplates/RootPath40/Global.asax deleted file mode 100644 index 8321af4e..00000000 --- a/src/StarterTemplates/RootPath40/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="RootPath40.Global" Language="C#" %> diff --git a/src/StarterTemplates/RootPath40/Global.asax.cs b/src/StarterTemplates/RootPath40/Global.asax.cs deleted file mode 100644 index 18aeffe8..00000000 --- a/src/StarterTemplates/RootPath40/Global.asax.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using ServiceStack; -using StarterTemplates.Common; -using Funq; - -namespace RootPath40 -{ - /// - /// Create your ServiceStack web service application with a singleton AppHost. - /// - public class AppHost : AppHostBase - { - /// - /// Initializes a new instance of your ServiceStack application, with the specified name and assembly containing the services. - /// - public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { } - - /// - /// Configure the container with the necessary routes for your ServiceStack application. - /// - /// The built-in IoC used with ServiceStack. - public override void Configure(Container container) - { - container.Register(new TodoRepository()); - } - } - - public class Global : System.Web.HttpApplication - { - void Application_Start(object sender, EventArgs e) - { - //Initialize your application - (new AppHost()).Init(); - } - } -} diff --git a/src/StarterTemplates/RootPath40/Properties/AssemblyInfo.cs b/src/StarterTemplates/RootPath40/Properties/AssemblyInfo.cs deleted file mode 100644 index 26079052..00000000 --- a/src/StarterTemplates/RootPath40/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RootPath40")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RootPath40")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d83ab560-9e9d-4b1f-9e11-60df16c90a68")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/StarterTemplates/RootPath40/RootPath40.csproj b/src/StarterTemplates/RootPath40/RootPath40.csproj deleted file mode 100644 index 3efec6ec..00000000 --- a/src/StarterTemplates/RootPath40/RootPath40.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - - Debug - AnyCPU - - - 2.0 - {07C66849-4022-4141-BB1E-B85B44B4FBAF} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - RootPath40 - RootPath40 - v4.0 - true - - - - - 4.0 - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - ..\..\packages\ServiceStack.Interfaces.4.0.60\lib\portable-wp80+sl5+net40+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - - - ..\..\packages\ServiceStack.Text.4.0.60\lib\net40\ServiceStack.Text.dll - - - ..\..\packages\ServiceStack.Common.4.0.60\lib\net40\ServiceStack.Common.dll - - - ..\..\packages\ServiceStack.Client.4.0.60\lib\net40\ServiceStack.Client.dll - - - ..\..\packages\ServiceStack.4.0.60\lib\net40\ServiceStack.dll - - - - - - - - - - Global.asax - - - - - - {ACBF3D12-379A-41D7-87DB-C376CFCBD131} - StarterTemplates.Common - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - True - True - 37022 - / - http://localhost:37022/ - False - False - - - False - - - - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/RootPath40/Web.config b/src/StarterTemplates/RootPath40/Web.config deleted file mode 100644 index a78adbc0..00000000 --- a/src/StarterTemplates/RootPath40/Web.config +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/RootPath40/default.htm b/src/StarterTemplates/RootPath40/default.htm deleted file mode 100644 index 12c464d3..00000000 --- a/src/StarterTemplates/RootPath40/default.htm +++ /dev/null @@ -1,688 +0,0 @@ - - - - - Backbone Demo: Todos - - - - - - - - - - - - - - - -
    - -
    -

    Todos

    -
    - -
    - -
    - - -
    - -
    -
      -
      - -
      - -
      - -
      - - - -
      - Created by -
      - Jérôme Gravel-Niquet -
      -
      - Powered By Open Source -
      - servicestack.net - | redis - | mono -
      - - - - - - - - - - - - - - diff --git a/src/StarterTemplates/RootPath40/packages.config b/src/StarterTemplates/RootPath40/packages.config deleted file mode 100644 index 87ecd704..00000000 --- a/src/StarterTemplates/RootPath40/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/RootPath45/Global.asax.cs b/src/StarterTemplates/RootPath45/Global.asax.cs index ad077308..90e1eefd 100644 --- a/src/StarterTemplates/RootPath45/Global.asax.cs +++ b/src/StarterTemplates/RootPath45/Global.asax.cs @@ -1,5 +1,4 @@ using System; -using Funq; using ServiceStack; using StarterTemplates.Common; @@ -19,7 +18,7 @@ public AppHost() : base("StarterTemplate ASP.NET Host", typeof(HelloService).Ass /// Configure the container with the necessary routes for your ServiceStack application. /// /// The built-in IoC used with ServiceStack. - public override void Configure(Container container) + public override void Configure(Funq.Container container) { container.Register(new TodoRepository()); } @@ -30,7 +29,7 @@ public class Global : System.Web.HttpApplication void Application_Start(object sender, EventArgs e) { //Initialize your application - (new AppHost()).Init(); + new AppHost().Init(); } } } diff --git a/src/StarterTemplates/RootPath45/RootPath45.csproj b/src/StarterTemplates/RootPath45/RootPath45.csproj index c5681d01..c9a2a82d 100644 --- a/src/StarterTemplates/RootPath45/RootPath45.csproj +++ b/src/StarterTemplates/RootPath45/RootPath45.csproj @@ -26,6 +26,7 @@ +
      true @@ -49,24 +50,24 @@ - ..\..\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\..\lib\ServiceStack.dll - ..\..\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\..\lib\ServiceStack.Client.dll - ..\..\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\..\lib\ServiceStack.Common.dll - ..\..\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + False + ..\..\..\lib\ServiceStack.Interfaces.dll - ..\..\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\..\lib\ServiceStack.Text.dll @@ -102,9 +103,6 @@ - - - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/StarterTemplates/RootPath45/default.htm b/src/StarterTemplates/RootPath45/default.htm index 12c464d3..bbc92869 100644 --- a/src/StarterTemplates/RootPath45/default.htm +++ b/src/StarterTemplates/RootPath45/default.htm @@ -5,7 +5,7 @@ Backbone Demo: Todos - + @@ -621,7 +621,10 @@

      Todos

      @@ -634,7 +637,7 @@

      Todos


      servicestack.net | redis - | mono + | backbone.js
      @@ -669,20 +672,6 @@

      Todos

      <% } %> - - - - diff --git a/src/StarterTemplates/RootPath45/packages.config b/src/StarterTemplates/RootPath45/packages.config deleted file mode 100644 index 6b7d575f..00000000 --- a/src/StarterTemplates/RootPath45/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/StarterTemplates/StarterTemplates.Common/HelloService.cs b/src/StarterTemplates/StarterTemplates.Common/HelloService.cs index 421bb65b..2d5ea1ff 100644 --- a/src/StarterTemplates/StarterTemplates.Common/HelloService.cs +++ b/src/StarterTemplates/StarterTemplates.Common/HelloService.cs @@ -30,7 +30,7 @@ public class HelloService : Service { public object Any(Hello request) { - return new HelloResponse { Result = "Hello, " + request.Name }; + return new HelloResponse { Result = "Hello, " + request.Name ?? "John Doe" }; } } } \ No newline at end of file diff --git a/src/StarterTemplates/StarterTemplates.Common/StarterTemplateAppHost.cs b/src/StarterTemplates/StarterTemplates.Common/StarterTemplateAppHost.cs index 5940148b..fdcb7d6e 100644 --- a/src/StarterTemplates/StarterTemplates.Common/StarterTemplateAppHost.cs +++ b/src/StarterTemplates/StarterTemplates.Common/StarterTemplateAppHost.cs @@ -1,17 +1,14 @@ using ServiceStack; -using ServiceStack.Configuration; namespace StarterTemplates.Common { - //ASP.NET Hosts - public class StarterTemplateAppHost - : AppHostBase + public class StarterTemplateAppHost : AppHostBase { - static readonly IAppSettings AppSettings = new AppSettings(); - - public StarterTemplateAppHost() - : base(AppSettings.GetString("ServiceName") ?? "StarterTemplate ASP.NET Host", typeof(HelloService).Assembly) { } + public StarterTemplateAppHost() : base("", typeof(HelloService).Assembly) + { + ServiceName = AppSettings.Get("ServiceName") ?? "StarterTemplate ASP.NET Host"; + } public override void Configure(Funq.Container container) { @@ -20,13 +17,12 @@ public override void Configure(Funq.Container container) } //HttpListener Hosts - public class StarterTemplateAppListenerHost - : AppHostHttpListenerBase + public class StarterTemplateAppListenerHost : AppHostHttpListenerBase { - static readonly IAppSettings AppSettings = new AppSettings(); - - public StarterTemplateAppListenerHost() - : base(AppSettings.GetString("ServiceName") ?? "StarterTemplate HttpListener", typeof(HelloService).Assembly) { } + public StarterTemplateAppListenerHost() : base("", typeof(HelloService).Assembly) + { + ServiceName = AppSettings.Get("ServiceName") ?? "StarterTemplate HttpListener"; + } public override void Configure(Funq.Container container) { diff --git a/src/StarterTemplates/StarterTemplates.Common/StarterTemplates.Common.csproj b/src/StarterTemplates/StarterTemplates.Common/StarterTemplates.Common.csproj index fbe0c829..15444c45 100644 --- a/src/StarterTemplates/StarterTemplates.Common/StarterTemplates.Common.csproj +++ b/src/StarterTemplates/StarterTemplates.Common/StarterTemplates.Common.csproj @@ -35,24 +35,24 @@
      - ..\..\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\..\lib\ServiceStack.dll - ..\..\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\..\lib\ServiceStack.Client.dll - ..\..\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\..\lib\ServiceStack.Common.dll - ..\..\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + False + ..\..\..\lib\ServiceStack.Interfaces.dll - ..\..\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\..\lib\ServiceStack.Text.dll @@ -68,9 +68,6 @@ - - - @@ -669,20 +672,6 @@

      Todos

      <% } %> - - - - diff --git a/src/StarterTemplates/WinServiceAppHost/packages.config b/src/StarterTemplates/WinServiceAppHost/packages.config deleted file mode 100644 index 6b7d575f..00000000 --- a/src/StarterTemplates/WinServiceAppHost/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/tests/ServiceStack.Examples.Tests.Integration/IntegrationTestBase.cs b/tests/ServiceStack.Examples.Tests.Integration/IntegrationTestBase.cs index 202e38ce..af3c6da2 100644 --- a/tests/ServiceStack.Examples.Tests.Integration/IntegrationTestBase.cs +++ b/tests/ServiceStack.Examples.Tests.Integration/IntegrationTestBase.cs @@ -3,62 +3,58 @@ using NUnit.Framework; using ServiceStack.Configuration; using ServiceStack.Data; -using ServiceStack.Examples.ServiceInterface; -using ServiceStack.Examples.ServiceInterface.Support; using ServiceStack.Logging; using ServiceStack.OrmLite; +using ServiceStack.Examples.ServiceInterface; +using ServiceStack.Examples.ServiceInterface.Support; +using ServiceStack.Examples.ServiceModel; namespace ServiceStack.Examples.Tests.Integration { - public class IntegrationTestAppHost - : AppHostHttpListenerBase - { - private static ILog log; - - public IntegrationTestAppHost() - : base("ServiceStack Examples", typeof(MovieRestService).Assembly) - { - LogManager.LogFactory = new DebugLogFactory(); - log = LogManager.GetLogger(GetType()); - Instance = null; - } + public class IntegrationTestAppHost : AppHostHttpListenerBase + { + public IntegrationTestAppHost() : base("ServiceStack Examples", typeof(MovieRestService).Assembly) { } public override void Configure(Container container) { - container.Register(new AppSettings()); - - container.Register(c => new ExampleConfig(c.Resolve())); + container.Register(c => new ExampleConfig(c.Resolve())); var appConfig = container.Resolve(); container.Register(c => new OrmLiteConnectionFactory( ":memory:", //Use an in-memory database instead SqliteDialect.Provider)); - - ConfigureDatabase.Init(container.Resolve()); } - } + } - public class IntegrationTestBase + public abstract class IntegrationTestBase { - private const string BaseUrl = "http://127.0.0.1:8080/"; + private const string BaseUrl = "http://127.0.0.1:8081/"; - private readonly ServiceStackHost appHost; + private ServiceStackHost appHost; - public IntegrationTestBase() - { - appHost = new IntegrationTestAppHost() - .Init() - .Start(BaseUrl); - } + [OneTimeSetUp] + public void TestFixtureSetUp() + { + LogManager.LogFactory = new ConsoleLogFactory(); + appHost = new IntegrationTestAppHost() + .Init() + .Start(BaseUrl); + } + + [OneTimeTearDown] + public void TestFixtureTearDown() + { + appHost.Dispose(); + } - [TestFixtureTearDown] - public void TestFixtureTearDown() - { - appHost.Dispose(); - } + [SetUp] + public void OnEachMethodBefore() + { + ConfigureDatabase.Init(appHost.Resolve()); + } - public void SendToEachEndpoint(object request, Action validate) + public void SendToEachEndpoint(object request, Action validate) { SendToEachEndpoint(request, null, validate); } @@ -72,22 +68,11 @@ public void SendToEachEndpoint(object request, Action validate) /// public void SendToEachEndpoint(object request, string httpMethod, Action validate) { - using (var xmlClient = new XmlServiceClient(BaseUrl)) using (var jsonClient = new JsonServiceClient(BaseUrl)) - using (var jsvClient = new JsvServiceClient(BaseUrl)) { - xmlClient.HttpMethod = httpMethod; jsonClient.HttpMethod = httpMethod; - jsvClient.HttpMethod = httpMethod; - - var xmlResponse = xmlClient.Send(request); - if (validate != null) validate(xmlResponse); - var jsonResponse = jsonClient.Send(request); - if (validate != null) validate(jsonResponse); - - var jsvResponse = jsvClient.Send(request); - if (validate != null) validate(jsvResponse); + validate?.Invoke(jsonResponse); } } diff --git a/tests/ServiceStack.Examples.Tests.Integration/IntegrationTests.cs b/tests/ServiceStack.Examples.Tests.Integration/IntegrationTests.cs index 719857dc..c588d7cc 100644 --- a/tests/ServiceStack.Examples.Tests.Integration/IntegrationTests.cs +++ b/tests/ServiceStack.Examples.Tests.Integration/IntegrationTests.cs @@ -12,10 +12,8 @@ namespace ServiceStack.Examples.Tests.Integration /// Admin user privillages are required to host the Console Host (HttpListener) /// [TestFixture] - public class IntegrationTests - : IntegrationTestBase + public class IntegrationTests : IntegrationTestBase { - [Test] public void Can_GetFactorial() { @@ -33,15 +31,5 @@ public void Can_GetFibonacciNumbers() SendToEachEndpoint(request, response => Assert.That(response.Results, Is.EquivalentTo(new List { 5, 8, 13, 21, 34 }))); } - - [Test] - public void Can_GetNorthwindCustomerOrders() - { - var request = new GetNorthwindCustomerOrders { CustomerId = "TESTCUSTOMER" }; - - SendToEachEndpoint(request, response => - Assert.That(response.CustomerOrders.Customer.Id, Is.EqualTo(request.CustomerId))); - } - } } diff --git a/tests/ServiceStack.Examples.Tests.Integration/MovieRestTests.cs b/tests/ServiceStack.Examples.Tests.Integration/MovieRestTests.cs index ac53eb7e..0858d2e8 100644 --- a/tests/ServiceStack.Examples.Tests.Integration/MovieRestTests.cs +++ b/tests/ServiceStack.Examples.Tests.Integration/MovieRestTests.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using NUnit.Framework; +using ServiceStack.Text; using ServiceStack.Examples.ServiceInterface.Support; using ServiceStack.Examples.ServiceModel; using ServiceStack.Examples.ServiceModel.Types; -using ServiceStack.Text; namespace ServiceStack.Examples.Tests.Integration { @@ -16,8 +16,7 @@ namespace ServiceStack.Examples.Tests.Integration /// including subsequent failing Add/PUT requests due to a Unique constraint violation. /// [TestFixture] - public class MovieRestTests - : IntegrationTestBase + public class MovieRestTests : IntegrationTestBase { [Test] public void Can_list_all_movies() @@ -43,7 +42,7 @@ public void Can_update_movie() var updatedMovie = TypeSerializer.Clone(topMovie); updatedMovie.Title = "Updated Movie"; - SendToEachEndpoint(new Movies { Movie = updatedMovie }, HttpMethods.Post, null); + SendToEachEndpoint(new Movies { Movie = updatedMovie }, HttpMethods.Put, null); SendToEachEndpoint(new Movies { Id = topMovie.Id }, HttpMethods.Get, response => Assert.That(updatedMovie.Equals(response.Movies[0]), Is.True) @@ -64,7 +63,7 @@ public void Can_add_movie() Genres = new List { "Crime", "Drama", "Thriller" }, }; - SendToEachEndpoint(new Movies { Movie = newMovie }, HttpMethods.Put, null); + SendToEachEndpoint(new Movies { Movie = newMovie }, HttpMethods.Post, null); SendToEachEndpoint(new Movies { Id = newMovie.Id }, HttpMethods.Get, response => Assert.That(newMovie.Equals(response.Movies[0]), Is.True) diff --git a/tests/ServiceStack.Examples.Tests.Integration/ServiceStack.Examples.Tests.Integration.csproj b/tests/ServiceStack.Examples.Tests.Integration/ServiceStack.Examples.Tests.Integration.csproj index e118a4cf..1c0580d6 100644 --- a/tests/ServiceStack.Examples.Tests.Integration/ServiceStack.Examples.Tests.Integration.csproj +++ b/tests/ServiceStack.Examples.Tests.Integration/ServiceStack.Examples.Tests.Integration.csproj @@ -56,41 +56,36 @@ false
      - - ..\..\src\packages\ServiceStack.OrmLite.Sqlite.Mono.4.5.0\lib\net45\Mono.Data.Sqlite.dll - True - - - ..\..\src\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll - True + + ..\..\src\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll - ..\..\src\packages\ServiceStack.4.5.0\lib\net45\ServiceStack.dll - True + False + ..\..\lib\ServiceStack.dll - ..\..\src\packages\ServiceStack.Client.4.5.0\lib\net45\ServiceStack.Client.dll - True + False + ..\..\lib\ServiceStack.Client.dll - ..\..\src\packages\ServiceStack.Common.4.5.0\lib\net45\ServiceStack.Common.dll - True + False + ..\..\lib\ServiceStack.Common.dll - ..\..\src\packages\ServiceStack.Interfaces.4.5.0\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll - True + False + ..\..\lib\ServiceStack.Interfaces.dll - ..\..\src\packages\ServiceStack.OrmLite.4.5.0\lib\net45\ServiceStack.OrmLite.dll - True + False + ..\..\lib\ServiceStack.OrmLite.dll - ..\..\src\packages\ServiceStack.OrmLite.Sqlite.Mono.4.5.0\lib\net45\ServiceStack.OrmLite.Sqlite.dll - True + False + ..\..\lib\ServiceStack.OrmLite.Sqlite.dll - ..\..\src\packages\ServiceStack.Text.4.5.0\lib\net45\ServiceStack.Text.dll - True + False + ..\..\lib\ServiceStack.Text.dll @@ -140,12 +135,10 @@ - + - - PreserveNewest - +

      - /api/soap11 + /servicestack/soap11 - soap11/metadata?op=Hello + servicestack/soap11/metadata?op=Hello
      - /api/soap12 + /servicestack/soap12 - soap12/metadata?op=Hello + servicestack/soap12/metadata?op=Hello