diff --git a/Libraries/SubSonic.Core.XML b/Libraries/SubSonic.Core.XML deleted file mode 100644 index e2696c72f..000000000 --- a/Libraries/SubSonic.Core.XML +++ /dev/null @@ -1,4624 +0,0 @@ - - - - SubSonic.Core - - - - - Summary for the SqlFragment class - - - - - A Repository class which wraps the a Database by type - - - - - Loads a T object - - - The item. - The column. - The value. - - - - - Loads a T object - - - The item. - The expression. - - - - - Returns all T items - - - - - Returns a single record - - - - - Returns a server-side Paged List - - - - - Returns a server-side Paged List - - - - - Returns a server-side Paged List - - - - - Returns an IQueryable based on the passed-in Expression Chinook Database - - - - - Returns an IQueryable based on the passed-in Expression Chinook Database - - - - - Adds a T item to the db - - - - - Adds a T item to the db - - - - - Adds a bunch of T items - - - - - Adds a bunch of T items - - - - - Updates the passed-in T - - - - - Updates the passed-in T - - - - - Updates the passed-in T - - - - - Updates the passed-in T - - - - - Deletes the passed-in T items - - - - - Deletes the passed-in T items - - - - - Deletes the passed-in T item - - - - - Deletes the passed-in T item - - - - - Deletes the T item by Primary Key - - - - - Deletes the T item by Primary Key - - - - - Deletes 0 to n T items from the Database based on the passed-in Expression - - - - - Deletes 0 to n T items from the Database based on the passed-in Expression - - - - - Finds the first sub-expression that accesses a Query<T> object - - - - - Converts user arguments into named-value parameters - - - - - An extended expression visitor including custom DbExpression nodes - - - - - Returns the SqlDbType for a give DbType - - - - - - Takes the properties of an object and turns them into SubSonic.Query.Constraint - - - - - - - Coerces an IDataReader to try and load an object using name/property matching - - - - - Loads a single primitive value type - - - - - - Toes the type of the enumerable value. - - - The IDataReader to read from. - - - - - Determines whether [is core system type] [the specified type]. - - The type. - - true if [is core system type] [the specified type]; otherwise, false. - - - - - Coerces an IDataReader to load an enumerable of T - - - - - Invoked when a new item is created - - - - Creates a typed list from an IDataReader - - - - - Builds a SubSonic UPDATE query from the passed-in object - - - - - Builds a SubSonic INSERT query from the passed-in object - - - - - Builds a SubSonic DELETE query from the passed-in object - - - - - Defines the language rules for the query provider - - - - - - - - - - - - - - - - Generates the command line. - - - - - - Generates the constraints. - - - - - - Generates from list. - - - - - - Generates the order by. - - - - - - Generates the group by. - - - - - - Generates the joins. - - - - - - Gets the paging SQL wrapper. - - - - - - Gets the select columns. - - - - - - Finds the column. - - Name of the column. - - - - - Builds the select statement. - - - - - - Builds the paged select statement. - - - - - - Builds the update statement. - - - - - - Builds the insert statement. - - - - - - Builds the delete statement. - - - - - - Sets the insert query. - - The q. - - - - SqlFragment. Field values may change depending on the inheriting Generator. - - - - - Initializes a new instance of the class. - - - - - Sets the insert query. - - The q. - - - - Finds the column. - - Name of the column. - - - - - Generates the group by. - - - - - - Generates the command line. - - - - - - Generates the joins. - - - - - - Generates from list. - - - - - - Generates the constraints. - - - - - - Generates the order by. - - - - - - Gets the select columns. - - - - - - Gets the paging SQL wrapper. - - - - - - Builds the paged select statement. - - - - - - Builds the select statement. - - - - - - Builds the update statement. - - - - - - Builds the insert statement. - - - - - - Builds the delete statement. - - - - - - Qualifies the name of the table. - - The TBL. - - - - - Gets the qualified select. - - The table. - - - - - Generates the select column list. - - - - - - Builds the aggregate commands. - - - - - - Generates the 'SELECT' part of an - - The aggregate to include in the SELECT clause - The portion of the SELECT clause represented by this - - The ToString() logic moved from , rather than - including it in the Aggregate class itself... - - - - - Initializes a new instance of the class. - - The query. - - - - Builds the paged select statement. - - - - - - Builds the insert statement. - - - - - - Where, And, Or - - - - - WHERE operator - - - - - AND operator - - - - - OR Operator - - - - - SQL Comparison Operators - - - - - Summary for the SqlComparison class - - - - - A Class for handling SQL Constraint generation - - - - - The query that this constraint is operating on - - - - - Initializes a new instance of the class. - - The condition. - Name of the constraint column. - - - - Initializes a new instance of the class. - - The condition. - Name of the constraint column. - Name of the constraint qualified column. - - - - Initializes a new instance of the class. - - The condition. - Name of the constraint column. - Name of the constraint qualified column. - The constraint construction fragment. - - - - Initializes a new instance of the class. - - The condition. - Name of the constraint column. - The SQL query. - - - - Initializes a new instance of the class. - - The condition. - Name of the constraint column. - Name of the constraint qualified column. - The constraint construction fragment. - The SQL query. - - - - Wheres the specified column name. - - Name of the column. - - - - - Ands the specified column name. - - Name of the column. - - - - - Ors the specified column name. - - Name of the column. - - - - - Gets or sets the name of the table. - - The name of the table. - - - - Gets the comparison operator. - - The comp. - - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Creates a LIKE statement. - - The val. - - - - - Creates a LIKE statement and appends a wildcard to the end of the passed-in value. - - The val. - - - - - Creates a LIKE statement and appends a wildcard to the end of the passed-in value. - - The val. - The wild card. - - - - - Creates a LIKE statement and appends a wildcard to the end of the passed-in value. - - The val. - - - - - Creates a NOT LIKE statement - - The val. - - - - - Determines whether [is greater than] [the specified val]. - - The val. - - - - - Determines whether [is greater than] [the specified val]. - - The val. - - - - - Specifies a SQL IN statement using a nested Select statement - - The select query. - - - - - Specifies a SQL IN statement - - Value array - - - - - Specifies a SQL IN statement - - Value array - - - - - Specifies a SQL IN statement using a nested Select statement - - The select query. - - - - - Specifies a SQL Not IN statement - - Value array - - - - - Specifies a SQL NOT IN statement - - Value array - - - - - Determines whether [is less than] [the specified val]. - - The val. - - - - - Determines whether [is less than] [the specified val]. - - The val. - - - - - Determines whether [is not null] [the specified val]. - - - - - - Determines whether the specified val is null. - - - - - - Determines whether [is between and] [the specified val1]. - - The val1. - The val2. - - - - - Determines whether [is equal to] [the specified val]. - - The val. - - - - - Determines whether [is not equal to] [the specified val]. - - The val. - - - - - Gets or sets the condition. - - The condition. - - - - Gets or sets the name of the column. - - The name of the column. - - - - Gets or sets the fully qualified name of the column. - - The name of the column. - - - - Gets or sets the string fragment used when assembling the text of query. - - The construction fragment. - - - - Gets or sets the comparison. - - The comparison. - - - - Gets or sets the parameter value. - - The parameter value. - - - - Gets or sets the start value. - - The start value. - - - - Gets or sets the end value. - - The end value. - - - - Gets or sets the in values. - - The in values. - - - - Gets or sets the in select. - - The in select. - - - - Gets or sets the name of the parameter. - - The name of the parameter. - - - - Gets or sets the type of the db. - - The type of the db. - - - - Gets or sets a value indicating whether this constraint is an Aggregate. - - - true if this instance is aggregate; otherwise, false. - - - - - returns the set of all aliases produced by a query source - - - - - Removes joins expressions that are identical to joins that already exist - - - - - MySQL specific QueryLanguage - - - - - - Defines the language rules for the query provider - - - - - Determines whether the CLR type corresponds to a scalar data type in the query language - - - - - - - Determines whether the given expression can be represented as a column in a select expressionss - - - - - - - Provides language specific query translation. Use this to apply language specific rewrites or - to make assertions/validations about the query. - - - - - - - Converts the query expression into text of this query language - - - - - - - Determine which sub-expressions must be parameters - - - - - - - Creates a set of SQL commands for synchronizing your database with your object set - - - - - Type related helper methods - - - - - SQLite specific QueryLanguage - - - - - Adds relationship to query results depending on policy - - - - - Holds list of tables, views, stored procedures, etc. - - - - - - - - - - - Initializes a new instance of the class. - - The query. - - - - Gets the type of the native. - - Type of the db. - - - - - Generates SQL for all the columns in table - - Table containing the columns. - - SQL fragment representing the supplied columns. - - - - - Generates from list. - - - - - - Sets the column attributes. - - The column. - - - - - Builds the paged select statement. - - - - - - Builds the delete query. - - The item. - - - - - Builds the insert query. - - The item. - - - - - Builds the update query. - - The item. - - - - - For Jeff Atwood - http://www.codinghorror.com/blog/archives/000989.html - - - A class which wraps an inline SQL call - - Updated to support MySQL user and system variables. - - If the connection string contains "Allow User Variables=true" and the provider - is MySQL, the following syntax is supported: - - @parametername - a command parameter - @@uservariable - a MySQL user variable - @@@servervariable - a MySQL server variable - - eg: UPDATE company SET next_job_id = @@job_id:=next_job_id+1 WHERE company_id=@company_id; - SELECT @@job_id; - - where: @company_id is a command parameter. - @@job_id is a MySql user variable. - - - - - - - Initializes a new instance of the class. - Warning: This method assumes the default provider is intended. - Call InlineQuery(string providerName) if this is not the case. - - The SQL. - - - - Initializes a new instance of the class. - - The SQL. - The values. - - - - Initializes a new instance of the class. - - The provider. - - - - Gets the command. - - - - - - Executes the specified SQL. - - - - - Executes the scalar. - - The type of the result. - - - - - Executes the typed list. - - - - - - - Executes the reader. - - - - - - Initializes a new instance of the class. - Warning: This method assumes the default provider is intended. - Call InlineQuery(string providerName) if this is not the case. - - The SQL. - - - - Initializes a new instance of the class. - - The SQL. - The values. - - - - Initializes a new instance of the class. - - The provider. - - - - A holder for 1 or more queries to be executed together - - - - - Builds the SQL statement. - - - - - - Executes this instance. - - - - - - Executes the queries in and returns a multiple result set reader. - - - - - - Gets a command containing all the queued queries. - - - - - - Queues the specified query. - - The query. - - - - Queues the specified query. - - - The query. - - - - Queues a query for use in a transaction. - - The qry. - - - - Queues a query for use in a transaction. - - The CMD. - - - - Queues a query for use in a transaction. - - The SQL. - The parameters. - - - - Executes the transaction. - - - - - TSQL specific QueryLanguage - - - - - Attempts to rewrite cross-apply and outer-apply joins as inner and left-outer joins - - - - - Writes out an expression tree (including DbExpression nodes) in a C#-ish syntax - - - - - Writes out an expression tree in a C#-ish syntax - - - - - A basic abstract LINQ query provider - - - - - Optional interface for IQueryProvider to implement Query<T>'s QueryText property. - - - - - Simple implementation of the IGrouping<TKey, TElement> interface - - - - - - - Formats a query expression into TSQL language syntax - - - - - Formats a query expression into TSQL language syntax - - - - - rewrites nested projections into client-side joins - - - - - Defines mapping information and rules for the query provider - - - - - Determines if a give CLR type is mapped as a database entity - - - - - - - Deterimines is a property is mapped onto a column or relationship - - - - - - - Determines if a property is mapped onto a column - - - - - - - Determines if a property represents or is part of the entities unique identity (often primary key) - - - - - - - Determines if a property is mapped as a relationship - - - - - - - The type of the entity on the other side of the relationship - - - - - - - The name of the corresponding database table - - - - - - - The name of the corresponding table column - - - - - - - A sequence of all the mapped members - - - - - - - Determines if a relationship property refers to a single optional entity (as opposed to a collection.) - - - - - - - Get a query expression that selects all entities from a table - - - - - - - Gets an expression that constructs an entity instance relative to a root. - The root is most often a TableExpression, but may be any other experssion such as - a ConstantExpression. - - - - - - - - Get the members for the key properities to be joined in an association relationship - - - - - - - - Get an expression for a mapped property relative to a root expression. - The root is either a TableExpression or an expression defining an entity instance. - - - - - - - - Get a function that coerces an a sequence of one type into another type. - This is primarily used for aggregators stored in ProjectionExpression's, which are used to represent the - final transformation of the entire result set of a query. - - The expected type. - The actual type. - - - - - Apply mapping translations to this expression - - - - - - - The language related to the mapping - - - - - A LINQ IQueryable query provider that executes database queries over a DbConnection - - - - - DbQueryProvider constrcutor that allows for external control of policy - to allow for new types of databases. - - - - - Converts the query expression into text that corresponds to the command that would be executed. - Useful for debugging. - - - - - - - Execute the query expression (does translation, etc.) - - - - - - - Convert the query expression into an execution plan - - - - - - - Do all query translations execpt building the execution plan - - - - - - - Determines whether a given expression can be executed locally. - (It contains no parts that should be translated to the target environment.) - - - - - - - Execute an actual query specified in the target language using the sADO connection - - - - - - - - - Get an IEnumerable that will execute the specified query when enumerated - - - - - - - - - Get an ADO command object initialized with the command-text and parameters - - - - - - - - - Write a command to the log - - - - - - - - - - - Initializes a new instance of the class. - - From. - To. - Type of the join. - - - - Gets the join type value. - - The j. - - - - - - Gets or sets the type. - - The type. - - - - Gets or sets from column. - - From column. - - - - Gets or sets to column. - - To column. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Singles the specified expression. - - - The expression. - - - - - Singles the specified key. - - - The key. - - - - - Retrieves subset of records from the database matching the expression - - - - - Gets the paged. - - - Index of the page. - Size of the page. - - - - - Gets the paged. - - - The sort by. - Index of the page. - Size of the page. - - - - - Adds the specified item, setting the key if available. - - - The item. - - - - - Adds a lot of the items using a transaction. - - - The items. - - - - Updates the specified item. - - - The item. - - - - - Updates lots of items using a transaction. - - - The items. - - - - - Deletes the specified key. - - - The key. - - - - - Deletes 1 or more items. - - - The expression. - - - - - Deletes 1 or more items. - - - The items. - - - - - Migrates this instance. - - - - - - Formats a query expression into TSQL language syntax - - - - - Returns an Object with the specified Type and whose value is equivalent to the specified object. - - An Object that implements the IConvertible interface. - - An object whose Type is conversionType (or conversionType's underlying type if conversionType - is Nullable<>) and whose value is equivalent to value. -or- a null reference, if value is a null - reference and conversionType is not a value type. - - - This method exists as a workaround to System.Convert.ChangeType(Object, Type) which does not handle - nullables as of version 2.0 (2.0.50727.42) of the .NET Framework. The idea is that this method will - be deleted once Convert.ChangeType is updated in a future version of the .NET Framework to handle - nullable types, so we want this to behave as closely to Convert.ChangeType as possible. - This method was written by Peter Johnson at: - http://aspalliance.com/author.aspx?uId=1026. - - - - - - Process the passed-in LINQ expression - - - - - - Initializes the shared connection. - - - - - - Initializes the shared connection. - - The shared connection string. - - - - - Resets the shared connection. - - - - - Adds the params. - - The CMD. - The qry. - - - - Converts a data reader into a sequence of objects using a projector function on each row - - - The reader. - The fn projector. - - - - - Gets a value indicating whether [current connection string is default]. - - - true if [current connection string is default]; otherwise, false. - - - - - Gets or sets the current shared connection. - - The current shared connection. - - - - Creates a reusable, parameterized representation of a query that caches the execution plan - - - - - Summary for the Files class - - - - - Read a text file and obtain it's contents. - - The complete file path to write to. - String containing the content of the file. - - - - Creates or opens a file for writing and writes text to it. - - The complete file path to write to. - A String containing text to be written to the file. - - - - Update text within a file by replacing a substring within the file. - - The complete file path to write to. - A String to be replaced. - A String to replace all occurrences of lookFor. - - - - Writes out a string to a file. - - The complete file path to write to. - A String containing text to be written to the file. - - - - Fetches a web page - - The URL. - - - - - Gets a value indicating whether this instance is numeric. - - - true if this instance is numeric; otherwise, false. - - - - - Gets a value indicating whether this instance is date time. - - - true if this instance is date time; otherwise, false. - - - - - Gets a value indicating whether this instance is string. - - true if this instance is string; otherwise, false. - - - - Gets a value indicating whether this instance is numeric. - - - true if this instance is numeric; otherwise, false. - - - - - Gets a value indicating whether this instance is date time. - - - true if this instance is date time; otherwise, false. - - - - - Gets a value indicating whether this instance is string. - - true if this instance is string; otherwise, false. - - - - Summary for the ReservedColumnName class - - - - - A schema generator for your DB - - - - - Builds a CREATE TABLE statement. - - - - - - - Builds a DROP TABLE statement. - - Name of the table. - - - - - Adds the column. - - Name of the table. - The column. - - - - Alters the column. - - The column. - - - - Removes the column. - - Name of the table. - Name of the column. - - - - - Gets the type of the native. - - Type of the db. - - - - - Generates the columns. - - Table containing the columns. - - SQL fragment representing the supplied columns. - - - - - Sets the column attributes. - - The column. - - - - - Builds a CREATE TABLE statement. - - - - - - - Builds a DROP TABLE statement. - - Name of the table. - - - - - Adds the column. - - Name of the table. - The column. - - - - - Alters the column. - - The column. - - - - Removes the column. - - Name of the table. - Name of the column. - - - - - Gets the type of the native. - - Type of the db. - - - - - Generates the columns. - - Table containing the columns. - - SQL fragment representing the supplied columns. - - - - - Sets the column attributes. - - The column. - - - - - Gets an ITable from the DB based on name - - - - - Creates a list of table names - - - - - Sets the column attributes. - - The column. - - - - - Gets the type of the db. - - Type of the SQL. - - - - - Returns Schema instance with empty lists. - - - - - Rewrites nested singleton projection into server-side joins - - - - - Initializes the class. - - - - - Strips the last specified chars from a string. - - The source string. - The remove from end. - - - - - Strips the last specified chars from a string. - - The source string. - The back down to. - - - - - Plurals to singular. - - The source string. - - - - - Singulars to plural. - - The source string. - - - - - Make plural when count is not one - - The number of things - The source string. - - - - - Removes the specified chars from the beginning of a string. - - The source string. - The remove from beginning. - - - - - Removes chars from the beginning of a string, up to the specified string - - The source string. - The remove up to. - - - - - Strips the last char from a a string. - - The source string. - - - - - Strips the last char from a a string. - - The source string. - - - - - Fasts the replace. - - The original. - The pattern. - The replacement. - - - - - Fasts the replace. - - The original. - The pattern. - The replacement. - Type of the comparison. - - - - - Returns text that is located between the startText and endText tags. - - The source string. - The text from which to start the crop - The endpoint of the crop - - - - - Removes excess white space in a string. - - The source string. - - - - - Removes all non-alpha numeric characters in a string - - The source string. - - - - - Creates a string array based on the words in a sentence - - The source string. - - - - - Strips all HTML tags from a string - - The HTML string. - - - - - Strips all HTML tags from a string and replaces the tags with the specified replacement - - The HTML string. - The HTML place holder. - - - - - Converts a generic List collection to a single comma-delimitted string. - - The list. - - - - - Converts a generic List collection to a single string using the specified delimitter. - - The list. - The delimiter. - - - - - Strips the specified input. - - The source string. - The strip value. - - - - - Converts ASCII encoding to Unicode - - The ASCII code. - - - - - Converts Text to HTML-encoded string - - The text string. - - - - - Converts HTML-encoded bits to Text - - The entity text. - - - - - Formats the args using String.Format with the target string as a format string. - - The format string passed to String.Format - The args passed to String.Format - - - - - Strings to enum. - - - The value. - - - - - Fills the entities. - - - - - Converts US State Name to it's two-character abbreviation. Returns null if the state name was not found. - - US State Name (ie Texas) - - - - - Converts a two-character US State Abbreviation to it's official Name Returns null if the abbreviation was not found. - - US State Name (ie Texas) - - - - - Fills the US States. - - - - - Type related helper methods - - - - - Removes the column. - - - - - - - - Sets the column attributes. - - The column. - - - - - Gets the type of the db. - - Type of the SQL. - - - - - - - - - - - - - - - Initializes a new instance of the class. - - The provider. - - - - Validates the query. - - - - - Finds the column. - - Name of the column. - - - - - Wheres the specified column name. - - Name of the column. - - - - - Wheres the specified column. - - The column. - - - - - Wheres the specified agg. - - The agg. - - - - - Ors the specified column name. - - Name of the column. - - - - - Ors the specified column. - - The column. - - - - - Ors the specified agg. - - The agg. - - - - - Ors the expression. - - Name of the column. - - - - - Opens the expression. - - - - - - Closes the expression. - - - - - - Ands the specified column name. - - Name of the column. - - - - - Ands the specified column. - - The column. - - - - - Ands the specified agg. - - The agg. - - - - - Ands the expression. - - Name of the column. - - - - - Returns the currently set SQL statement for this query object - - - - - - Builds the SQL statement. - - - - - - Froms the specified TBL. - - The TBL. - - - - - Froms the specified TBL. - - Name of the table. - - - - - Froms the specified TBL. - - - - - - - Creates an inner join based on the passed-in column names - - - - - - - - - Creates an Inner Join, guessing based on Primary Key matching - - - - - - - Inners the join. - - From column. - To column. - - - - - Outers the join. - - From column. - To column. - - - - - Crosses the join. - - From column. - To column. - - - - - Lefts the inner join. - - From column. - To column. - - - - - Rights the inner join. - - From column. - To column. - - - - - Lefts the outer join. - - From column. - To column. - - - - - Rights the outer join. - - From column. - To column. - - - - - Nots the equal join. - - From column. - To column. - - - - - Orders the asc. - - The columns. - - - - - Orders the desc. - - The columns. - - - - - Pageds the specified current page. - - The current page. - Size of the page. - - - - - Pageds the specified current page. - - The current page. - Size of the page. - The id column. - - - - - Executes this instance. - - - - - - Executes the reader. - - - - - - Executes the scalar. - - - - - - Executes the scalar. - - The type of the result. - - - - - Gets the record count. - - - - - - Executes the typed list. - - - - - - - Executes the typed list. - - - - - - - Executes the query and returns the result as a single item of T - - The type of item to return - - - - Executes the transaction. - - The queries. - - - - Executes the transaction. - - The queries. - Name of the connection string. - - - - Gets or sets the open paren count. - - The open paren count. - - - - Gets or sets the closed paren count. - - The closed paren count. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The table. - The provider. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Removes one or more SelectExpression's by rewriting the expression tree to not include them, promoting - their from clause expressions and rewriting any column expressions that may have referenced them to now - reference the underlying data directly. - - - - - Rewrites take and skip expressions into uses of TSQL row_number function - - - - - Translates accesses to relationship members into projections or joins - - - - - Determines if two expressions are equivalent. Supports DbExpression nodes. - - - - - Compare two expressions to determine if they are equivalent - - - - - - - - - - Initializes a new instance of the class. - - The provider. - The columns. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The aggregates. - - - - Initializes a new instance of the class. - - The provider. - The aggregates. - - - - Initializes a new instance of the class. - - The columns. - - - - Initializes a new instance of the class. - WARNING: This overload should only be used with applications that use a single provider! - - The columns. - - - - Alls the columns from. - - - - - - - Expressions the specified SQL expression. - - The SQL expression. - - - - - Tops the specified top. - - The top. - - - - - Gets the type of the native. - - Type of the db. - - - - - Generates the columns. - - Table containing the columns. - - SQL fragment representing the supplied columns. - - - - - Builds a CREATE TABLE statement. - - - - - - - Sets the column attributes. - - The column. - - - - - Gets the type of the db. - - Type of my SQL. - - - - - Rewrite aggregate expressions, moving them into same select expression that has the group-by clause - - - - - Replaces references to one specific instance of an expression node with another node. - Supports DbExpression nodes - - - - - Summary for the Dates class - - - - - Returns a date in the past by days. - - The days. - - - - - Returns a date in the future by days. - - The days. - - - - - Returns a date in the past by hours. - - The hours. - - - - - Returns a date in the future by hours. - - The hours. - - - - - Returns a date in the past by minutes - - The minutes. - - - - - Returns a date in the future by minutes. - - The minutes. - - - - - Gets a date in the past according to seconds - - The seconds. - - - - - Gets a date in the future by seconds. - - The seconds. - - - - - Diffs the specified date. - - The date one. - The date two. - - - - - Returns a double indicating the number of days between two dates (past is negative) - - The date one. - The date two. - - - - - Returns a double indicating the number of days between two dates (past is negative) - - The date one. - The date two. - - - - - Returns a double indicating the number of days between two dates (past is negative) - - The date one. - The date two. - - - - - Returns a double indicating the number of days between two dates (past is negative) - - The date one. - The date two. - - - - - Returns a double indicating the number of days between two dates (past is negative) - - The date one. - The date two. - - - - - Returns a double indicating the number of days between two dates (past is negative) - - The date one. - The date two. - - - - - Displays the difference in time between the two dates. Return example is "12 years 4 months 24 days 8 hours 33 minutes 5 seconds" - - The start time. - The end time. - - - - - Counts the number of weekdays between two dates. - - The start time. - The end time. - - - - - Counts the number of weekends between two dates. - - The start time. - The end time. - - - - - Verifies if the object is a date - - The dt. - - true if the specified dt is date; otherwise, false. - - - - - Checks to see if the date is a week day (Mon - Fri) - - The dt. - - true if [is week day] [the specified dt]; otherwise, false. - - - - - Checks to see if the date is Saturday or Sunday - - The dt. - - true if [is week end] [the specified dt]; otherwise, false. - - - - - Displays the difference in time between the two dates. Return example is "12 years 4 months 24 days 8 hours 33 minutes 5 seconds" - - The start time. - The end time. - - - - - Given a datetime object, returns the formatted month and day, i.e. "April 15th" - - The date to extract the string from - - - - - Given a datetime object, returns the formatted day, "15th" - - The date to extract the string from - - - - - Remove leading strings with zeros and adjust for singular/plural - - The STR. - The previous STR. - The t. - - - - - Replaces references to one specific instance of an expression node with another node - - - - - Moves order-bys to the outermost select if possible - - - - - Add a sequence of order expressions to an accumulated list, prepending so as - to give precedence to the new expressions over any previous expressions - - - - - - Rebind order expressions to reference a new alias and add to column declarations if necessary - - - - - Defines query execution and materialization policies. - - - - - Determines if a relationship property is to be included in the results of the query - - - - - - - Determines if a relationship property is included, but the query for the related data is - deferred until the property is first accessed. - - - - - - - Provides policy specific query translations. This is where choices about inclusion of related objects and how - heirarchies are materialized affect the definition of the queries. - - - - - - - Converts a query into an execution plan. The plan is an function that executes the query and builds the - resulting objects. - - - - - - - - The mapping related to the policy. - - - - - A simple query mapping that attempts to infer mapping from naming conventionss - - - - - Summary for the Numbers class - - - - - Determines whether a number is a natural number (positive, non-decimal) - - The s item. - - true if [is natural number] [the specified s item]; otherwise, false. - - - - - Determines whether [is whole number] [the specified s item]. - - The s item. - - true if [is whole number] [the specified s item]; otherwise, false. - - - - - Determines whether the specified s item is integer. - - The s item. - - true if the specified s item is integer; otherwise, false. - - - - - Determines whether the specified s item is number. - - The s item. - - true if the specified s item is number; otherwise, false. - - - - - Determines whether the specified value is an even number. - - The value. - - true if the specified value is even; otherwise, false. - - - - - Determines whether the specified value is an odd number. - - The value. - - true if the specified value is odd; otherwise, false. - - - - - Generates a random number with an upper bound - - The high. - - - - - Generates a random number between the specified bounds - - The low. - The high. - - - - - Generates a random double - - - - - - This set of classes abstracts out commands and their parameters so that - the DataProviders can work their magic regardless of the client type. The - System.Data.Common class was supposed to do this, but sort of fell flat - when it came to MySQL and other DB Providers that don't implement the Data - Factory pattern. Abstracts out the assignment of parameters, etc - - - - - Gets or sets the size. - - The size. - - - - Gets or sets the mode. - - The mode. - - - - Gets or sets the name of the parameter. - - The name of the parameter. - - - - Gets or sets the parameter value. - - The parameter value. - - - - Gets or sets the type of the data. - - The type of the data. - - - - Summary for the QueryParameterCollection class - - - - - Checks to see if specified parameter exists in the current collection - - - - - - - returns the specified QueryParameter, if it exists in this collection - - - - - - - Adds the specified parameter name. - - Name of the parameter. - The value. - - - - Adds the specified parameter name. - - Name of the parameter. - The value. - Type of the data. - - - - Adds the specified parameter name. - - Name of the parameter. - The value. - Type of the data. - The mode. - - - - Summary for the QueryCommandCollection class - - - - - Summary for the QueryCommand class - - - - - - - - - - Initializes a new instance of the class. - - The SQL. - The provider. - - - - Determines whether [has output params]. - - - true if [has output params]; otherwise, false. - - - - - Adds the parameter. The public AddParameter methods should call this one. - - Name of the parameter. - The parameter value. - Size of the max. - Type of the db. - The direction. - - - - Adds the parameter. - - Name of the parameter. - The parameter value. - Type of the data. - The parameter direction. - - - - Adds the parameter. - - Name of the parameter. - The parameter value. - Type of the data. - - - - Adds the parameter. - - Name of the parameter. - The parameter value. - - - - Adds the output parameter. - - Name of the parameter. - Size of the max. - Type of the db. - - - - Adds the output parameter. - - Name of the parameter. - Size of the max. - - - - Adds the output parameter. - - Name of the parameter. - - - - Adds the output parameter. - - Name of the parameter. - Type of the db. - - - - Adds a return parameter (RETURN_VALUE) to the command. - - - - - - Suggested by feroalien@hotmail.com - Issue 11 fix - - - - - - Gets or sets the command timeout (in seconds). - - The command timeout. - - - - Gets or sets the type of the command. - - The type of the command. - - - - Gets or sets the command SQL. - - The command SQL. - - - - Gets or sets the parameters. - - The parameters. - - - - A default implementation of IQueryable for use with QueryProvider - - - - - Removes column declarations in SelectExpression's that are not referenced - - - - - - - - - Rewrites an expression tree so that locally isolatable sub-expressions are evaluated and converted into ConstantExpression nodes. - - - - - Performs evaluation and replacement of independent sub-trees - - The root of the expression tree. - A function that decides whether a given expression node can be part of the local function. - A new tree with sub-trees evaluated and replaced. - - - - Performs evaluation and replacement of independent sub-trees - - The root of the expression tree. - A new tree with sub-trees evaluated and replaced. - - - - Evaluates and replaces sub-trees when first candidate is reached (top-down) - - - - - Performs bottom-up analysis to determine which nodes can possibly - be part of an evaluated sub-tree. - - - - - Removes column declarations in SelectExpression's that are not referenced - - - - - Converts LINQ query operators to into custom DbExpression's - - - - - returns the set of all aliases produced by a query source - - - - - Result from calling ColumnProjector.ProjectColumns - - - - - Splits an expression into two parts - 1) a list of column declarations for sub-expressions that must be evaluated on the server - 2) a expression that describes how to combine/project the columns back together into the correct result - - - - - Nominator is a class that walks an expression tree bottom up, determining the set of - candidate expressions that are possible columns of a select expression - - - - - Converts the string method calls Contains,EndsWith and StartsWith into queries - - The MethodCall we are attempting to map to a query. - an expression tree. - - - - Executes the specified SQL. - - - - - Executes the scalar. - - The type of the result. - - - - - Executes the typed list. - - - - - - - Executes the reader. - - - - - - Enum for General SQL Functions - - - - - - - - - - Counts the specified col. - - The col. - - - - - Counts the specified col. - - The col. - The alias. - - - - - Counts the specified column name. - - Name of the column. - - - - - Counts the specified column name. - - Name of the column. - The alias. - - - - - Sums the specified col. - - The col. - - - - - Sums the specified column name. - - Name of the column. - - - - - Sums the specified col. - - The col. - The alias. - - - - - Sums the specified column name. - - Name of the column. - The alias. - - - - - Groups the by. - - The col. - - - - - Groups the by. - - Name of the column. - - - - - Groups the by. - - The col. - The alias. - - - - - Groups the by. - - Name of the column. - The alias. - - - - - Avgs the specified col. - - The col. - - - - - Avgs the specified column name. - - Name of the column. - - - - - Avgs the specified col. - - The col. - The alias. - - - - - Avgs the specified column name. - - Name of the column. - The alias. - - - - - Maxes the specified col. - - The col. - - - - - Maxes the specified column name. - - Name of the column. - - - - - Maxes the specified col. - - The col. - The alias. - - - - - Maxes the specified column name. - - Name of the column. - The alias. - - - - - Mins the specified col. - - The col. - - - - - Mins the specified column name. - - Name of the column. - - - - - Mins the specified col. - - The col. - The alias. - - - - - Mins the specified column name. - - Name of the column. - The alias. - - - - - Variances the specified col. - - The col. - - - - - Variances the specified column name. - - Name of the column. - - - - - Variances the specified col. - - The col. - The alias. - - - - - Variances the specified column name. - - Name of the column. - The alias. - - - - - Standards the deviation. - - The col. - - - - - Standards the deviation. - - Name of the column. - - - - - Standards the deviation. - - The col. - The alias. - - - - - Standards the deviation. - - Name of the column. - The alias. - - - - - Initializes a new instance of the class. - - Name of the column. - Type of the aggregate. - - - - Initializes a new instance of the class. - - Name of the column. - The alias. - Type of the aggregate. - - - - Initializes a new instance of the class. - - The column. - Type of the aggregate. - - - - Initializes a new instance of the class. - - The column. - The alias. - Type of the aggregate. - - - - Gets the type of the function. - - The agg. - - - - - Gets the SQL function call without an alias. Example: AVG(UnitPrice). - - - - - - Overrides ToString() to return the SQL Function call - - - - - - Gets or sets the type of the aggregate. - - The type of the aggregate. - - - - Gets or sets the name of the column. - - The name of the column. - - - - Gets or sets the alias. - - The alias. - - - - Common interface for controlling defer-loadable types - - - - - A list implementation that is loaded the first the contents are examined - - - - - - returns the list of SelectExpressions accessible from the source expression - - - - - Builds an execution plan for a query expression - - - - - columns referencing the outer alias are turned into special named-value parameters - - - - - Extended node types for custom expressions - - - - - A custom expression node that represents a table reference in a SQL query - - - - - A custom expression node that represents a reference to a column in a SQL query - - - - - A declaration of a column in a SQL SELECT expression - - - - - An SQL OrderBy order type - - - - - A pairing of an expression and an order type for use in a SQL Order By clause - - - - - A custom expression node used to represent a SQL SELECT expression - - - - - A kind of SQL join - - - - - A custom expression node representing a SQL join clause - - - - - Allows is-null tests against value-types like int and float - - - - - A custom expression representing the construction of one or more result objects from a - SQL select expression - - - - - Summary for the Validation class - - - - - Determines whether the specified eval string contains only alpha characters. - - The eval string. - - true if the specified eval string is alpha; otherwise, false. - - - - - Determines whether the specified eval string contains only alphanumeric characters - - The eval string. - - true if the string is alphanumeric; otherwise, false. - - - - - Determines whether the specified eval string contains only alphanumeric characters - - The eval string. - if set to true [allow spaces]. - - true if the string is alphanumeric; otherwise, false. - - - - - Determines whether the specified eval string contains only numeric characters - - The eval string. - - true if the string is numeric; otherwise, false. - - - - - Determines whether the specified email address string is valid based on regular expression evaluation. - - The email address string. - - true if the specified email address is valid; otherwise, false. - - - - - Determines whether the specified string is lower case. - - The input string. - - true if the specified string is lower case; otherwise, false. - - - - - Determines whether the specified string is upper case. - - The input string. - - true if the specified string is upper case; otherwise, false. - - - - - Determines whether the specified string is a valid GUID. - - The GUID. - - true if the specified string is a valid GUID; otherwise, false. - - - - - Determines whether the specified string is a valid US Zip Code, using either 5 or 5+4 format. - - The zip code. - - true if it is a valid zip code; otherwise, false. - - - - - Determines whether the specified string is a valid US Zip Code, using the 5 digit format. - - The zip code. - - true if it is a valid zip code; otherwise, false. - - - - - Determines whether the specified string is a valid US Zip Code, using the 5+4 format. - - The zip code. - - true if it is a valid zip code; otherwise, false. - - - - - Determines whether the specified string is a valid Social Security number. Dashes are optional. - - The Social Security Number - - true if it is a valid Social Security number; otherwise, false. - - - - - Determines whether the specified string is a valid IP address. - - The ip address. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is a valid US phone number using the referenced regex string. - - The telephone number. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is a valid currency string using the referenced regex string. - - The currency string. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is a valid URL string using the referenced regex string. - - The URL string. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is consider a strong password based on the supplied string. - - The password. - - true if strong; otherwise, false. - - - - - Determines whether the specified string is a valid credit, based on matching any one of the eight credit card strings - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is an American Express, Discover, MasterCard, or Visa - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is an American Express card - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is an Carte Blanche card - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is an Diner's Club card - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is a Discover card - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is an En Route card - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is an JCB card - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is a Master Card credit card - - The credit card. - - true if valid; otherwise, false. - - - - - Determines whether the specified string is Visa card. - - The credit card. - - true if valid; otherwise, false. - - - - - Cleans the credit card number, returning just the numeric values. - - The credit card. - - - - - Determines whether the credit card number, once cleaned, passes the Luhn algorith. - See: http://en.wikipedia.org/wiki/Luhn_algorithm - - The credit card number. - - - - - Determines whether the specified int array passes the Luhn algorith - - The int array to evaluate - - true if it validates; otherwise, false. - - - - - Determine whether the passed string is numeric, by attempting to parse it to a double - - The string to evaluated for numeric conversion - - true if the string can be converted to a number; otherwise, false. - - - - - Summary for the RegexPattern class - - - - - An enumeration value for no options configured. - - - - - The default set of options (right now the same as none). - - - - - Use this flag to let the repository run migrations. - - - - - - - - - - - - - - - - - - - - Summary for the Inflector class - - - - - Initializes the class. - - - - - Adds the irregular rule. - - The singular. - The plural. - - - - Adds the unknown count rule. - - The word. - - - - Adds the plural rule. - - The rule. - The replacement. - - - - Adds the singular rule. - - The rule. - The replacement. - - - - Makes the plural. - - The word. - - - - - Makes the singular. - - The word. - - - - - Applies the rules. - - The rules. - The word. - - - - - Converts the string to title case. - - The word. - - - - - Converts the string to human case. - - The lowercase and underscored word. - - - - - Convert string to proper case - - The source string. - - - - - Converts the string to pascal case. - - The lowercase and underscored word. - - - - - Converts text to pascal case... - - The text. - if set to true [remove underscores]. - - - - - Converts the string to camel case. - - The lowercase and underscored word. - - - - - Adds the underscores. - - The pascal cased word. - - - - - Makes the initial caps. - - The word. - - - - - Makes the initial lower case. - - The word. - - - - - Adds the ordinal suffix. - - The number. - - - - - Converts the underscores to dashes. - - The underscored word. - - - - - Summary for the InflectorRule class - - - - - - - - - - - - - - - Initializes a new instance of the class. - - The regex pattern. - The replacement text. - - - - Applies the specified word. - - The word. - - - - - - - - - - Equals to. - - The value. - - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The table. - - - - Sets the specified column name. - - Name of the column. - - - - - Sets the expression. - - The column. - - - - - Executes this instance. - - - - - - - - - - - Initializes a new instance of the class. - - The provider. - - - - Sets the specified columns. - - The columns. - - - - - Parses the object value. - - The expression. - - - - - Parses the passed-in Expression into exclusive (WHERE x=y) constraints. - - The exp. - - - - - Parses the passed-in Expression into exclusive (WHERE x=y) constraint. - - The expression. - - - - - Determines whether the specified exp is constraint. - - The exp. - - true if the specified exp is constraint; otherwise, false. - - - - - Gets the constant value. - - The exp. - - - - - - - - - - - Initializes a new instance of the class. - - The query. - - - - Builds the paged select statement. - - - - - - Builds the insert statement. - - - - - - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The provider. - - - - Builds the SQL statement. - - - - - - Adds the specified columns into a new Insert object. - - - The columns. - - - - - Adds the specified columns into a new Insert object. - - - The TBL. - - - - - Inits this instance. - - - - - - Values the specified column. - - The column. - The column value. - - - - - Values the specified column. - - The column. - The column value. - Type of the db. - - - - - Valueses the specified values. - - The values. - - - - - Values the expression. - - The values. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Executes this instance. - - - - - - Removes select expressions that don't add any additional semantic value - - - - - Removes duplicate column declarations that refer to the same underlying column - - - - - Duplicate the query expression by making a copy with new table aliases - - - - - Rewrite all column references to one or more aliases to a new single alias - - - - - Determines if a SelectExpression contains any aggregate expressions - - - - - Indicates that a per-thread shared DbConnection object should be used the default DataProvider - (or alternativley a specific DataProvider if one is given) when communicating with the database. - This class is designed to be used within a using () {} block and in conjunction with a TransactionScope object. - It's purpose is to force a common DbConnection object to be used which has the effect of avoiding promotion - of a System.Transaction ambient Transaction to the DTC where possible. - When this class is created, it indicates to the underlying DataProvider that is should use a shared DbConnection - for subsequent operations. When the class is disposed (ie the using() {} block ends) it will indicate to the - underlying provider that it should no longer it's current shared connection and should Dispose() it. - - - - - Used to support nesting. By keeping a stack of all instances of the class that are created on this thread - thread we know when it is safe to Reset the underlying shared connection. - - - - - Indicates to the default DataProvider that it should use a per-thread shared connection. - - - - - Indicates to the default DataProvider that it should use a per-thread shared connection using the given connection string. - - The connection string. - Name of the provider. - - - - Indicates to the specified DataProvider that it should use a per-thread shared connection. - - The data provider. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Provides access to underlying connection that is shared per thread - - The current connection. - - - - Used within SubSonic to automatically manage a SqlConnection. If a shared connection is available - for the specified provider on the current thread, that shared connection will be used. - Otherwise, a new connection will be created. - Note that if a shared connection is used, it will NOT be automatically disposed - that is up to the caller. - Lifetime management of the shared connection is taken care of by using a - If a new connection is created, it will be automatically disposed when this AutomaticConnectionScope object - is disposed. - - - - - Initializes a new instance of the class. - - The provider. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Gets the connection. - - - - - - - Gets the connection. - - The connection. - - - - Gets a value indicating whether this instance is using shared connection. - - - true if this instance is using shared connection; otherwise, false. - - - - diff --git a/Libraries/SubSonic.Core.dll b/Libraries/SubSonic.Core.dll deleted file mode 100644 index 94a2c0f3f..000000000 Binary files a/Libraries/SubSonic.Core.dll and /dev/null differ diff --git a/NzbDrone.Core.Test/ConfigProviderTest.cs b/NzbDrone.Core.Test/ConfigProviderTest.cs index bc2805f40..14c93ea98 100644 --- a/NzbDrone.Core.Test/ConfigProviderTest.cs +++ b/NzbDrone.Core.Test/ConfigProviderTest.cs @@ -1,11 +1,9 @@ using AutoMoq; using FluentAssertions; -using Moq; using NUnit.Framework; using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Repository; using NzbDrone.Core.Test.Framework; -using SubSonic.Repository; namespace NzbDrone.Core.Test { @@ -41,6 +39,7 @@ namespace NzbDrone.Core.Test mocker.SetConstant(db); db.Insert(new Config { Key = key, Value = value }); + db.Insert(new Config { Key = "Other Key", Value = "OtherValue" }); //Act var result = mocker.Resolve().GetValue(key, ""); @@ -69,7 +68,7 @@ namespace NzbDrone.Core.Test } [Test] - public void New_value_should_update_old_value() + public void New_value_should_update_old_value_new_value() { const string key = "MY_KEY"; const string originalValue = "OLD_VALUE"; @@ -90,5 +89,26 @@ namespace NzbDrone.Core.Test db.Fetch().Should().HaveCount(1); } + [Test] + public void New_value_should_update_old_value_same_value() + { + const string key = "MY_KEY"; + const string value = "OLD_VALUE"; + + + var mocker = new AutoMoqer(); + var db = MockLib.GetEmptyDatabase(); + mocker.SetConstant(db); + + //Act + mocker.Resolve().SetValue(key, value); + mocker.Resolve().SetValue(key, value); + var result = mocker.Resolve().GetValue(key, ""); + + //Assert + result.Should().Be(value); + db.Fetch().Should().HaveCount(1); + } + } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DiskScanJobTest.cs b/NzbDrone.Core.Test/DiskScanJobTest.cs index 5177c5eb6..bd1e82e44 100644 --- a/NzbDrone.Core.Test/DiskScanJobTest.cs +++ b/NzbDrone.Core.Test/DiskScanJobTest.cs @@ -1,8 +1,6 @@ // ReSharper disable RedundantUsingDirective using System; -using System.Linq; using System.Collections.Generic; -using System.Threading; using AutoMoq; using FizzWare.NBuilder; using Moq; diff --git a/NzbDrone.Core.Test/DownloadProviderTest.cs b/NzbDrone.Core.Test/DownloadProviderTest.cs index 049c15b40..9c24890ff 100644 --- a/NzbDrone.Core.Test/DownloadProviderTest.cs +++ b/NzbDrone.Core.Test/DownloadProviderTest.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using AutoMoq; using FizzWare.NBuilder; using Moq; diff --git a/NzbDrone.Core.Test/EpisodeProviderTest.cs b/NzbDrone.Core.Test/EpisodeProviderTest.cs index 64c634a9e..16289c50f 100644 --- a/NzbDrone.Core.Test/EpisodeProviderTest.cs +++ b/NzbDrone.Core.Test/EpisodeProviderTest.cs @@ -1,20 +1,16 @@ // ReSharper disable RedundantUsingDirective using System; -using System.Linq; using System.Collections.Generic; -using System.Linq.Expressions; +using System.Linq; using AutoMoq; using FizzWare.NBuilder; using FluentAssertions; using Moq; using NUnit.Framework; -using NzbDrone.Core.Model; using NzbDrone.Core.Providers; using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; using PetaPoco; -using SubSonic.Repository; using TvdbLib.Data; namespace NzbDrone.Core.Test diff --git a/NzbDrone.Core.Test/Framework/AutoMoq/AutoMoqerTest.cs b/NzbDrone.Core.Test/Framework/AutoMoq/AutoMoqerTest.cs index d2f9cab5d..4d31e398e 100644 --- a/NzbDrone.Core.Test/Framework/AutoMoq/AutoMoqerTest.cs +++ b/NzbDrone.Core.Test/Framework/AutoMoq/AutoMoqerTest.cs @@ -1,9 +1,8 @@ // ReSharper disable RedundantUsingDirective +using System; using AutoMoq; using Moq; -using System; using NUnit.Framework; -using NzbDrone.Core.Test.Framework; namespace NzbDrone.Core.Test { diff --git a/NzbDrone.Core.Test/Framework/ExceptionVerification.cs b/NzbDrone.Core.Test/Framework/ExceptionVerification.cs index 801b75c60..6cbabaf2d 100644 --- a/NzbDrone.Core.Test/Framework/ExceptionVerification.cs +++ b/NzbDrone.Core.Test/Framework/ExceptionVerification.cs @@ -1,7 +1,7 @@ // ReSharper disable RedundantUsingDirective using System; -using System.Linq; using System.Collections.Generic; +using System.Linq; using NLog; using NLog.Targets; using NUnit.Framework; diff --git a/NzbDrone.Core.Test/Framework/MockLib.cs b/NzbDrone.Core.Test/Framework/MockLib.cs index b0585ea21..4ed4ea6c5 100644 --- a/NzbDrone.Core.Test/Framework/MockLib.cs +++ b/NzbDrone.Core.Test/Framework/MockLib.cs @@ -6,13 +6,10 @@ using System.Linq; using FizzWare.NBuilder; using Moq; using NzbDrone.Core.Datastore; -using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Repository; using NzbDrone.Core.Repository.Quality; using PetaPoco; -using SubSonic.DataProviders; -using SubSonic.Repository; namespace NzbDrone.Core.Test.Framework { @@ -37,32 +34,6 @@ namespace NzbDrone.Core.Test.Framework } - public static IRepository GetEmptyRepository(bool enableLogging = false, string fileName = "") - { - Console.WriteLine("Creating an empty Subsonic repository"); - - if (String.IsNullOrWhiteSpace(fileName)) - { - fileName = Guid.NewGuid() + ".db"; - } - - - var provider = Connection.GetDataProvider(Connection.GetConnectionString(fileName)); - var repo = Connection.CreateSimpleRepository(provider); - ForceMigration(repo); - - //Migrations.Run(Connection.GetConnectionString(fileName), false); - - if (enableLogging) - { - provider.Log = new NlogWriter(); - } - Console.WriteLine("**********************************************************************************"); - Console.WriteLine("*****************************REPO IS READY****************************************"); - Console.WriteLine("**********************************************************************************"); - return repo; - } - public static IDatabase GetEmptyDatabase(bool enableLogging = false, string fileName = "") { Console.WriteLine("Creating an empty PetaPoco database"); @@ -71,9 +42,9 @@ namespace NzbDrone.Core.Test.Framework { fileName = Guid.NewGuid() + ".db"; } - + var connectionString = Connection.GetConnectionString(fileName); - + var database = Connection.GetPetaPocoDb(connectionString); return database; @@ -121,12 +92,5 @@ namespace NzbDrone.Core.Test.Framework .WhereAll().Have(c => c.EpisodeNumber = epNumber.Generate()) .Build(); } - - private static void ForceMigration(IRepository repository) - { - repository.All().Count(); - repository.All().Count(); - repository.All().Count(); - } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/Framework/TestBase.cs b/NzbDrone.Core.Test/Framework/TestBase.cs index 194e78fdd..53f2c57b6 100644 --- a/NzbDrone.Core.Test/Framework/TestBase.cs +++ b/NzbDrone.Core.Test/Framework/TestBase.cs @@ -1,5 +1,4 @@ -using NUnit; -using NUnit.Framework; +using NUnit.Framework; namespace NzbDrone.Core.Test.Framework { diff --git a/NzbDrone.Core.Test/HistoryProviderTest.cs b/NzbDrone.Core.Test/HistoryProviderTest.cs index 2ea187452..b7c405de4 100644 --- a/NzbDrone.Core.Test/HistoryProviderTest.cs +++ b/NzbDrone.Core.Test/HistoryProviderTest.cs @@ -1,6 +1,5 @@ // ReSharper disable RedundantUsingDirective using System; -using System.Collections.Generic; using System.Linq; using AutoMoq; using FizzWare.NBuilder; @@ -11,7 +10,6 @@ using NzbDrone.Core.Providers; using NzbDrone.Core.Repository; using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; -using SubSonic.Repository; namespace NzbDrone.Core.Test { diff --git a/NzbDrone.Core.Test/ImportNewSeriesJobTest.cs b/NzbDrone.Core.Test/ImportNewSeriesJobTest.cs index b37594ac6..30e96b40f 100644 --- a/NzbDrone.Core.Test/ImportNewSeriesJobTest.cs +++ b/NzbDrone.Core.Test/ImportNewSeriesJobTest.cs @@ -1,7 +1,6 @@ // ReSharper disable RedundantUsingDirective -using System.Linq; +using System; using System.Collections.Generic; -using System.Threading; using AutoMoq; using FizzWare.NBuilder; using Moq; @@ -11,7 +10,6 @@ using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Jobs; using NzbDrone.Core.Repository; using NzbDrone.Core.Test.Framework; -using System; namespace NzbDrone.Core.Test { diff --git a/NzbDrone.Core.Test/IndexerProviderTest.cs b/NzbDrone.Core.Test/IndexerProviderTest.cs index b50afa716..c6e0cdf59 100644 --- a/NzbDrone.Core.Test/IndexerProviderTest.cs +++ b/NzbDrone.Core.Test/IndexerProviderTest.cs @@ -1,22 +1,16 @@ // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; -using System.IO; using System.Net; using System.ServiceModel.Syndication; using AutoMoq; -using FizzWare.NBuilder; -using Moq; +using FluentAssertions; using NUnit.Framework; using NzbDrone.Core.Model; using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.ExternalNotification; using NzbDrone.Core.Providers.Indexer; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; -using FluentAssertions; namespace NzbDrone.Core.Test { @@ -158,7 +152,7 @@ namespace NzbDrone.Core.Test return "http://www.google.com"; } - protected override Model.EpisodeParseResult CustomParser(SyndicationItem item, Model.EpisodeParseResult currentResult) + protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult) { if (currentResult == null) currentResult = new EpisodeParseResult(); currentResult.Language = LanguageType.Finnish; diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index fce620b40..6aceb5c0e 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -1,9 +1,7 @@ using System; -using System.Collections.Generic; using System.IO; using System.Net; using System.ServiceModel.Syndication; -using System.Text; using AutoMoq; using FizzWare.NBuilder; using FluentAssertions; diff --git a/NzbDrone.Core.Test/InventoryProvider_IsMonitoredTest.cs b/NzbDrone.Core.Test/InventoryProvider_IsMonitoredTest.cs index b27526b7a..0197d94f6 100644 --- a/NzbDrone.Core.Test/InventoryProvider_IsMonitoredTest.cs +++ b/NzbDrone.Core.Test/InventoryProvider_IsMonitoredTest.cs @@ -1,9 +1,6 @@ // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; -using System.IO; -using System.Net; -using System.ServiceModel.Syndication; using AutoMoq; using FizzWare.NBuilder; using FluentAssertions; @@ -11,9 +8,6 @@ using Moq; using NUnit.Framework; using NzbDrone.Core.Model; using NzbDrone.Core.Providers; -using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.ExternalNotification; -using NzbDrone.Core.Providers.Indexer; using NzbDrone.Core.Repository; using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; diff --git a/NzbDrone.Core.Test/LogProviderTest.cs b/NzbDrone.Core.Test/LogProviderTest.cs index f1066e91e..9d8490e7a 100644 --- a/NzbDrone.Core.Test/LogProviderTest.cs +++ b/NzbDrone.Core.Test/LogProviderTest.cs @@ -1,17 +1,13 @@ // ReSharper disable RedundantUsingDirective using System; using System.Linq; -using FizzWare.NBuilder; using FluentAssertions; using NLog; using NLog.Config; using NUnit.Framework; -using NzbDrone.Core.Datastore; using NzbDrone.Core.Instrumentation; -using NzbDrone.Core.Repository; using NzbDrone.Core.Test.Framework; - namespace NzbDrone.Core.Test { [TestFixture] diff --git a/NzbDrone.Core.Test/MediaFileProviderTests.cs b/NzbDrone.Core.Test/MediaFileProviderTests.cs index 124da51b6..97af1d265 100644 --- a/NzbDrone.Core.Test/MediaFileProviderTests.cs +++ b/NzbDrone.Core.Test/MediaFileProviderTests.cs @@ -2,8 +2,8 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq.Expressions; using System.Linq; +using System.Linq.Expressions; using AutoMoq; using FizzWare.NBuilder; using FluentAssertions; @@ -18,7 +18,6 @@ using NzbDrone.Core.Repository; using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Test { @@ -213,10 +212,10 @@ namespace NzbDrone.Core.Test //Mocks var mocker = new AutoMoqer(); - mocker.GetMock() - .Setup(r => r.Exists(It.IsAny>>())).Returns(false).Verifiable(); - mocker.GetMock() - .Setup(r => r.Add(It.IsAny())).Returns(0).Verifiable(); + mocker.GetMock() + .Setup(r => r.Exists(It.IsAny())).Returns(false).Verifiable(); + mocker.GetMock() + .Setup(r => r.Insert(It.IsAny())).Returns(0).Verifiable(); mocker.GetMock() .Setup(e => e.GetEpisode(fakeSeries.SeriesId, airDate)).Returns(fakeEpisode). @@ -299,7 +298,7 @@ namespace NzbDrone.Core.Test //Assert mocker.VerifyAllMocks(); Assert.IsNull(result); - mocker.GetMock().Verify(r => r.Add(result), Times.Never()); + mocker.GetMock().Verify(r => r.Insert(result), Times.Never()); ExceptionVerification.ExcpectedWarns(1); } diff --git a/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs b/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs index 9e059e798..6ec6da471 100644 --- a/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs +++ b/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs @@ -1,13 +1,8 @@ // ReSharper disable RedundantUsingDirective -using System; using System.Collections.Generic; -using System.IO; -using System.Linq; using AutoMoq; using FizzWare.NBuilder; -using Moq; using NUnit.Framework; -using NzbDrone.Core.Model; using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Repository; diff --git a/NzbDrone.Core.Test/MediaFileProvider_ImportNewDownloadTest.cs b/NzbDrone.Core.Test/MediaFileProvider_ImportNewDownloadTest.cs index 530bf3abe..c3a46ab16 100644 --- a/NzbDrone.Core.Test/MediaFileProvider_ImportNewDownloadTest.cs +++ b/NzbDrone.Core.Test/MediaFileProvider_ImportNewDownloadTest.cs @@ -1,19 +1,13 @@ // ReSharper disable RedundantUsingDirective -using System; using System.Collections.Generic; using System.IO; -using System.Linq.Expressions; -using System.Linq; using AutoMoq; using FizzWare.NBuilder; -using FluentAssertions; using Moq; using NUnit.Framework; using NzbDrone.Core.Model; -using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.Jobs; using NzbDrone.Core.Repository; using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; diff --git a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index a4b6667a5..f6bb8d9da 100644 --- a/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -75,7 +75,6 @@ ..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll - @@ -116,7 +115,6 @@ - @@ -128,7 +126,6 @@ - diff --git a/NzbDrone.Core.Test/ParserTest.cs b/NzbDrone.Core.Test/ParserTest.cs index 0958a65b1..d6af99e85 100644 --- a/NzbDrone.Core.Test/ParserTest.cs +++ b/NzbDrone.Core.Test/ParserTest.cs @@ -154,6 +154,7 @@ namespace NzbDrone.Core.Test [TestCase("The Daily Show - 2011-04-12 - Gov. Deval Patrick", "The.Daily.Show", 2011, 04, 12)] [TestCase("2011.01.10 - Denis Leary - HD TV.mkv", "", 2011, 1, 10)] [TestCase("2011.03.13 - Denis Leary - HD TV.mkv", "", 2011, 3, 13)] + [TestCase("The Tonight Show with Jay Leno - 2011-06-16 - Larry David, \"Bachelorette\" Ashley Hebert, Pitbull with Ne-Yo", "The Tonight Show with Jay Leno", 2011, 3, 13)] public void episode_daily_parse(string postTitle, string title, int year, int month, int day) { var result = Parser.ParseEpisodeInfo(postTitle); diff --git a/NzbDrone.Core.Test/QualityProfileTest.cs b/NzbDrone.Core.Test/QualityProfileTest.cs index 773dc524b..292daedca 100644 --- a/NzbDrone.Core.Test/QualityProfileTest.cs +++ b/NzbDrone.Core.Test/QualityProfileTest.cs @@ -1,7 +1,6 @@ // ReSharper disable RedundantUsingDirective using System; using System.Collections.Generic; -using System.Linq; using FizzWare.NBuilder; using FluentAssertions; using NUnit.Framework; diff --git a/NzbDrone.Core.Test/QualityTest.cs b/NzbDrone.Core.Test/QualityTest.cs index af41c12ae..63bedfea7 100644 --- a/NzbDrone.Core.Test/QualityTest.cs +++ b/NzbDrone.Core.Test/QualityTest.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using FluentAssertions; -using NUnit.Framework; +using NUnit.Framework; using NzbDrone.Core.Model; using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; diff --git a/NzbDrone.Core.Test/RepoTest.cs b/NzbDrone.Core.Test/RepoTest.cs deleted file mode 100644 index 81031f6d1..000000000 --- a/NzbDrone.Core.Test/RepoTest.cs +++ /dev/null @@ -1,109 +0,0 @@ -// ReSharper disable RedundantUsingDirective -using System; -using System.Linq; -using FizzWare.NBuilder; -using FluentAssertions; -using NLog; -using NLog.Config; -using NUnit.Framework; -using NzbDrone.Core.Instrumentation; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Test.Framework; -using LogLevel = NLog.LogLevel; - -namespace NzbDrone.Core.Test -{ - [TestFixture] - // ReSharper disable InconsistentNaming - public class RepoTest : TestBase - { - [Test] - public void to_many__series_to_episode() - { - //Arrange - var fakeSeries = Builder.CreateNew().With(s => s.SeriesId = 69).Build(); - var fakeEpisode = Builder.CreateNew().With(c => c.SeriesId = 69).Build(); - - //Act - var repo = MockLib.GetEmptyRepository(true); - repo.Add(fakeSeries); - repo.Add(fakeEpisode); - var fetchedSeries = repo.Single(fakeSeries.SeriesId); - - //Assert - Assert.AreEqual(fakeSeries.SeriesId, fetchedSeries.SeriesId); - Assert.AreEqual(fakeSeries.Title, fetchedSeries.Title); - - - fetchedSeries.Episodes.Should().HaveCount(1); - Assert.AreEqual(fetchedSeries.Episodes[0].EpisodeId, fakeEpisode.EpisodeId); - Assert.AreEqual(fetchedSeries.Episodes[0].SeriesId, fakeEpisode.SeriesId); - Assert.AreEqual(fetchedSeries.Episodes[0].Title, fakeEpisode.Title); - } - - [Test] - public void query_scratch_pad() - { - - var repo = MockLib.GetEmptyRepository(true); - - repo.All().Where(e => !e.Ignored && e.AirDate <= DateTime.Today && e.AirDate.Year > 1900).Select( - s => s.Title).ToList(); - } - - - [Test] - [Ignore] - public void episode_proxy_to_string() - { - var episode = Builder.CreateNew() - .Build(); - var series = Builder.CreateNew() - .With(s => s.SeriesId = episode.SeriesId) - .Build(); - - var repo = MockLib.GetEmptyRepository(true); - repo.Add(episode); - repo.Add(series); - - //Act - - var result = repo.Single(episode.EpisodeId).ToString(); - - //Assert - Console.WriteLine(result); - result.Should().Contain(series.Title); - result.Should().Contain(episode.EpisodeNumber.ToString()); - result.Should().Contain(episode.SeasonNumber.ToString()); - } - - - [Test] - [Description( - "This test confirms that the tvdb id stored in the db is preserved rather than being replaced by an auto incrementing value" - )] - public void tvdbid_is_preserved() - { - //Arrange - var sonicRepo = MockLib.GetEmptyRepository(true); - var series = Builder.CreateNew().With(c => c.SeriesId = 18).Build(); - - //Act - var addId = sonicRepo.Add(series); - - //Assert - Assert.AreEqual(18, addId); - var allSeries = sonicRepo.All(); - allSeries.Should().HaveCount(1); - Assert.AreEqual(18, allSeries.First().SeriesId); - } - - [Test] - public void enteties_toString() - { - Console.WriteLine(new Episode().ToString()); - Console.WriteLine(new Series().ToString()); - Console.WriteLine(new EpisodeFile().ToString()); - } - } -} \ No newline at end of file diff --git a/NzbDrone.Core.Test/RepositoryProviderTest.cs b/NzbDrone.Core.Test/RepositoryProviderTest.cs deleted file mode 100644 index 2d856576a..000000000 --- a/NzbDrone.Core.Test/RepositoryProviderTest.cs +++ /dev/null @@ -1,175 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Text; -using FluentAssertions; -using Migrator.Framework; -using Migrator.Providers.SQLite; -using NUnit.Framework; -using NzbDrone.Core.Datastore; -using NzbDrone.Core.Instrumentation; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; -using NzbDrone.Core.Test.Framework; -using SubSonic.DataProviders; -using SubSonic.Repository; -using SubSonic.Schema; -using SubSonic.SqlGeneration.Schema; - -namespace NzbDrone.Core.Test -{ - [TestFixture] - // ReSharper disable InconsistentNaming - public class RepositoryProviderTest : TestBase - { - [Test] - public void Get_Assembly_repos() - { - var provider = new RepositoryProvider(); - var types = provider.GetRepositoryTypes(); - - types.Should().Contain(typeof(Config)); - types.Should().Contain(typeof(Episode)); - types.Should().Contain(typeof(EpisodeFile)); - types.Should().Contain(typeof(ExternalNotificationSetting)); - types.Should().Contain(typeof(History)); - types.Should().Contain(typeof(IndexerSetting)); - types.Should().Contain(typeof(JobSetting)); - types.Should().Contain(typeof(RootDir)); - types.Should().Contain(typeof(Series)); - types.Should().Contain(typeof(QualityProfile)); - - types.Should().NotContain(typeof(QualityTypes)); - - - } - - - - - - [Test] - public void Get_table_columns() - { - var provider = new RepositoryProvider(); - var typeTable = provider.GetSchemaFromType(typeof(TestRepoType)); - - Assert.IsNotNull(typeTable.Columns); - - typeTable.Columns.Should().HaveCount(3); - Assert.AreEqual("TestRepoTypes", typeTable.Name); - } - - [Test] - public void ConvertToMigratorColumn() - { - var provider = new RepositoryProvider(); - - var subsonicColumn = new DatabaseColumn - { - Name = "Name", - DataType = DbType.Boolean, - IsPrimaryKey = true, - IsNullable = true - }; - - var migColumn = provider.ConvertToMigratorColumn(subsonicColumn); - - Assert.IsTrue(migColumn.IsPrimaryKey); - Assert.AreEqual(ColumnProperty.Null | ColumnProperty.PrimaryKey, migColumn.ColumnProperty); - } - - - [Test] - public void GetDbColumns() - { - string connectionString = "Data Source=" + Guid.NewGuid() + ".db;Version=3;New=True"; - var dbProvider = ProviderFactory.GetProvider(connectionString, "System.Data.SQLite"); - var repo = new SimpleRepository(dbProvider, SimpleRepositoryOptions.RunMigrations); - var sqliteDatabase = new SQLiteTransformationProvider(new SQLiteDialect(), connectionString); - - repo.Add(new TestRepoType() { Value = "Dummy" }); - - var repositoryProvider = new RepositoryProvider(); - var columns = repositoryProvider.GetColumnsFromDatabase(sqliteDatabase, "TestRepoTypes"); - - columns.Should().HaveCount(3); - - } - - - [Test] - public void DeleteColumns() - { - string connectionString = "Data Source=" + Guid.NewGuid() + ".db;Version=3;New=True"; - var dbProvider = ProviderFactory.GetProvider(connectionString, "System.Data.SQLite"); - var sqliteDatabase = new SQLiteTransformationProvider(new SQLiteDialect(), connectionString); - var repo = new SimpleRepository(dbProvider, SimpleRepositoryOptions.RunMigrations); - - repo.Add(new TestRepoType() { Value = "Dummy" }); - - var repositoryProvider = new RepositoryProvider(); - var typeSchema = repositoryProvider.GetSchemaFromType(typeof(TestRepoType2)); - var columns = repositoryProvider.GetColumnsFromDatabase(sqliteDatabase, "TestRepoTypes"); - - - var deletedColumns = repositoryProvider.GetDeletedColumns(typeSchema, columns); - - - deletedColumns.Should().HaveCount(1); - Assert.AreEqual("NewName", deletedColumns[0].Name.Trim('[', ']')); - } - - - [Test] - public void NewColumns() - { - string connectionString = "Data Source=" + Guid.NewGuid() + ".db;Version=3;New=True"; - var dbProvider = ProviderFactory.GetProvider(connectionString, "System.Data.SQLite"); - var repo = new SimpleRepository(dbProvider, SimpleRepositoryOptions.RunMigrations); - var sqliteDatabase = new SQLiteTransformationProvider(new SQLiteDialect(), connectionString); - - repo.Add(new TestRepoType2() { Value = "dummy" }); - - var repositoryProvider = new RepositoryProvider(); - var typeSchema = repositoryProvider.GetSchemaFromType(typeof(TestRepoType)); - var columns = repositoryProvider.GetColumnsFromDatabase(sqliteDatabase, "TestRepoType2s"); - - - var deletedColumns = repositoryProvider.GetNewColumns(typeSchema, columns); - - - deletedColumns.Should().HaveCount(1); - Assert.AreEqual("NewName", deletedColumns[0].Name.Trim('[', ']')); - } - - } - - - public class TestRepoType - { - [SubSonicPrimaryKey] - public int TestId { get; set; } - - [SubSonicColumnNameOverride("NewName")] - public Boolean BaddBoolean { get; set; } - - - public string Value { get; set; } - - [SubSonicIgnore] - public Boolean BaddBooleanIgnored { get; set; } - } - - - public class TestRepoType2 - { - [SubSonicPrimaryKey] - public int TestId { get; set; } - - public string Value { get; set; } - - [SubSonicIgnore] - public Boolean BaddBooleanIgnored { get; set; } - } -} diff --git a/NzbDrone.Core.Test/RootDirProviderTest.cs b/NzbDrone.Core.Test/RootDirProviderTest.cs index e00c606bb..7b492462c 100644 --- a/NzbDrone.Core.Test/RootDirProviderTest.cs +++ b/NzbDrone.Core.Test/RootDirProviderTest.cs @@ -9,7 +9,6 @@ using NzbDrone.Core.Providers; using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Repository; using NzbDrone.Core.Test.Framework; -using SubSonic.Repository; namespace NzbDrone.Core.Test { diff --git a/NzbDrone.Core.Test/SceneMappingTest.cs b/NzbDrone.Core.Test/SceneMappingTest.cs index f5d49708c..a7a69eb52 100644 --- a/NzbDrone.Core.Test/SceneMappingTest.cs +++ b/NzbDrone.Core.Test/SceneMappingTest.cs @@ -1,19 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using AutoMoq; +using AutoMoq; using FizzWare.NBuilder; -using FluentAssertions; -using Moq; using NUnit.Framework; -using NzbDrone.Core.Helpers; using NzbDrone.Core.Providers; using NzbDrone.Core.Repository; using NzbDrone.Core.Test.Framework; -using SubSonic.Repository; -using TvdbLib.Data; namespace NzbDrone.Core.Test { diff --git a/NzbDrone.Core.Test/SeriesProviderTest.cs b/NzbDrone.Core.Test/SeriesProviderTest.cs index ac867fa77..784ca2e17 100644 Binary files a/NzbDrone.Core.Test/SeriesProviderTest.cs and b/NzbDrone.Core.Test/SeriesProviderTest.cs differ diff --git a/NzbDrone.Core.Test/TvDbProviderTest.cs b/NzbDrone.Core.Test/TvDbProviderTest.cs index 5dba84448..4930a5bba 100644 --- a/NzbDrone.Core.Test/TvDbProviderTest.cs +++ b/NzbDrone.Core.Test/TvDbProviderTest.cs @@ -1,16 +1,16 @@ // ReSharper disable RedundantUsingDirective using System; +using System.Collections.Generic; using System.Linq; using FluentAssertions; using NUnit.Framework; using NzbDrone.Core.Providers; using NzbDrone.Core.Test.Framework; using TvdbLib.Data; -using System.Collections.Generic; namespace NzbDrone.Core.Test { - [NUnit.Framework.TestFixture] + [TestFixture] // ReSharper disable InconsistentNaming public class TvDbProviderTest : TestBase { diff --git a/NzbDrone.Core.Test/UpcomingEpisodesProviderTest.cs b/NzbDrone.Core.Test/UpcomingEpisodesProviderTest.cs index 3d674b252..f6a5f9947 100644 --- a/NzbDrone.Core.Test/UpcomingEpisodesProviderTest.cs +++ b/NzbDrone.Core.Test/UpcomingEpisodesProviderTest.cs @@ -1,15 +1,10 @@ // ReSharper disable RedundantUsingDirective using System; -using System.Collections.Generic; -using System.Linq; using AutoMoq; using FizzWare.NBuilder; -using FluentAssertions; using NUnit.Framework; -using NzbDrone.Core.Model; using NzbDrone.Core.Providers; using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; using NzbDrone.Core.Test.Framework; namespace NzbDrone.Core.Test diff --git a/NzbDrone.Core.Test/dbBenchmark.cs b/NzbDrone.Core.Test/dbBenchmark.cs index 1117c8c0a..7ca88b1b9 100644 --- a/NzbDrone.Core.Test/dbBenchmark.cs +++ b/NzbDrone.Core.Test/dbBenchmark.cs @@ -2,13 +2,13 @@ using System.Collections.Generic; using System.Diagnostics; using System.Threading; +using AutoMoq; using FizzWare.NBuilder; using FluentAssertions; using NUnit.Framework; using NzbDrone.Core.Providers; using NzbDrone.Core.Repository; using NzbDrone.Core.Test.Framework; -using SubSonic.Repository; namespace NzbDrone.Core.Test { @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Test private readonly List seriesIds = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; private readonly List episodes = new List(); private readonly List files = new List(); - private readonly IRepository repo = MockLib.GetEmptyRepository(); + [TestFixtureSetUp] public new void Setup() @@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test .With(s => s.Monitored = true) .Build(); - repo.Add(series); + //repo.Add(series); foreach (var _seasonNumber in seasonsNumbers) { @@ -83,8 +83,8 @@ namespace NzbDrone.Core.Test } - repo.AddMany(episodes); - repo.AddMany(files); + //repo.AddMany(episodes); + //repo.AddMany(files); } @@ -139,8 +139,8 @@ namespace NzbDrone.Core.Test [Test] public void get_episode_file_count_x100() { - var mocker = new AutoMoq.AutoMoqer(); - mocker.SetConstant(repo); + var mocker = new AutoMoqer(); + //mocker.SetConstant(repo); mocker.SetConstant(mocker.Resolve()); var mediaProvider = mocker.Resolve(); @@ -167,8 +167,8 @@ namespace NzbDrone.Core.Test [Test] public void get_season_count_x5000() { - var mocker = new AutoMoq.AutoMoqer(); - mocker.SetConstant(repo); + var mocker = new AutoMoqer(); + //mocker.SetConstant(repo); var provider = mocker.Resolve(); @@ -194,8 +194,8 @@ namespace NzbDrone.Core.Test [Test] public void get_episode_file_count_x10() { - var mocker = new AutoMoq.AutoMoqer(); - mocker.SetConstant(repo); + var mocker = new AutoMoqer(); + //mocker.SetConstant(repo); mocker.SetConstant(mocker.Resolve()); var provider = mocker.Resolve(); diff --git a/NzbDrone.Core/CentralDispatch.cs b/NzbDrone.Core/CentralDispatch.cs index e3cc1d12c..d1223a5ab 100644 --- a/NzbDrone.Core/CentralDispatch.cs +++ b/NzbDrone.Core/CentralDispatch.cs @@ -1,7 +1,7 @@ using System; -using System.Linq; using System.Diagnostics; using System.IO; +using System.Linq; using System.Web.Hosting; using Ninject; using NLog; @@ -12,7 +12,6 @@ using NzbDrone.Core.Providers.ExternalNotification; using NzbDrone.Core.Providers.Indexer; using NzbDrone.Core.Providers.Jobs; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core { @@ -69,10 +68,9 @@ namespace NzbDrone.Core _kernel = new StandardKernel(); _kernel.Bind().ToMethod(c => Connection.GetPetaPocoDb(Connection.MainConnectionString)).InRequestScope(); - _kernel.Bind().ToMethod(c => Connection.GetPetaPocoDb(Connection.LogConnectionString)).WhenInjectedInto().InSingletonScope(); + _kernel.Bind().ToMethod(c => Connection.GetPetaPocoDb(Connection.MainConnectionString, false)).WhenInjectedInto().InSingletonScope(); + _kernel.Bind().ToMethod(c => Connection.GetPetaPocoDb(Connection.LogConnectionString, false)).WhenInjectedInto().InSingletonScope(); _kernel.Bind().ToMethod(c => Connection.GetPetaPocoDb(Connection.LogConnectionString)).WhenInjectedInto().InRequestScope(); - - _kernel.Bind().ToConstant(Connection.CreateSimpleRepository(Connection.MainConnectionString)).InSingletonScope(); } } diff --git a/NzbDrone.Core/Datastore/Connection.cs b/NzbDrone.Core/Datastore/Connection.cs index e6ecd8a1c..a620e49ee 100644 --- a/NzbDrone.Core/Datastore/Connection.cs +++ b/NzbDrone.Core/Datastore/Connection.cs @@ -5,9 +5,6 @@ using System.Data.SQLite; using System.IO; using MvcMiniProfiler.Data; using PetaPoco; -using SubSonic.DataProviders; -using SubSonic.DataProviders.SQLite; -using SubSonic.Repository; namespace NzbDrone.Core.Datastore { @@ -18,6 +15,7 @@ namespace NzbDrone.Core.Datastore static Connection() { if (!AppDataPath.Exists) AppDataPath.Create(); + Database.Mapper = new CustomeMapper(); } @@ -42,51 +40,23 @@ namespace NzbDrone.Core.Datastore } } - public static IDataProvider GetDataProvider(string connectionString) - { - return new ProfiledSQLiteProvider(connectionString, "System.Data.SQLite"); - } - - public static IRepository CreateSimpleRepository(IDataProvider dataProvider) - { - return new SimpleRepository(dataProvider, SimpleRepositoryOptions.RunMigrations); - } - - public static IRepository CreateSimpleRepository(string connectionString) - { - return new SimpleRepository(GetDataProvider(connectionString), SimpleRepositoryOptions.RunMigrations); - } - public static IDatabase GetPetaPocoDb(string connectionString) + public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled = true) { MigrationsHelper.Run(connectionString, true); + DbConnection connection = new SQLiteConnection(connectionString); + if (profiled) + { + //connection = ProfiledDbConnection.Get(connection); + } - var profileConnection = ProfiledDbConnection.Get(new SQLiteConnection(connectionString)); - - Database.Mapper = new CustomeMapper(); - var db = new Database(profileConnection); + var db = new Database(connection); - if (profileConnection.State != ConnectionState.Open) - profileConnection.Open(); + if (connection.State != ConnectionState.Open) + connection.Open(); return db; } } - - - public class ProfiledSQLiteProvider : SQLiteProvider - { - public ProfiledSQLiteProvider(string connectionString, string providerName) - : base(connectionString, providerName) - { - - } - - public override System.Data.Common.DbConnection CreateConnection(string connectionString) - { - return ProfiledDbConnection.Get(base.CreateConnection(connectionString)); - - } - } } diff --git a/NzbDrone.Core/Datastore/Migrations/Migration.cs b/NzbDrone.Core/Datastore/Migrations/Migration.cs index 9006496da..0e70b03b6 100644 --- a/NzbDrone.Core/Datastore/Migrations/Migration.cs +++ b/NzbDrone.Core/Datastore/Migrations/Migration.cs @@ -4,33 +4,6 @@ using Migrator.Framework; namespace NzbDrone.Core.Datastore.Migrations { - [Migration(20110523)] - public class Migration20110523 : Migration - { - public override void Up() - { - Database.RemoveTable(RepositoryProvider.JobsSchema.Name); - } - - public override void Down() - { - throw new NotImplementedException(); - } - } - - [Migration(20110603)] - public class Migration20110603 : Migration - { - public override void Up() - { - Database.RemoveTable("Seasons"); - } - - public override void Down() - { - throw new NotImplementedException(); - } - } [Migration(20110604)] public class Migration20110616 : Migration @@ -40,13 +13,13 @@ namespace NzbDrone.Core.Datastore.Migrations Database.AddTable("Series", new[] { new Column("SeriesId", DbType.Int32, ColumnProperty.PrimaryKey), - new Column("Title", DbType.String, ColumnProperty.NotNull, String.Empty), - new Column("CleanTitle", DbType.String, ColumnProperty.NotNull, String.Empty), + new Column("Title", DbType.String, ColumnProperty.Null), + new Column("CleanTitle", DbType.String, ColumnProperty.Null), new Column("Status", DbType.String, ColumnProperty.Null), - new Column("Overview", DbType.String, ColumnProperty.NotNull, String.Empty), + new Column("Overview", DbType.String, ColumnProperty.Null), new Column("AirsDayOfWeek", DbType.Int16, ColumnProperty.Null), - new Column("AirTimes", DbType.String, ColumnProperty.NotNull, String.Empty), - new Column("Language", DbType.String, ColumnProperty.NotNull, String.Empty), + new Column("AirTimes", DbType.String, ColumnProperty.Null), + new Column("Language", DbType.String, ColumnProperty.Null), new Column("Path", DbType.String, ColumnProperty.NotNull), new Column("Monitored", DbType.Boolean, ColumnProperty.NotNull), new Column("QualityProfileId", DbType.Int16, ColumnProperty.NotNull), @@ -62,9 +35,9 @@ namespace NzbDrone.Core.Datastore.Migrations new Column("SeriesId", DbType.Int32, ColumnProperty.NotNull), new Column("SeasonNumber", DbType.Int16, ColumnProperty.NotNull), new Column("EpisodeNumber", DbType.Int16, ColumnProperty.NotNull), - new Column("Title", DbType.String, ColumnProperty.NotNull, String.Empty), - new Column("Overview", DbType.String, ColumnProperty.NotNull, String.Empty), - new Column("Ignored", DbType.Boolean, ColumnProperty.NotNull, false), + new Column("Title", DbType.String, ColumnProperty.Null), + new Column("Overview", DbType.String, ColumnProperty.Null), + new Column("Ignored", DbType.Boolean, ColumnProperty.NotNull), new Column("EpisodeFileId", DbType.Int32, ColumnProperty.Null), new Column("AirDate", DbType.DateTime, ColumnProperty.Null), new Column("GrabDate", DbType.DateTime, ColumnProperty.Null) diff --git a/NzbDrone.Core/Datastore/MigrationsHelper.cs b/NzbDrone.Core/Datastore/MigrationsHelper.cs index a4f8ced30..ed0249417 100644 --- a/NzbDrone.Core/Datastore/MigrationsHelper.cs +++ b/NzbDrone.Core/Datastore/MigrationsHelper.cs @@ -1,16 +1,7 @@ using System; using System.Collections.Generic; -using System.Data; -using System.Linq; using System.Reflection; -using System.Text; -using Migrator.Framework; using NLog; -using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; -using SubSonic.Extensions; -using SubSonic.Repository; -using SubSonic.Schema; namespace NzbDrone.Core.Datastore { @@ -18,10 +9,13 @@ namespace NzbDrone.Core.Datastore { private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - public static bool IsMigrated { get; private set; } + public static readonly Dictionary _migrated = new Dictionary(); public static void Run(string connetionString, bool trace) { + if (_migrated.ContainsKey(connetionString)) return; + _migrated.Add(connetionString, string.Empty); + Logger.Info("Preparing run database migration"); try @@ -52,63 +46,6 @@ namespace NzbDrone.Core.Datastore } } - public static void ForceSubSonicMigration(IRepository repository) - { - repository.Single(1); - repository.Single(1); - repository.Single(1); - } - - - public static void RemoveDeletedColumns(ITransformationProvider transformationProvider) - { - var provider = new RepositoryProvider(); - var repoTypes = provider.GetRepositoryTypes(); - - foreach (var repoType in repoTypes) - { - var typeSchema = provider.GetSchemaFromType(repoType); - - if (transformationProvider.TableExists(typeSchema.Name)) - { - var dbColumns = provider.GetColumnsFromDatabase(transformationProvider, typeSchema.Name); - - var deletedColumns = provider.GetDeletedColumns(typeSchema, dbColumns); - - foreach (var deletedColumn in deletedColumns) - { - Logger.Info("Removing column '{0}' from '{1}'", deletedColumn.Name, repoType.Name); - transformationProvider.RemoveColumn(typeSchema.Name, deletedColumn.Name); - } - } - } - - } - - public static void AddNewColumns(ITransformationProvider transformationProvider) - { - var provider = new RepositoryProvider(); - var repoTypes = provider.GetRepositoryTypes(); - - foreach (var repoType in repoTypes) - { - var typeSchema = provider.GetSchemaFromType(repoType); - if (transformationProvider.TableExists(typeSchema.Name)) - { - var dbColumns = provider.GetColumnsFromDatabase(transformationProvider, typeSchema.Name); - - var newColumns = provider.GetNewColumns(typeSchema, dbColumns); - - foreach (var newColumn in newColumns) - { - Logger.Info("Adding column '{0}' to '{1}'", newColumn.Name, repoType.Name); - transformationProvider.AddColumn(typeSchema.Name, newColumn); - } - } - - } - - } } diff --git a/NzbDrone.Core/Datastore/PetaPoco/PetaPoco.cs b/NzbDrone.Core/Datastore/PetaPoco/PetaPoco.cs index 415faaa9c..0d040ef12 100644 --- a/NzbDrone.Core/Datastore/PetaPoco/PetaPoco.cs +++ b/NzbDrone.Core/Datastore/PetaPoco/PetaPoco.cs @@ -13,16 +13,17 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Configuration; -using System.Data.Common; using System.Data; -using System.Text.RegularExpressions; +using System.Data.Common; +using System.Diagnostics; +using System.Linq; +using System.Linq.Expressions; using System.Reflection; using System.Reflection.Emit; -using System.Linq.Expressions; - +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; namespace PetaPoco { @@ -485,12 +486,12 @@ namespace PetaPoco } // Expand collections to parameter lists - if ((arg_val as System.Collections.IEnumerable) != null && + if ((arg_val as IEnumerable) != null && (arg_val as string) == null && (arg_val as byte[]) == null) { var sb = new StringBuilder(); - foreach (var i in arg_val as System.Collections.IEnumerable) + foreach (var i in arg_val as IEnumerable) { sb.Append((sb.Length == 0 ? "@" : ",@") + args_dest.Count.ToString()); args_dest.Add(i); @@ -510,9 +511,9 @@ namespace PetaPoco void AddParam(IDbCommand cmd, object item, string ParameterPrefix) { // Convert value to from poco type to db type - if (Database.Mapper != null && item != null) + if (Mapper != null && item != null) { - var fn = Database.Mapper.GetToDbConverter(item.GetType()); + var fn = Mapper.GetToDbConverter(item.GetType()); if (fn != null) item = fn(item); } @@ -625,8 +626,8 @@ namespace PetaPoco // Override this to log/capture exceptions public virtual void OnException(Exception x) { - System.Diagnostics.Debug.WriteLine(x.ToString()); - System.Diagnostics.Debug.WriteLine(LastCommand); + Debug.WriteLine(x.ToString()); + Debug.WriteLine(LastCommand); } // Override this to log commands, or modify command before execution @@ -1120,7 +1121,7 @@ namespace PetaPoco // Various cached stuff static Dictionary MultiPocoFactories = new Dictionary(); static Dictionary AutoMappers = new Dictionary(); - static System.Threading.ReaderWriterLockSlim RWLock = new System.Threading.ReaderWriterLockSlim(); + static ReaderWriterLockSlim RWLock = new ReaderWriterLockSlim(); // Get (or create) the multi-poco factory for a query Func GetMultiPocoFactory(Type[] types, string sql, IDataReader r) @@ -1954,7 +1955,7 @@ namespace PetaPoco #endif return ForType(t); } - static System.Threading.ReaderWriterLockSlim RWLock = new System.Threading.ReaderWriterLockSlim(); + static ReaderWriterLockSlim RWLock = new ReaderWriterLockSlim(); public static PocoData ForType(Type t) { #if !PETAPOCO_NO_DYNAMIC @@ -2018,8 +2019,8 @@ namespace PetaPoco TableInfo.AutoIncrement = TableInfo.AutoIncrement ? !TableInfo.PrimaryKey.Contains(',') : TableInfo.AutoIncrement; // Call column mapper - if (Database.Mapper != null) - Database.Mapper.GetTableInfo(t, TableInfo); + if (Mapper != null) + Mapper.GetTableInfo(t, TableInfo); // Work out bound properties bool ExplicitColumns = t.GetCustomAttributes(typeof(ExplicitColumnsAttribute), true).Length > 0; @@ -2055,7 +2056,7 @@ namespace PetaPoco if (pc.ColumnName == null) { pc.ColumnName = pi.Name; - if (Database.Mapper != null && !Database.Mapper.MapPropertyToColumn(pi, ref pc.ColumnName, ref pc.ResultColumn)) + if (Mapper != null && !Mapper.MapPropertyToColumn(pi, ref pc.ColumnName, ref pc.ResultColumn)) continue; } @@ -2307,12 +2308,12 @@ namespace PetaPoco Func converter = null; // Get converter from the mapper - if (Database.Mapper != null) + if (Mapper != null) { DestinationInfo destinationInfo = pc != null ? new DestinationInfo(pc.PropertyInfo) : new DestinationInfo(dstType); - converter = Database.Mapper.GetFromDbConverter(destinationInfo, srcType); + converter = Mapper.GetFromDbConverter(destinationInfo, srcType); } // Standard DateTime->Utc mapper diff --git a/NzbDrone.Core/Datastore/RepositoryProvider.cs b/NzbDrone.Core/Datastore/RepositoryProvider.cs deleted file mode 100644 index 040fa9ac0..000000000 --- a/NzbDrone.Core/Datastore/RepositoryProvider.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Reflection; -using Migrator.Providers; -using Migrator.Providers.SQLite; -using NzbDrone.Core.Repository; -using SubSonic.DataProviders; -using SubSonic.Extensions; -using SubSonic.Schema; -using Migrator.Framework; - - -namespace NzbDrone.Core.Datastore -{ - public class RepositoryProvider - { - public static readonly ITable EpisodesSchema = new RepositoryProvider().GetSchemaFromType(typeof(Episode)); - public static readonly ITable SeriesSchema = new RepositoryProvider().GetSchemaFromType(typeof(Series)); - public static readonly ITable EpisodeFilesSchema = new RepositoryProvider().GetSchemaFromType(typeof(EpisodeFile)); - public static readonly ITable JobsSchema = new RepositoryProvider().GetSchemaFromType(typeof(JobSetting)); - - - public virtual IList GetRepositoryTypes() - { - var coreAssembly = Assembly.GetExecutingAssembly(); - var repoTypes = coreAssembly.GetTypes().Where(t => !String.IsNullOrWhiteSpace(t.Namespace) && t.Namespace.StartsWith("NzbDrone.Core.Repository")); - - repoTypes = repoTypes.Where(r => !r.IsEnum); - return repoTypes.ToList(); - } - - public virtual ITable GetSchemaFromType(Type type) - { - return type.ToSchemaTable(Connection.GetDataProvider(Connection.MainConnectionString)); - } - - public virtual Column[] GetColumnsFromDatabase(ITransformationProvider database, string tableName) - { - return database.GetColumns(tableName); - } - - - public virtual List GetDeletedColumns(ITable typeSchema, Column[] dbColumns) - { - var deleteColumns = new List(); - foreach (var dbColumn in dbColumns) - { - if (!typeSchema.Columns.ToList().Exists(c => c.Name == dbColumn.Name.Trim('[', ']'))) - { - deleteColumns.Add(dbColumn); - } - } - - return deleteColumns; - } - - - public virtual List GetNewColumns(ITable typeSchema, Column[] dbColumns) - { - var newColumns = new List(); - foreach (var typeColumn in typeSchema.Columns) - { - if (!dbColumns.ToList().Exists(c => c.Name.Trim('[', ']') == typeColumn.Name)) - { - newColumns.Add(ConvertToMigratorColumn(typeColumn)); - } - } - - return newColumns; - } - - public virtual Column ConvertToMigratorColumn(SubSonic.Schema.IColumn subsonicColumns) - { - var migColumn = new Column(subsonicColumns.Name, subsonicColumns.DataType); - - if (subsonicColumns.IsPrimaryKey) - { - migColumn.ColumnProperty = ColumnProperty.PrimaryKey; - } - - if (subsonicColumns.IsNullable) - { - migColumn.ColumnProperty = migColumn.ColumnProperty | ColumnProperty.Null; - } - else - { - migColumn.ColumnProperty = migColumn.ColumnProperty | ColumnProperty.NotNull; - migColumn.DefaultValue = false; - } - - return migColumn; - } - - - } -} diff --git a/NzbDrone.Core/Datastore/SqliteProvider.cs b/NzbDrone.Core/Datastore/SqliteProvider.cs index b4b2e278c..1fbe6cf9d 100644 --- a/NzbDrone.Core/Datastore/SqliteProvider.cs +++ b/NzbDrone.Core/Datastore/SqliteProvider.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using Migrator.Framework; using Migrator.Providers.SQLite; diff --git a/NzbDrone.Core/Helpers/FileSizeFormatHelpercs.cs b/NzbDrone.Core/Helpers/FileSizeFormatHelpercs.cs index ccad15227..138c3227f 100644 --- a/NzbDrone.Core/Helpers/FileSizeFormatHelpercs.cs +++ b/NzbDrone.Core/Helpers/FileSizeFormatHelpercs.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace NzbDrone.Core.Helpers { diff --git a/NzbDrone.Core/Instrumentation/Log.cs b/NzbDrone.Core/Instrumentation/Log.cs index c4dfc4b5b..4c06f791f 100644 --- a/NzbDrone.Core/Instrumentation/Log.cs +++ b/NzbDrone.Core/Instrumentation/Log.cs @@ -1,6 +1,5 @@ using System; using PetaPoco; -using SubSonic.SqlGeneration.Schema; namespace NzbDrone.Core.Instrumentation { diff --git a/NzbDrone.Core/Instrumentation/LogConfiguration.cs b/NzbDrone.Core/Instrumentation/LogConfiguration.cs index 21b75225f..84ced7b24 100644 --- a/NzbDrone.Core/Instrumentation/LogConfiguration.cs +++ b/NzbDrone.Core/Instrumentation/LogConfiguration.cs @@ -1,7 +1,6 @@ using System.Diagnostics; using System.IO; using Ninject; -using Ninject.Activation; using NLog; using NLog.Config; diff --git a/NzbDrone.Core/Instrumentation/LogProvider.cs b/NzbDrone.Core/Instrumentation/LogProvider.cs index 1985c2aa5..e93bd1eae 100644 --- a/NzbDrone.Core/Instrumentation/LogProvider.cs +++ b/NzbDrone.Core/Instrumentation/LogProvider.cs @@ -1,8 +1,6 @@ using System.Collections.Generic; -using System.Linq; using NLog; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Instrumentation { diff --git a/NzbDrone.Core/Instrumentation/SubsonicTarget.cs b/NzbDrone.Core/Instrumentation/SubsonicTarget.cs index 713878feb..261be609c 100644 --- a/NzbDrone.Core/Instrumentation/SubsonicTarget.cs +++ b/NzbDrone.Core/Instrumentation/SubsonicTarget.cs @@ -2,7 +2,6 @@ using NLog; using NLog.Targets; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Instrumentation { diff --git a/NzbDrone.Core/Model/ConnectionInfoModel.cs b/NzbDrone.Core/Model/ConnectionInfoModel.cs index d193ccc0d..f73ae174b 100644 --- a/NzbDrone.Core/Model/ConnectionInfoModel.cs +++ b/NzbDrone.Core/Model/ConnectionInfoModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace NzbDrone.Core.Model +namespace NzbDrone.Core.Model { public class ConnectionInfoModel { diff --git a/NzbDrone.Core/Model/EpisodeParseResult.cs b/NzbDrone.Core/Model/EpisodeParseResult.cs index 280cb7f0b..de566a5e6 100644 --- a/NzbDrone.Core/Model/EpisodeParseResult.cs +++ b/NzbDrone.Core/Model/EpisodeParseResult.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using NzbDrone.Core.Repository; -using NzbDrone.Core.Repository.Quality; namespace NzbDrone.Core.Model { diff --git a/NzbDrone.Core/Model/ExternalNotificationType.cs b/NzbDrone.Core/Model/ExternalNotificationType.cs index 6e6de4a8c..41a3b5ad8 100644 --- a/NzbDrone.Core/Model/ExternalNotificationType.cs +++ b/NzbDrone.Core/Model/ExternalNotificationType.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace NzbDrone.Core.Model +namespace NzbDrone.Core.Model { public enum ExternalNotificationType { diff --git a/NzbDrone.Core/Model/Quality.cs b/NzbDrone.Core/Model/Quality.cs index 35922bc37..95ea38efb 100644 --- a/NzbDrone.Core/Model/Quality.cs +++ b/NzbDrone.Core/Model/Quality.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using NzbDrone.Core.Repository.Quality; namespace NzbDrone.Core.Model @@ -22,19 +19,19 @@ namespace NzbDrone.Core.Model public int CompareTo(Quality other) { - if (other.QualityType > this.QualityType) + if (other.QualityType > QualityType) return -1; - if (other.QualityType < this.QualityType) + if (other.QualityType < QualityType) return 1; - if (other.QualityType == this.QualityType && other.Proper == this.Proper) + if (other.QualityType == QualityType && other.Proper == Proper) return 0; - if (this.Proper && !other.Proper) + if (Proper && !other.Proper) return 1; - if (!this.Proper && other.Proper) + if (!Proper && other.Proper) return -1; return 0; diff --git a/NzbDrone.Core/Model/SabnzbdInfoModel.cs b/NzbDrone.Core/Model/SabnzbdInfoModel.cs index a903e7626..4eba4f90a 100644 --- a/NzbDrone.Core/Model/SabnzbdInfoModel.cs +++ b/NzbDrone.Core/Model/SabnzbdInfoModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace NzbDrone.Core.Model +namespace NzbDrone.Core.Model { public class SabnzbdInfoModel { diff --git a/NzbDrone.Core/Model/SeasonParseResult.cs b/NzbDrone.Core/Model/SeasonParseResult.cs index 3abc899c0..9422e35a6 100644 --- a/NzbDrone.Core/Model/SeasonParseResult.cs +++ b/NzbDrone.Core/Model/SeasonParseResult.cs @@ -1,6 +1,4 @@ -using NzbDrone.Core.Repository.Quality; - -namespace NzbDrone.Core.Model +namespace NzbDrone.Core.Model { public class SeasonParseResult { diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 7025f290c..391c1396d 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -141,10 +141,6 @@ False ..\Libraries\NLog.dll - - False - ..\Libraries\SubSonic.Core.dll - @@ -172,7 +168,6 @@ - diff --git a/NzbDrone.Core/Providers/AutoConfigureProvider.cs b/NzbDrone.Core/Providers/AutoConfigureProvider.cs index 2075825b6..20abddecb 100644 --- a/NzbDrone.Core/Providers/AutoConfigureProvider.cs +++ b/NzbDrone.Core/Providers/AutoConfigureProvider.cs @@ -4,10 +4,8 @@ using System.IO; using System.Linq; using System.Net; using System.Net.NetworkInformation; -using System.Text; using System.Text.RegularExpressions; using NzbDrone.Core.Model; -using NzbDrone.Core.Providers.Core; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/Core/ConfigProvider.cs b/NzbDrone.Core/Providers/Core/ConfigProvider.cs index 50fc4c8d7..298cb0738 100644 --- a/NzbDrone.Core/Providers/Core/ConfigProvider.cs +++ b/NzbDrone.Core/Providers/Core/ConfigProvider.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; -using System.Linq; using Ninject; using NLog; using NzbDrone.Core.Model; using NzbDrone.Core.Repository; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers.Core { @@ -280,7 +278,7 @@ namespace NzbDrone.Core.Providers.Core { string value; - var dbValue = _database.SingleOrDefault(key); + var dbValue = _database.SingleOrDefault("WHERE Key=@0", key); if (dbValue != null && !String.IsNullOrEmpty(dbValue.Value)) return dbValue.Value; diff --git a/NzbDrone.Core/Providers/Core/DiskProvider.cs b/NzbDrone.Core/Providers/Core/DiskProvider.cs index 5ce87f840..bb3c191dd 100644 --- a/NzbDrone.Core/Providers/Core/DiskProvider.cs +++ b/NzbDrone.Core/Providers/Core/DiskProvider.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; namespace NzbDrone.Core.Providers.Core { diff --git a/NzbDrone.Core/Providers/Core/HttpProvider.cs b/NzbDrone.Core/Providers/Core/HttpProvider.cs index 55a8485a6..37ced57fc 100644 --- a/NzbDrone.Core/Providers/Core/HttpProvider.cs +++ b/NzbDrone.Core/Providers/Core/HttpProvider.cs @@ -3,7 +3,6 @@ using System.IO; using System.Net; using NLog; - namespace NzbDrone.Core.Providers.Core { public class HttpProvider diff --git a/NzbDrone.Core/Providers/DownloadProvider.cs b/NzbDrone.Core/Providers/DownloadProvider.cs index dfb751802..e98813a28 100644 --- a/NzbDrone.Core/Providers/DownloadProvider.cs +++ b/NzbDrone.Core/Providers/DownloadProvider.cs @@ -1,13 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; using Ninject; using NLog; using NzbDrone.Core.Model; -using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.Indexer; using NzbDrone.Core.Repository; -using SubSonic.Repository; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/EpisodeProvider.cs b/NzbDrone.Core/Providers/EpisodeProvider.cs index 3ae5f45c8..86d1e68e0 100644 --- a/NzbDrone.Core/Providers/EpisodeProvider.cs +++ b/NzbDrone.Core/Providers/EpisodeProvider.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using Ninject; using NLog; using NzbDrone.Core.Model; using NzbDrone.Core.Repository; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/ExternalNotification/ExternalNotificationProviderBase.cs b/NzbDrone.Core/Providers/ExternalNotification/ExternalNotificationProviderBase.cs index 83f7aedde..506a75bb8 100644 --- a/NzbDrone.Core/Providers/ExternalNotification/ExternalNotificationProviderBase.cs +++ b/NzbDrone.Core/Providers/ExternalNotification/ExternalNotificationProviderBase.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NLog; +using NLog; using NzbDrone.Core.Model; using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Repository; diff --git a/NzbDrone.Core/Providers/ExternalNotificationProvider.cs b/NzbDrone.Core/Providers/ExternalNotificationProvider.cs index 8e86e4cba..4cba27051 100644 --- a/NzbDrone.Core/Providers/ExternalNotificationProvider.cs +++ b/NzbDrone.Core/Providers/ExternalNotificationProvider.cs @@ -1,15 +1,10 @@ using System; using System.Collections.Generic; -using System.Linq; using Ninject; using NLog; -using NzbDrone.Core.Helpers; -using NzbDrone.Core.Model; -using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Providers.ExternalNotification; using NzbDrone.Core.Repository; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/Indexer/Newzbin.cs b/NzbDrone.Core/Providers/Indexer/Newzbin.cs index b5fe0eb7f..53075271b 100644 --- a/NzbDrone.Core/Providers/Indexer/Newzbin.cs +++ b/NzbDrone.Core/Providers/Indexer/Newzbin.cs @@ -5,7 +5,6 @@ using System.ServiceModel.Syndication; using Ninject; using NzbDrone.Core.Model; using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.ExternalNotification; namespace NzbDrone.Core.Providers.Indexer { diff --git a/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs b/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs index c2da52a3f..e7d7b6671 100644 --- a/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs +++ b/NzbDrone.Core/Providers/Indexer/NzbMatrix.cs @@ -1,12 +1,8 @@ using System; using System.Collections.Generic; -using System.Net; using System.ServiceModel.Syndication; using Ninject; -using NzbDrone.Core.Model; using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.ExternalNotification; -using SubSonic.Repository; namespace NzbDrone.Core.Providers.Indexer { diff --git a/NzbDrone.Core/Providers/Indexer/NzbsOrg.cs b/NzbDrone.Core/Providers/Indexer/NzbsOrg.cs index 8ab4a69fe..dc0d5fac9 100644 --- a/NzbDrone.Core/Providers/Indexer/NzbsOrg.cs +++ b/NzbDrone.Core/Providers/Indexer/NzbsOrg.cs @@ -1,12 +1,8 @@ using System; using System.Collections.Generic; -using System.Net; using System.ServiceModel.Syndication; using Ninject; -using NzbDrone.Core.Model; using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.ExternalNotification; -using SubSonic.Repository; namespace NzbDrone.Core.Providers.Indexer { diff --git a/NzbDrone.Core/Providers/Indexer/NzbsRUs.cs b/NzbDrone.Core/Providers/Indexer/NzbsRUs.cs index 2816da19e..8b3ae356a 100644 --- a/NzbDrone.Core/Providers/Indexer/NzbsRUs.cs +++ b/NzbDrone.Core/Providers/Indexer/NzbsRUs.cs @@ -1,11 +1,7 @@ using System.Collections.Generic; -using System.Net; using System.ServiceModel.Syndication; using Ninject; -using NzbDrone.Core.Model; using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Providers.ExternalNotification; -using SubSonic.Repository; namespace NzbDrone.Core.Providers.Indexer { diff --git a/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs b/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs index 800c470af..5d4c26237 100644 --- a/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs +++ b/NzbDrone.Core/Providers/Jobs/DeleteSeriesJob.cs @@ -1,11 +1,7 @@ using System; -using System.IO; -using System.Linq; using Ninject; using NLog; using NzbDrone.Core.Model.Notification; -using NzbDrone.Core.Repository; -using SubSonic.Repository; namespace NzbDrone.Core.Providers.Jobs { diff --git a/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs b/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs index 9944d2d28..2e82491a5 100644 --- a/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs +++ b/NzbDrone.Core/Providers/Jobs/DiskScanJob.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using Ninject; using NLog; using NzbDrone.Core.Model.Notification; diff --git a/NzbDrone.Core/Providers/Jobs/EpisodeSearchJob.cs b/NzbDrone.Core/Providers/Jobs/EpisodeSearchJob.cs index b8842e6fe..d88c433fc 100644 --- a/NzbDrone.Core/Providers/Jobs/EpisodeSearchJob.cs +++ b/NzbDrone.Core/Providers/Jobs/EpisodeSearchJob.cs @@ -1,12 +1,9 @@ using System; using System.Collections.Generic; using System.Linq; -using Ninject; using NLog; -using NzbDrone.Core.Helpers; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; -using NzbDrone.Core.Providers.Indexer; using NzbDrone.Core.Repository; namespace NzbDrone.Core.Providers.Jobs diff --git a/NzbDrone.Core/Providers/Jobs/JobProvider.cs b/NzbDrone.Core/Providers/Jobs/JobProvider.cs index 39c15b4d0..ab640155d 100644 --- a/NzbDrone.Core/Providers/Jobs/JobProvider.cs +++ b/NzbDrone.Core/Providers/Jobs/JobProvider.cs @@ -8,7 +8,6 @@ using NLog; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Repository; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers.Jobs { diff --git a/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs b/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs index c0daf484f..7ca43f30f 100644 --- a/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs +++ b/NzbDrone.Core/Providers/Jobs/PostDownloadScanJob.cs @@ -1,13 +1,9 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; using Ninject; using NLog; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers.Core; -using NzbDrone.Core.Repository; namespace NzbDrone.Core.Providers.Jobs { diff --git a/NzbDrone.Core/Providers/Jobs/RenameEpisodeJob.cs b/NzbDrone.Core/Providers/Jobs/RenameEpisodeJob.cs index 5ba082133..e8184750e 100644 --- a/NzbDrone.Core/Providers/Jobs/RenameEpisodeJob.cs +++ b/NzbDrone.Core/Providers/Jobs/RenameEpisodeJob.cs @@ -1,7 +1,4 @@ -using System; -using System.IO; -using System.Linq; -using Ninject; +using Ninject; using NLog; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Providers.Core; diff --git a/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs b/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs index 9c4609573..8b507227f 100644 --- a/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs +++ b/NzbDrone.Core/Providers/Jobs/UpdateInfoJob.cs @@ -1,5 +1,5 @@ -using System.Linq; -using System.Collections.Generic; +using System.Collections.Generic; +using System.Linq; using Ninject; using NzbDrone.Core.Model.Notification; using NzbDrone.Core.Repository; diff --git a/NzbDrone.Core/Providers/Jobs/UpdateSceneMappingsJob.cs b/NzbDrone.Core/Providers/Jobs/UpdateSceneMappingsJob.cs index 179b7162f..a1aebe8d2 100644 --- a/NzbDrone.Core/Providers/Jobs/UpdateSceneMappingsJob.cs +++ b/NzbDrone.Core/Providers/Jobs/UpdateSceneMappingsJob.cs @@ -1,7 +1,4 @@ -using System.Linq; -using System.Collections.Generic; -using NzbDrone.Core.Model.Notification; -using NzbDrone.Core.Repository; +using NzbDrone.Core.Model.Notification; namespace NzbDrone.Core.Providers.Jobs { diff --git a/NzbDrone.Core/Providers/QualityProvider.cs b/NzbDrone.Core/Providers/QualityProvider.cs index df0c78b7f..a175acecf 100644 --- a/NzbDrone.Core/Providers/QualityProvider.cs +++ b/NzbDrone.Core/Providers/QualityProvider.cs @@ -5,7 +5,6 @@ using Ninject; using NLog; using NzbDrone.Core.Repository.Quality; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/RootDirProvider.cs b/NzbDrone.Core/Providers/RootDirProvider.cs index 5fd0bbc4d..408033174 100644 --- a/NzbDrone.Core/Providers/RootDirProvider.cs +++ b/NzbDrone.Core/Providers/RootDirProvider.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using Ninject; using NLog; using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Repository; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/SceneMappingProvider.cs b/NzbDrone.Core/Providers/SceneMappingProvider.cs index f4d3269d5..1c4d38808 100644 --- a/NzbDrone.Core/Providers/SceneMappingProvider.cs +++ b/NzbDrone.Core/Providers/SceneMappingProvider.cs @@ -1,14 +1,10 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Net; -using System.Text; using NLog; using NzbDrone.Core.Providers.Core; using NzbDrone.Core.Repository; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/SeriesProvider.cs b/NzbDrone.Core/Providers/SeriesProvider.cs index 5e1b64b5b..7d23cf0f5 100644 --- a/NzbDrone.Core/Providers/SeriesProvider.cs +++ b/NzbDrone.Core/Providers/SeriesProvider.cs @@ -114,7 +114,7 @@ namespace NzbDrone.Core.Providers return GetSeries(seriesId.Value); } - return _database.Single("WHERE CleanTitle = @0", normalizeTitle); + return _database.FirstOrDefault("WHERE CleanTitle = @0", normalizeTitle); } public virtual void UpdateSeries(Series series) diff --git a/NzbDrone.Core/Providers/StatsProvider.cs b/NzbDrone.Core/Providers/StatsProvider.cs index 9817e8d12..e93367aae 100644 --- a/NzbDrone.Core/Providers/StatsProvider.cs +++ b/NzbDrone.Core/Providers/StatsProvider.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; using Ninject; namespace NzbDrone.Core.Providers diff --git a/NzbDrone.Core/Providers/TvDbProvider.cs b/NzbDrone.Core/Providers/TvDbProvider.cs index f965e2801..ccfa19edf 100644 --- a/NzbDrone.Core/Providers/TvDbProvider.cs +++ b/NzbDrone.Core/Providers/TvDbProvider.cs @@ -1,6 +1,6 @@ using System; -using System.Linq; using System.Collections.Generic; +using System.Linq; using System.Text.RegularExpressions; using NLog; using TvdbLib; diff --git a/NzbDrone.Core/Providers/UpcomingEpisodesProvider.cs b/NzbDrone.Core/Providers/UpcomingEpisodesProvider.cs index d52c0249a..2b0d9c9f1 100644 --- a/NzbDrone.Core/Providers/UpcomingEpisodesProvider.cs +++ b/NzbDrone.Core/Providers/UpcomingEpisodesProvider.cs @@ -5,7 +5,6 @@ using Ninject; using NzbDrone.Core.Model; using NzbDrone.Core.Repository; using PetaPoco; -using SubSonic.Repository; namespace NzbDrone.Core.Providers { diff --git a/NzbDrone.Core/Providers/XbmcProvider.cs b/NzbDrone.Core/Providers/XbmcProvider.cs index 95766b33e..ab766ad97 100644 --- a/NzbDrone.Core/Providers/XbmcProvider.cs +++ b/NzbDrone.Core/Providers/XbmcProvider.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Xml.Linq; using Ninject; using NLog; -using NzbDrone.Core.Helpers; using NzbDrone.Core.Providers.Core; namespace NzbDrone.Core.Providers diff --git a/NzbDrone.Core/Repository/Config.cs b/NzbDrone.Core/Repository/Config.cs index 643928d67..2f351e61a 100644 --- a/NzbDrone.Core/Repository/Config.cs +++ b/NzbDrone.Core/Repository/Config.cs @@ -1,5 +1,4 @@ using PetaPoco; -using SubSonic.SqlGeneration.Schema; namespace NzbDrone.Core.Repository { diff --git a/NzbDrone.Core/Repository/Episode.cs b/NzbDrone.Core/Repository/Episode.cs index 230d16341..25bfd4464 100644 --- a/NzbDrone.Core/Repository/Episode.cs +++ b/NzbDrone.Core/Repository/Episode.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using NzbDrone.Core.Model; using PetaPoco; -using SubSonic.SqlGeneration.Schema; - namespace NzbDrone.Core.Repository { @@ -11,7 +9,7 @@ namespace NzbDrone.Core.Repository [PrimaryKey("EpisodeId", autoIncrement = true)] public class Episode { - [SubSonicPrimaryKey] + public virtual int EpisodeId { get; set; } public virtual int? TvDbEpisodeId { get; set; } @@ -23,12 +21,11 @@ namespace NzbDrone.Core.Repository public virtual string Title { get; set; } public virtual DateTime AirDate { get; set; } - [SubSonicLongString] + public virtual string Overview { get; set; } public virtual Boolean Ignored { get; set; } - [SubSonicIgnore] [Ignore] public Boolean IsDailyEpisode { @@ -47,7 +44,7 @@ namespace NzbDrone.Core.Repository /// public virtual DateTime? GrabDate { get; set; } - [SubSonicIgnore] + [Ignore] public EpisodeStatusType Status { @@ -72,15 +69,15 @@ namespace NzbDrone.Core.Repository } } - [SubSonicToOneRelation(ThisClassContainsJoinKey = true)] + [Ignore] public virtual Series Series { get; set; } - [SubSonicToOneRelation(ThisClassContainsJoinKey = true)] + [Ignore] public virtual EpisodeFile EpisodeFile { get; set; } - [SubSonicToManyRelation] + [Ignore] public virtual IList Histories { get; protected set; } diff --git a/NzbDrone.Core/Repository/ExternalNotificationSetting.cs b/NzbDrone.Core/Repository/ExternalNotificationSetting.cs index abb30bcd7..f4a4686c0 100644 --- a/NzbDrone.Core/Repository/ExternalNotificationSetting.cs +++ b/NzbDrone.Core/Repository/ExternalNotificationSetting.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using PetaPoco; +using PetaPoco; namespace NzbDrone.Core.Repository { diff --git a/NzbDrone.Core/Repository/History.cs b/NzbDrone.Core/Repository/History.cs index 9cd65e364..a062d1c37 100644 --- a/NzbDrone.Core/Repository/History.cs +++ b/NzbDrone.Core/Repository/History.cs @@ -1,8 +1,6 @@ using System; -using NzbDrone.Core.Model; using NzbDrone.Core.Repository.Quality; using PetaPoco; -using SubSonic.SqlGeneration.Schema; namespace NzbDrone.Core.Repository { diff --git a/NzbDrone.Core/Repository/JobSetting.cs b/NzbDrone.Core/Repository/JobSetting.cs index 27e2ddecb..1ab02fff7 100644 --- a/NzbDrone.Core/Repository/JobSetting.cs +++ b/NzbDrone.Core/Repository/JobSetting.cs @@ -1,6 +1,5 @@ using System; using PetaPoco; -using SubSonic.SqlGeneration.Schema; namespace NzbDrone.Core.Repository { @@ -8,7 +7,6 @@ namespace NzbDrone.Core.Repository [PrimaryKey("Id", autoIncrement = true)] public class JobSetting { - [SubSonicPrimaryKey(true)] public Int32 Id { get; set; } public Boolean Enable { get; set; } diff --git a/NzbDrone.Core/Repository/Quality/QualityProfile.cs b/NzbDrone.Core/Repository/Quality/QualityProfile.cs index 802617e3a..7f1ed347b 100644 --- a/NzbDrone.Core/Repository/Quality/QualityProfile.cs +++ b/NzbDrone.Core/Repository/Quality/QualityProfile.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using PetaPoco; -using SubSonic.SqlGeneration.Schema; namespace NzbDrone.Core.Repository.Quality { @@ -11,7 +10,7 @@ namespace NzbDrone.Core.Repository.Quality [PrimaryKey("QualityProfileId", autoIncrement = true)] public class QualityProfile { - [SubSonicPrimaryKey] + public virtual int QualityProfileId { get; set; } [Required(ErrorMessage = "A Name is Required")] @@ -20,12 +19,10 @@ namespace NzbDrone.Core.Repository.Quality public string Name { get; set; } [Ignore] - [SubSonicIgnore] [DisplayName("Allowed Qualities")] public List Allowed { get; set; } [Ignore] - [SubSonicIgnore] [DisplayName("Allowed Qualities String")] [DisplayFormat(ConvertEmptyStringToNull = false)] public string AllowedString { get; set; } @@ -60,7 +57,7 @@ namespace NzbDrone.Core.Repository.Quality } [Ignore] - [SubSonicToManyRelation] + public virtual List Series { get; private set; } } } \ No newline at end of file diff --git a/NzbDrone.Core/Repository/SceneMapping.cs b/NzbDrone.Core/Repository/SceneMapping.cs index d51c823d9..a5b21a847 100644 --- a/NzbDrone.Core/Repository/SceneMapping.cs +++ b/NzbDrone.Core/Repository/SceneMapping.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using PetaPoco; +using PetaPoco; namespace NzbDrone.Core.Repository { diff --git a/NzbDrone.Core/Repository/Series.cs b/NzbDrone.Core/Repository/Series.cs index 1d8767c17..55ade2a84 100644 --- a/NzbDrone.Core/Repository/Series.cs +++ b/NzbDrone.Core/Repository/Series.cs @@ -3,35 +3,34 @@ using System.Collections.Generic; using System.ComponentModel; using NzbDrone.Core.Repository.Quality; using PetaPoco; -using SubSonic.SqlGeneration.Schema; namespace NzbDrone.Core.Repository { [PrimaryKey("SeriesId", autoIncrement = false)] public class Series { - [SubSonicPrimaryKey(false)] + public virtual int SeriesId { get; set; } - [SubSonicNullString] + public string Title { get; set; } - [SubSonicNullString] + public string CleanTitle { get; set; } - [SubSonicNullString] + public string Status { get; set; } - [SubSonicNullString] + public string Overview { get; set; } [DisplayName("Air on")] public DayOfWeek? AirsDayOfWeek { get; set; } - [SubSonicNullString] + public String AirTimes { get; set; } - [SubSonicNullString] + public string Language { get; set; } public string Path { get; set; } @@ -56,15 +55,12 @@ namespace NzbDrone.Core.Repository public DateTime? LastDiskSync { get; set; } - [SubSonicToOneRelation(ThisClassContainsJoinKey = true, JoinKeyName = "QualityProfileId")] [Ignore] public virtual QualityProfile QualityProfile { get; set; } - [SubSonicToManyRelation] [Ignore] public virtual IList Episodes { get; set; } - [SubSonicToManyRelation] [Ignore] public virtual IList EpisodeFiles { get; protected set; } } diff --git a/NzbDrone.Core/WebTimer.cs b/NzbDrone.Core/WebTimer.cs index 3058e037d..3d326d5e7 100644 --- a/NzbDrone.Core/WebTimer.cs +++ b/NzbDrone.Core/WebTimer.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Web; using System.Web.Caching; using NLog; diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 963cea074..3cf52ab63 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -71,10 +71,6 @@ False ..\Libraries\NLog.dll - - False - ..\Libraries\SubSonic.Core.dll -