From f03a74b5fbea527d1e298ea69dae542f86f145cd Mon Sep 17 00:00:00 2001 From: zzzprojects Date: Wed, 2 Sep 2015 13:58:31 -0400 Subject: [PATCH] Move Specialized Database in their own assembly --- Z.ExtensionMethods.Generated.sln | 173 ++----------- ...aSet.cs => MySqlCommand.ExecuteDataSet.cs} | 2 +- ...le.cs => MySqlCommand.ExecuteDataTable.cs} | 2 +- ...t.cs => MySqlConnection.ExecuteDataSet.cs} | 36 +-- ...cs => MySqlConnection.ExecuteDataTable.cs} | 32 +-- ....cs => MySqlConnection.ExecuteEntities.cs} | 33 +-- ...ty.cs => MySqlConnection.ExecuteEntity.cs} | 33 +-- ...> MySqlConnection.ExecuteExpandoObject.cs} | 33 +-- ... MySqlConnection.ExecuteExpandoObjects.cs} | 33 +-- ....cs => MySqlConnection.ExecuteNonQuery.cs} | 32 +-- ...er.cs => MySqlConnection.ExecuteReader.cs} | 32 +-- ...As.cs => MySqlConnection.ExecuteScalar.cs} | 36 +-- ....cs => MySqlConnection.ExecuteScalarAs.cs} | 36 +-- ....cs => MySqlConnection.ExecuteScalarTo.cs} | 33 +-- ...lParameterCollection.AddRangeWithValue.cs} | 2 +- src/Z.Data.MySql/Z.Data.MySql.csproj | 44 ++-- .../_Internal/IDataReader.ToEntities.cs | 62 +++++ .../_Internal/IDataReader.ToEntity.cs | 55 ++++ .../_Internal/IDataReader.ToExpandoObject.cs | 37 +++ .../_Internal/IDataReader.ToExpandoObjects.cs | 44 ++++ src/Z.Data.MySql/_Internal/Object.As.cs | 22 ++ src/Z.Data.MySql/_Internal/Object.To.cs | 240 ++++++++++++++++++ ...Set.cs => SQLiteCommand.ExecuteDataSet.cs} | 2 +- ...e.cs => SQLiteCommand.ExecuteDataTable.cs} | 2 +- ....cs => SQLiteConnection.ExecuteDataSet.cs} | 32 +-- ...s => SQLiteConnection.ExecuteDataTable.cs} | 32 +-- ...cs => SQLiteConnection.ExecuteEntities.cs} | 33 +-- ...y.cs => SQLiteConnection.ExecuteEntity.cs} | 33 +-- ... SQLiteConnection.ExecuteExpandoObject.cs} | 33 +-- ...SQLiteConnection.ExecuteExpandoObjects.cs} | 33 +-- ...cs => SQLiteConnection.ExecuteNonQuery.cs} | 32 +-- ...r.cs => SQLiteConnection.ExecuteReader.cs} | 32 +-- ...r.cs => SQLiteConnection.ExecuteScalar.cs} | 32 +-- ...cs => SQLiteConnection.ExecuteScalarAs.cs} | 32 +-- ...cs => SQLiteConnection.ExecuteScalarTo.cs} | 33 +-- ...eParameterCollection.AddRangeWithValue.cs} | 2 +- src/Z.Data.SQLite/Z.Data.SQLite.csproj | 44 ++-- .../_Internal/IDataReader.ToEntities.cs | 62 +++++ .../_Internal/IDataReader.ToEntity.cs | 55 ++++ .../_Internal/IDataReader.ToExpandoObject.cs | 37 +++ .../_Internal/IDataReader.ToExpandoObjects.cs | 44 ++++ src/Z.Data.SQLite/_Internal/Object.As.cs | 22 ++ src/Z.Data.SQLite/_Internal/Object.To.cs | 240 ++++++++++++++++++ ...aSet.cs => SqlCeCommand.ExecuteDataSet.cs} | 2 +- ...le.cs => SqlCeCommand.ExecuteDataTable.cs} | 2 +- ...t.cs => SqlCeConnection.ExecuteDataSet.cs} | 32 +-- ...cs => SqlCeConnection.ExecuteDataTable.cs} | 32 +-- ....cs => SqlCeConnection.ExecuteEntities.cs} | 33 +-- ...ty.cs => SqlCeConnection.ExecuteEntity.cs} | 33 +-- ...> SqlCeConnection.ExecuteExpandoObject.cs} | 33 +-- ... SqlCeConnection.ExecuteExpandoObjects.cs} | 33 +-- ....cs => SqlCeConnection.ExecuteNonQuery.cs} | 32 +-- ...er.cs => SqlCeConnection.ExecuteReader.cs} | 32 +-- ...As.cs => SqlCeConnection.ExecuteScalar.cs} | 40 +-- ....cs => SqlCeConnection.ExecuteScalarAs.cs} | 36 +-- ....cs => SqlCeConnection.ExecuteScalarTo.cs} | 33 +-- ...eParameterCollection.AddRangeWithValue.cs} | 2 +- .../Z.Data.SqlServerCe.csproj | 44 ++-- .../_Internal/IDataReader.ToEntities.cs | 62 +++++ .../_Internal/IDataReader.ToEntity.cs | 55 ++++ .../_Internal/IDataReader.ToExpandoObject.cs | 37 +++ .../_Internal/IDataReader.ToExpandoObjects.cs | 44 ++++ src/Z.Data.SqlServerCe/_Internal/Object.As.cs | 22 ++ src/Z.Data.SqlServerCe/_Internal/Object.To.cs | 240 ++++++++++++++++++ .../MainForm.cs | 53 ++-- 65 files changed, 2060 insertions(+), 791 deletions(-) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/{MySqlCommand.MySqlExecuteDataSet.cs => MySqlCommand.ExecuteDataSet.cs} (92%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/{MySqlCommand.MySqlExecuteDataTable.cs => MySqlCommand.ExecuteDataTable.cs} (92%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteDataSet.cs => MySqlConnection.ExecuteDataSet.cs} (70%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteDataTable.cs => MySqlConnection.ExecuteDataTable.cs} (72%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteEntities.cs => MySqlConnection.ExecuteEntities.cs} (74%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteEntity.cs => MySqlConnection.ExecuteEntity.cs} (73%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteExpandoObject.cs => MySqlConnection.ExecuteExpandoObject.cs} (71%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteExpandoObjects.cs => MySqlConnection.ExecuteExpandoObjects.cs} (73%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteNonQuery.cs => MySqlConnection.ExecuteNonQuery.cs} (70%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteReader.cs => MySqlConnection.ExecuteReader.cs} (71%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteScalarAs.cs => MySqlConnection.ExecuteScalar.cs} (69%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteScalar.cs => MySqlConnection.ExecuteScalarAs.cs} (72%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/{MySqlConnection.MySqlExecuteScalarTo.cs => MySqlConnection.ExecuteScalarTo.cs} (71%) rename src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlParameterCollection/{MySqlParameterCollection.MySqlAddRangeWithValue.cs => MySqlParameterCollection.AddRangeWithValue.cs} (88%) create mode 100644 src/Z.Data.MySql/_Internal/IDataReader.ToEntities.cs create mode 100644 src/Z.Data.MySql/_Internal/IDataReader.ToEntity.cs create mode 100644 src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObject.cs create mode 100644 src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObjects.cs create mode 100644 src/Z.Data.MySql/_Internal/Object.As.cs create mode 100644 src/Z.Data.MySql/_Internal/Object.To.cs rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/{SQLiteCommand.SQLiteExecuteDataSet.cs => SQLiteCommand.ExecuteDataSet.cs} (92%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/{SQLiteCommand.SQLiteExecuteDataTable.cs => SQLiteCommand.ExecuteDataTable.cs} (92%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteDataSet.cs => SQLiteConnection.ExecuteDataSet.cs} (73%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteDataTable.cs => SQLiteConnection.ExecuteDataTable.cs} (73%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteEntities.cs => SQLiteConnection.ExecuteEntities.cs} (74%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteEntity.cs => SQLiteConnection.ExecuteEntity.cs} (73%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteExpandoObject.cs => SQLiteConnection.ExecuteExpandoObject.cs} (72%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteExpandoObjects.cs => SQLiteConnection.ExecuteExpandoObjects.cs} (74%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteNonQuery.cs => SQLiteConnection.ExecuteNonQuery.cs} (70%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteReader.cs => SQLiteConnection.ExecuteReader.cs} (71%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteScalar.cs => SQLiteConnection.ExecuteScalar.cs} (72%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteScalarAs.cs => SQLiteConnection.ExecuteScalarAs.cs} (72%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/{SQLiteConnection.SQLiteExecuteScalarTo.cs => SQLiteConnection.ExecuteScalarTo.cs} (72%) rename src/Z.Data.SQLite/System.Data.SQLite.SQLiteParameterCollection/{SQLiteParameterCollection.SQLiteAddRangeWithValue.cs => SQLiteParameterCollection.AddRangeWithValue.cs} (87%) create mode 100644 src/Z.Data.SQLite/_Internal/IDataReader.ToEntities.cs create mode 100644 src/Z.Data.SQLite/_Internal/IDataReader.ToEntity.cs create mode 100644 src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObject.cs create mode 100644 src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObjects.cs create mode 100644 src/Z.Data.SQLite/_Internal/Object.As.cs create mode 100644 src/Z.Data.SQLite/_Internal/Object.To.cs rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/{SqlCeCommand.SqlCeExecuteDataSet.cs => SqlCeCommand.ExecuteDataSet.cs} (92%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/{SqlCeCommand.SqlCeExecuteDataTable.cs => SqlCeCommand.ExecuteDataTable.cs} (92%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteDataSet.cs => SqlCeConnection.ExecuteDataSet.cs} (72%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteDataTable.cs => SqlCeConnection.ExecuteDataTable.cs} (72%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteEntities.cs => SqlCeConnection.ExecuteEntities.cs} (74%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteEntity.cs => SqlCeConnection.ExecuteEntity.cs} (73%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteExpandoObject.cs => SqlCeConnection.ExecuteExpandoObject.cs} (71%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteExpandoObjects.cs => SqlCeConnection.ExecuteExpandoObjects.cs} (73%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteNonQuery.cs => SqlCeConnection.ExecuteNonQuery.cs} (70%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteReader.cs => SqlCeConnection.ExecuteReader.cs} (71%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteScalarAs.cs => SqlCeConnection.ExecuteScalar.cs} (68%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteScalar.cs => SqlCeConnection.ExecuteScalarAs.cs} (72%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/{SqlCeConnection.SqlCeExecuteScalarTo.cs => SqlCeConnection.ExecuteScalarTo.cs} (71%) rename src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeParameterCollection/{SqlCeParameterCollection.SqlCeAddRangeWithValue.cs => SqlCeParameterCollection.AddRangeWithValue.cs} (88%) create mode 100644 src/Z.Data.SqlServerCe/_Internal/IDataReader.ToEntities.cs create mode 100644 src/Z.Data.SqlServerCe/_Internal/IDataReader.ToEntity.cs create mode 100644 src/Z.Data.SqlServerCe/_Internal/IDataReader.ToExpandoObject.cs create mode 100644 src/Z.Data.SqlServerCe/_Internal/IDataReader.ToExpandoObjects.cs create mode 100644 src/Z.Data.SqlServerCe/_Internal/Object.As.cs create mode 100644 src/Z.Data.SqlServerCe/_Internal/Object.To.cs diff --git a/Z.ExtensionMethods.Generated.sln b/Z.ExtensionMethods.Generated.sln index b29f444a..2d7cd6aa 100644 --- a/Z.ExtensionMethods.Generated.sln +++ b/Z.ExtensionMethods.Generated.sln @@ -91,157 +91,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lab", "lab", "{17901011-648 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Z.ExtensionMethods.Lab", "lab\Z.ExtensionMethods.Lab\Z.ExtensionMethods.Lab.csproj", "{7C99DCC9-7623-402E-9C6A-80892C30CCA6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Z.ExtensionMethods.Data.SQLite", "generated\Z.ExtensionMethods.Data.SQLite\Z.ExtensionMethods.Data.SQLite.csproj", "{A29A70F3-60DC-494F-98F2-90E33EE0FBD5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Z.ExtensionMethods.Data.MySql", "generated\Z.ExtensionMethods.Data.MySql\Z.ExtensionMethods.Data.MySql.csproj", "{5B5E31BE-2921-48DF-A78F-898D29ED1C01}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Z.ExtensionMethods.Data.SqlServerCe", "generated\Z.ExtensionMethods.Data.SqlServerCe\Z.ExtensionMethods.Data.SqlServerCe.csproj", "{23969445-2640-459E-AC0E-E2F991752B2B}" +EndProject Global - GlobalSection(TeamFoundationVersionControl) = preSolution - SccNumberOfProjects = 41 - SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} - SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs15 - SccLocalPath0 = . - SccProjectUniqueName1 = src\\Z.Caching\\Z.Caching.csproj - SccProjectName1 = src/Z.Caching - SccLocalPath1 = src\\Z.Caching - SccProjectUniqueName2 = src\\Z.Collections\\Z.Collections.csproj - SccProjectName2 = src/Z.Collections - SccLocalPath2 = src\\Z.Collections - SccProjectUniqueName3 = src\\Z.Compression\\Z.Compression.csproj - SccProjectName3 = src/Z.Compression - SccLocalPath3 = src\\Z.Compression - SccProjectUniqueName4 = src\\Z.Core\\Z.Core.csproj - SccProjectName4 = src/Z.Core - SccLocalPath4 = src\\Z.Core - SccProjectUniqueName5 = src\\Z.Data\\Z.Data.csproj - SccProjectName5 = src/Z.Data - SccLocalPath5 = src\\Z.Data - SccProjectUniqueName6 = src\\Z.Data.SQLite\\Z.Data.SQLite.csproj - SccProjectName6 = src/Z.Data.SQLite - SccLocalPath6 = src\\Z.Data.SQLite - SccProjectUniqueName7 = src\\Z.Data.SqlServerCe\\Z.Data.SqlServerCe.csproj - SccProjectName7 = src/Z.Data.SqlServerCe - SccLocalPath7 = src\\Z.Data.SqlServerCe - SccProjectUniqueName8 = src\\Z.Drawing\\Z.Drawing.csproj - SccProjectName8 = src/Z.Drawing - SccLocalPath8 = src\\Z.Drawing - SccProjectUniqueName9 = src\\Z.IO\\Z.IO.csproj - SccProjectName9 = src/Z.IO - SccLocalPath9 = src\\Z.IO - SccProjectUniqueName10 = src\\Z.Net\\Z.Net.csproj - SccProjectName10 = src/Z.Net - SccLocalPath10 = src\\Z.Net - SccProjectUniqueName11 = src\\Z.Reflection\\Z.Reflection.csproj - SccProjectName11 = src/Z.Reflection - SccLocalPath11 = src\\Z.Reflection - SccProjectUniqueName12 = src\\Z.Serialization\\Z.Serialization.csproj - SccProjectName12 = src/Z.Serialization - SccLocalPath12 = src\\Z.Serialization - SccProjectUniqueName13 = src\\Z.Web\\Z.Web.csproj - SccProjectName13 = src/Z.Web - SccLocalPath13 = src\\Z.Web - SccProjectUniqueName14 = src\\Z.Window.Forms\\Z.Window.Forms.csproj - SccProjectName14 = src/Z.Window.Forms - SccLocalPath14 = src\\Z.Window.Forms - SccProjectUniqueName15 = src\\Z.Xml.Linq\\Z.Xml.Linq.csproj - SccProjectName15 = src/Z.Xml.Linq - SccLocalPath15 = src\\Z.Xml.Linq - SccProjectUniqueName16 = test\\Z.Caching.Test\\Z.Caching.Test.csproj - SccProjectTopLevelParentUniqueName16 = Z.ExtensionMethods.sln - SccProjectName16 = test/Z.Caching.Test - SccLocalPath16 = test\\Z.Caching.Test - SccProjectUniqueName17 = test\\Z.Collections.Test\\Z.Collections.Test.csproj - SccProjectTopLevelParentUniqueName17 = Z.ExtensionMethods.sln - SccProjectName17 = test/Z.Collections.Test - SccLocalPath17 = test\\Z.Collections.Test - SccProjectUniqueName18 = test\\Z.Compression.Test\\Z.Compression.Test.csproj - SccProjectTopLevelParentUniqueName18 = Z.ExtensionMethods.sln - SccProjectName18 = test/Z.Compression.Test - SccLocalPath18 = test\\Z.Compression.Test - SccProjectUniqueName19 = test\\Z.Core.Test\\Z.Core.Test.csproj - SccProjectTopLevelParentUniqueName19 = Z.ExtensionMethods.sln - SccProjectName19 = test/Z.Core.Test - SccLocalPath19 = test\\Z.Core.Test - SccProjectUniqueName20 = test\\Z.Data.Test\\Z.Data.Test.csproj - SccProjectTopLevelParentUniqueName20 = Z.ExtensionMethods.sln - SccProjectName20 = test/Z.Data.Test - SccLocalPath20 = test\\Z.Data.Test - SccProjectUniqueName21 = test\\Z.Drawing.Test\\Z.Drawing.Test.csproj - SccProjectTopLevelParentUniqueName21 = Z.ExtensionMethods.sln - SccProjectName21 = test/Z.Drawing.Test - SccLocalPath21 = test\\Z.Drawing.Test - SccProjectUniqueName22 = test\\Z.IO.Test\\Z.IO.Test.csproj - SccProjectTopLevelParentUniqueName22 = Z.ExtensionMethods.sln - SccProjectName22 = test/Z.IO.Test - SccLocalPath22 = test\\Z.IO.Test - SccProjectUniqueName23 = test\\Z.Net.Test\\Z.Net.Test.csproj - SccProjectTopLevelParentUniqueName23 = Z.ExtensionMethods.sln - SccProjectName23 = test/Z.Net.Test - SccLocalPath23 = test\\Z.Net.Test - SccProjectUniqueName24 = test\\Z.Reflection.Test\\Z.Reflection.Test.csproj - SccProjectTopLevelParentUniqueName24 = Z.ExtensionMethods.sln - SccProjectName24 = test/Z.Reflection.Test - SccLocalPath24 = test\\Z.Reflection.Test - SccProjectUniqueName25 = test\\Z.Serialization.Test\\Z.Serialization.Test.csproj - SccProjectTopLevelParentUniqueName25 = Z.ExtensionMethods.sln - SccProjectName25 = test/Z.Serialization.Test - SccLocalPath25 = test\\Z.Serialization.Test - SccProjectUniqueName26 = test\\Z.Web.Test\\Z.Web.Test.csproj - SccProjectTopLevelParentUniqueName26 = Z.ExtensionMethods.sln - SccProjectName26 = test/Z.Web.Test - SccLocalPath26 = test\\Z.Web.Test - SccProjectUniqueName27 = test\\Z.Xml.Linq.Test\\Z.Xml.Linq.Test.csproj - SccProjectTopLevelParentUniqueName27 = Z.ExtensionMethods.sln - SccProjectName27 = test/Z.Xml.Linq.Test - SccLocalPath27 = test\\Z.Xml.Linq.Test - SccProjectUniqueName28 = tool\\Z.ExtensionMethods.Tool.GenerateFramework\\Z.ExtensionMethods.Tool.GenerateFramework.csproj - SccProjectTopLevelParentUniqueName28 = Z.ExtensionMethods.sln - SccProjectName28 = tool/Z.ExtensionMethods.Tool.GenerateFramework - SccLocalPath28 = tool\\Z.ExtensionMethods.Tool.GenerateFramework - SccProjectUniqueName29 = generated\\Z.ExtensionMethods.NET40\\Z.ExtensionMethods.NET40.csproj - SccProjectTopLevelParentUniqueName29 = Z.ExtensionMethods.sln - SccProjectName29 = generated/Z.ExtensionMethods.NET40 - SccLocalPath29 = generated\\Z.ExtensionMethods.NET40 - SccProjectUniqueName30 = generated\\Z.ExtensionMethods.NET45\\Z.ExtensionMethods.NET45.csproj - SccProjectTopLevelParentUniqueName30 = Z.ExtensionMethods.sln - SccProjectName30 = generated/Z.ExtensionMethods.NET45 - SccLocalPath30 = generated\\Z.ExtensionMethods.NET45 - SccProjectUniqueName31 = generated\\Z.ExtensionMethods.WithOneNamespace.NET40\\Z.ExtensionMethods.WithOneNamespace.NET40.csproj - SccProjectTopLevelParentUniqueName31 = Z.ExtensionMethods.sln - SccProjectName31 = generated/Z.ExtensionMethods.WithOneNamespace.NET40 - SccLocalPath31 = generated\\Z.ExtensionMethods.WithOneNamespace.NET40 - SccProjectUniqueName32 = generated\\Z.ExtensionMethods.WithOneNamespace.NET45\\Z.ExtensionMethods.WithOneNamespace.NET45.csproj - SccProjectTopLevelParentUniqueName32 = Z.ExtensionMethods.sln - SccProjectName32 = generated/Z.ExtensionMethods.WithOneNamespace.NET45 - SccLocalPath32 = generated\\Z.ExtensionMethods.WithOneNamespace.NET45 - SccProjectUniqueName33 = generated\\Z.ExtensionMethods.WithTwoNamespace.NET40\\Z.ExtensionMethods.WithTwoNamespace.NET40.csproj - SccProjectTopLevelParentUniqueName33 = Z.ExtensionMethods.sln - SccProjectName33 = generated/Z.ExtensionMethods.WithTwoNamespace.NET40 - SccLocalPath33 = generated\\Z.ExtensionMethods.WithTwoNamespace.NET40 - SccProjectUniqueName34 = generated\\Z.ExtensionMethods.WithObjectNamespace.NET40\\Z.ExtensionMethods.WithObjectNamespace.NET40.csproj - SccProjectTopLevelParentUniqueName34 = Z.ExtensionMethods.sln - SccProjectName34 = generated/Z.ExtensionMethods.WithObjectNamespace.NET40 - SccLocalPath34 = generated\\Z.ExtensionMethods.WithObjectNamespace.NET40 - SccProjectUniqueName35 = generated\\Z.ExtensionMethods.WithTwoNamespace.NET45\\Z.ExtensionMethods.WithTwoNamespace.NET45.csproj - SccProjectTopLevelParentUniqueName35 = Z.ExtensionMethods.sln - SccProjectName35 = generated/Z.ExtensionMethods.WithTwoNamespace.NET45 - SccLocalPath35 = generated\\Z.ExtensionMethods.WithTwoNamespace.NET45 - SccProjectUniqueName36 = generated\\Z.ExtensionMethods.WithObjectNamespace.NET45\\Z.ExtensionMethods.WithObjectNamespace.NET45.csproj - SccProjectTopLevelParentUniqueName36 = Z.ExtensionMethods.sln - SccProjectName36 = generated/Z.ExtensionMethods.WithObjectNamespace.NET45 - SccLocalPath36 = generated\\Z.ExtensionMethods.WithObjectNamespace.NET45 - SccProjectUniqueName37 = generated\\Z.ExtensionMethods.WithNamespace.NET40\\Z.ExtensionMethods.WithNamespace.NET40.csproj - SccProjectTopLevelParentUniqueName37 = Z.ExtensionMethods.sln - SccProjectName37 = generated/Z.ExtensionMethods.WithNamespace.NET40 - SccLocalPath37 = generated\\Z.ExtensionMethods.WithNamespace.NET40 - SccProjectUniqueName38 = generated\\Z.ExtensionMethods.WithNamespace.NET45\\Z.ExtensionMethods.WithNamespace.NET45.csproj - SccProjectTopLevelParentUniqueName38 = Z.ExtensionMethods.sln - SccProjectName38 = generated/Z.ExtensionMethods.WithNamespace.NET45 - SccLocalPath38 = generated\\Z.ExtensionMethods.WithNamespace.NET45 - SccProjectUniqueName39 = src\\Z.Data.MySql\\Z.Data.MySql.csproj - SccProjectName39 = src/Z.Data.MySql - SccLocalPath39 = src\\Z.Data.MySql - SccProjectUniqueName40 = lab\\Z.ExtensionMethods.Lab\\Z.ExtensionMethods.Lab.csproj - SccProjectTopLevelParentUniqueName40 = Z.ExtensionMethods.sln - SccProjectName40 = lab/Z.ExtensionMethods.Lab - SccLocalPath40 = lab\\Z.ExtensionMethods.Lab - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -407,9 +263,21 @@ Global {7C99DCC9-7623-402E-9C6A-80892C30CCA6}.Debug|Any CPU.Build.0 = Debug|Any CPU {7C99DCC9-7623-402E-9C6A-80892C30CCA6}.Release|Any CPU.ActiveCfg = Release|Any CPU {7C99DCC9-7623-402E-9C6A-80892C30CCA6}.Release|Any CPU.Build.0 = Release|Any CPU + {A29A70F3-60DC-494F-98F2-90E33EE0FBD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A29A70F3-60DC-494F-98F2-90E33EE0FBD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A29A70F3-60DC-494F-98F2-90E33EE0FBD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A29A70F3-60DC-494F-98F2-90E33EE0FBD5}.Release|Any CPU.Build.0 = Release|Any CPU + {5B5E31BE-2921-48DF-A78F-898D29ED1C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5B5E31BE-2921-48DF-A78F-898D29ED1C01}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B5E31BE-2921-48DF-A78F-898D29ED1C01}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5B5E31BE-2921-48DF-A78F-898D29ED1C01}.Release|Any CPU.Build.0 = Release|Any CPU + {23969445-2640-459E-AC0E-E2F991752B2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23969445-2640-459E-AC0E-E2F991752B2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23969445-2640-459E-AC0E-E2F991752B2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23969445-2640-459E-AC0E-E2F991752B2B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {33BD78F7-E14C-40B5-82E1-5BEFA2792FA0} = {9C296DC8-C7D0-4D87-8F49-BC811C7C7C0C} @@ -436,5 +304,8 @@ Global {8EA1BFBC-D124-4863-AD05-C0DE186BDE17} = {234D0FBA-C701-4C89-A52D-1F41BCD58DC8} {DD103536-5CF5-43D4-A597-9E57FBA389C1} = {234D0FBA-C701-4C89-A52D-1F41BCD58DC8} {7C99DCC9-7623-402E-9C6A-80892C30CCA6} = {17901011-6488-4283-83F2-D40E8D891A91} + {A29A70F3-60DC-494F-98F2-90E33EE0FBD5} = {234D0FBA-C701-4C89-A52D-1F41BCD58DC8} + {5B5E31BE-2921-48DF-A78F-898D29ED1C01} = {234D0FBA-C701-4C89-A52D-1F41BCD58DC8} + {23969445-2640-459E-AC0E-E2F991752B2B} = {234D0FBA-C701-4C89-A52D-1F41BCD58DC8} EndGlobalSection EndGlobal diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.MySqlExecuteDataSet.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.ExecuteDataSet.cs similarity index 92% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.MySqlExecuteDataSet.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.ExecuteDataSet.cs index 7b77d7b1..4c181d3f 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.MySqlExecuteDataSet.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.ExecuteDataSet.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// A DataSet that is equivalent to the result set. - public static DataSet MySqlExecuteDataSet(this MySqlCommand @this) + public static DataSet ExecuteDataSet(this MySqlCommand @this) { var ds = new DataSet(); using (var dataAdapter = new MySqlDataAdapter(@this)) diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.MySqlExecuteDataTable.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.ExecuteDataTable.cs similarity index 92% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.MySqlExecuteDataTable.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.ExecuteDataTable.cs index aed40a73..6ba0cfe6 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.MySqlExecuteDataTable.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlCommand/MySqlCommand.ExecuteDataTable.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// A DataTable that is equivalent to the first result set. - public static DataTable MySqlExecuteDataTable(this MySqlCommand @this) + public static DataTable ExecuteDataTable(this MySqlCommand @this) { var dt = new DataTable(); using (var dataAdapter = new MySqlDataAdapter(@this)) diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteDataSet.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteDataSet.cs similarity index 70% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteDataSet.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteDataSet.cs index 003df791..54fa1f05 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteDataSet.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteDataSet.cs @@ -19,9 +19,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { - using (MySqlCommand command = @this.CreateCommand()) + using (var command = @this.CreateCommand()) { command.CommandText = cmdText; command.CommandType = commandType; @@ -48,9 +48,9 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmd /// The @this to act on. /// The command factory. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, Action commandFactory) + public static DataSet ExecuteDataSet(this MySqlConnection @this, Action commandFactory) { - using (MySqlCommand command = @this.CreateCommand()) + using (var command = @this.CreateCommand()) { commandFactory(command); @@ -70,9 +70,9 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, ActionThe @this to act on. /// The command text. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteDataSet(cmdText, null, CommandType.Text, null); + return @this.ExecuteDataSet(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +82,9 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmd /// The command text. /// The transaction. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteDataSet(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteDataSet(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +94,9 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmd /// The command text. /// Type of the command. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText, CommandType commandType) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteDataSet(cmdText, null, commandType, null); + return @this.ExecuteDataSet(cmdText, null, commandType, null); } /// @@ -107,9 +107,9 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmd /// Type of the command. /// The transaction. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteDataSet(cmdText, null, commandType, transaction); + return @this.ExecuteDataSet(cmdText, null, commandType, transaction); } /// @@ -119,9 +119,9 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmd /// The command text. /// Options for controlling the operation. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteDataSet(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteDataSet(cmdText, parameters, CommandType.Text, null); } /// @@ -132,9 +132,9 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmd /// Options for controlling the operation. /// The transaction. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteDataSet(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteDataSet(cmdText, parameters, CommandType.Text, transaction); } /// @@ -145,8 +145,8 @@ public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmd /// Options for controlling the operation. /// Type of the command. /// A DataSet. - public static DataSet MySqlExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static DataSet ExecuteDataSet(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteDataSet(cmdText, parameters, commandType, null); + return @this.ExecuteDataSet(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteDataTable.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteDataTable.cs similarity index 72% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteDataTable.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteDataTable.cs index f3cb03f8..019a6858 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteDataTable.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteDataTable.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -48,7 +48,7 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string /// The @this to act on. /// The command factory. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, Action commandFactory) + public static DataTable ExecuteDataTable(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { @@ -70,9 +70,9 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, Action /// The @this to act on. /// The command text. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteDataTable(cmdText, null, CommandType.Text, null); + return @this.ExecuteDataTable(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +82,9 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string /// The command text. /// The transaction. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteDataTable(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteDataTable(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +94,9 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string /// The command text. /// Type of the command. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText, CommandType commandType) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteDataTable(cmdText, null, commandType, null); + return @this.ExecuteDataTable(cmdText, null, commandType, null); } /// @@ -107,9 +107,9 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string /// Type of the command. /// The transaction. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteDataTable(cmdText, null, commandType, transaction); + return @this.ExecuteDataTable(cmdText, null, commandType, transaction); } /// @@ -119,9 +119,9 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string /// The command text. /// Options for controlling the operation. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteDataTable(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteDataTable(cmdText, parameters, CommandType.Text, null); } /// @@ -132,9 +132,9 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string /// Options for controlling the operation. /// The transaction. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteDataTable(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteDataTable(cmdText, parameters, CommandType.Text, transaction); } /// @@ -145,8 +145,8 @@ public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string /// Options for controlling the operation. /// Type of the command. /// A DataTable. - public static DataTable MySqlExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static DataTable ExecuteDataTable(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteDataTable(cmdText, parameters, commandType, null); + return @this.ExecuteDataTable(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteEntities.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteEntities.cs similarity index 74% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteEntities.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteEntities.cs index 58bf0810..f09b8884 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteEntities.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteEntities.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Data; using MySql.Data.MySqlClient; +using Z.Data.MySql; public static partial class Extensions { @@ -21,7 +22,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) where T : new() { using (MySqlCommand command = @this.CreateCommand()) { @@ -48,7 +49,7 @@ public static partial class Extensions /// The @this to act on. /// The command factory. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, Action commandFactory) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, Action commandFactory) where T : new() { using (MySqlCommand command = @this.CreateCommand()) { @@ -68,9 +69,9 @@ public static partial class Extensions /// The @this to act on. /// The command text. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText) where T : new() { - return @this.MySqlExecuteEntities(cmdText, null, CommandType.Text, null); + return @this.ExecuteEntities(cmdText, null, CommandType.Text, null); } /// @@ -81,9 +82,9 @@ public static partial class Extensions /// The command text. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) where T : new() { - return @this.MySqlExecuteEntities(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteEntities(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +95,9 @@ public static partial class Extensions /// The command text. /// Type of the command. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText, CommandType commandType) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText, CommandType commandType) where T : new() { - return @this.MySqlExecuteEntities(cmdText, null, commandType, null); + return @this.ExecuteEntities(cmdText, null, commandType, null); } /// @@ -108,9 +109,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) where T : new() { - return @this.MySqlExecuteEntities(cmdText, null, commandType, transaction); + return @this.ExecuteEntities(cmdText, null, commandType, transaction); } /// @@ -121,9 +122,9 @@ public static partial class Extensions /// The command text. /// Options for controlling the operation. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) where T : new() { - return @this.MySqlExecuteEntities(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteEntities(cmdText, parameters, CommandType.Text, null); } /// @@ -135,9 +136,9 @@ public static partial class Extensions /// Options for controlling the operation. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) where T : new() { - return @this.MySqlExecuteEntities(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteEntities(cmdText, parameters, CommandType.Text, transaction); } /// @@ -149,8 +150,8 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable MySqlExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) where T : new() + public static IEnumerable ExecuteEntities(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) where T : new() { - return @this.MySqlExecuteEntities(cmdText, parameters, commandType, null); + return @this.ExecuteEntities(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteEntity.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteEntity.cs similarity index 73% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteEntity.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteEntity.cs index f3225f83..687e9b4f 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteEntity.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteEntity.cs @@ -7,6 +7,7 @@ using System; using System.Data; using MySql.Data.MySqlClient; +using Z.Data.MySql; public static partial class Extensions { @@ -20,7 +21,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) where T : new() { using (MySqlCommand command = @this.CreateCommand()) { @@ -48,7 +49,7 @@ public static partial class Extensions /// The @this to act on. /// The command factory. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, Action commandFactory) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, Action commandFactory) where T : new() { using (MySqlCommand command = @this.CreateCommand()) { @@ -69,9 +70,9 @@ public static partial class Extensions /// The @this to act on. /// The command text. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText) where T : new() { - return @this.MySqlExecuteEntity(cmdText, null, CommandType.Text, null); + return @this.ExecuteEntity(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +83,9 @@ public static partial class Extensions /// The command text. /// The transaction. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) where T : new() { - return @this.MySqlExecuteEntity(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteEntity(cmdText, null, CommandType.Text, transaction); } /// @@ -95,9 +96,9 @@ public static partial class Extensions /// The command text. /// Type of the command. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText, CommandType commandType) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText, CommandType commandType) where T : new() { - return @this.MySqlExecuteEntity(cmdText, null, commandType, null); + return @this.ExecuteEntity(cmdText, null, commandType, null); } /// @@ -109,9 +110,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) where T : new() { - return @this.MySqlExecuteEntity(cmdText, null, commandType, transaction); + return @this.ExecuteEntity(cmdText, null, commandType, transaction); } /// @@ -122,9 +123,9 @@ public static partial class Extensions /// The command text. /// Options for controlling the operation. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) where T : new() { - return @this.MySqlExecuteEntity(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteEntity(cmdText, parameters, CommandType.Text, null); } /// @@ -136,9 +137,9 @@ public static partial class Extensions /// Options for controlling the operation. /// The transaction. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) where T : new() { - return @this.MySqlExecuteEntity(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteEntity(cmdText, parameters, CommandType.Text, transaction); } /// @@ -150,8 +151,8 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// A T. - public static T MySqlExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) where T : new() + public static T ExecuteEntity(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) where T : new() { - return @this.MySqlExecuteEntity(cmdText, parameters, commandType, null); + return @this.ExecuteEntity(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteExpandoObject.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteExpandoObject.cs similarity index 71% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteExpandoObject.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteExpandoObject.cs index 8df874ab..21618ad1 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteExpandoObject.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteExpandoObject.cs @@ -7,6 +7,7 @@ using System; using System.Data; using MySql.Data.MySqlClient; +using Z.Data.MySql; public static partial class Extensions { @@ -19,7 +20,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -46,7 +47,7 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, stri /// The @this to act on. /// The command factory. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, Action commandFactory) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { @@ -66,9 +67,9 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, Acti /// The @this to act on. /// The command text. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteExpandoObject(cmdText, null, CommandType.Text, null); + return @this.ExecuteExpandoObject(cmdText, null, CommandType.Text, null); } /// @@ -78,9 +79,9 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, stri /// The command text. /// The transaction. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteExpandoObject(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteExpandoObject(cmdText, null, CommandType.Text, transaction); } /// @@ -90,9 +91,9 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, stri /// The command text. /// Type of the command. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText, CommandType commandType) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteExpandoObject(cmdText, null, commandType, null); + return @this.ExecuteExpandoObject(cmdText, null, commandType, null); } /// @@ -103,9 +104,9 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, stri /// Type of the command. /// The transaction. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteExpandoObject(cmdText, null, commandType, transaction); + return @this.ExecuteExpandoObject(cmdText, null, commandType, transaction); } /// @@ -115,9 +116,9 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, stri /// The command text. /// Options for controlling the operation. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteExpandoObject(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteExpandoObject(cmdText, parameters, CommandType.Text, null); } /// @@ -128,9 +129,9 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, stri /// Options for controlling the operation. /// The transaction. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteExpandoObject(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteExpandoObject(cmdText, parameters, CommandType.Text, transaction); } /// @@ -141,8 +142,8 @@ public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, stri /// Options for controlling the operation. /// Type of the command. /// A dynamic. - public static dynamic MySqlExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static dynamic ExecuteExpandoObject(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteExpandoObject(cmdText, parameters, commandType, null); + return @this.ExecuteExpandoObject(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteExpandoObjects.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteExpandoObjects.cs similarity index 73% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteExpandoObjects.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteExpandoObjects.cs index 03e87ec2..02233b14 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteExpandoObjects.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteExpandoObjects.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Data; using MySql.Data.MySqlClient; +using Z.Data.MySql; public static partial class Extensions { @@ -22,7 +23,7 @@ public static partial class Extensions /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -50,7 +51,7 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, Action commandFactory) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { @@ -71,9 +72,9 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteExpandoObjects(cmdText, null, CommandType.Text, null); + return @this.ExecuteExpandoObjects(cmdText, null, CommandType.Text, null); } /// @@ -85,9 +86,9 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteExpandoObjects(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteExpandoObjects(cmdText, null, CommandType.Text, transaction); } /// @@ -99,9 +100,9 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText, CommandType commandType) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteExpandoObjects(cmdText, null, commandType, null); + return @this.ExecuteExpandoObjects(cmdText, null, commandType, null); } /// @@ -114,9 +115,9 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteExpandoObjects(cmdText, null, commandType, transaction); + return @this.ExecuteExpandoObjects(cmdText, null, commandType, transaction); } /// @@ -128,9 +129,9 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteExpandoObjects(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteExpandoObjects(cmdText, parameters, CommandType.Text, null); } /// @@ -143,9 +144,9 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteExpandoObjects(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteExpandoObjects(cmdText, parameters, CommandType.Text, transaction); } /// @@ -158,8 +159,8 @@ public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable MySqlExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static IEnumerable ExecuteExpandoObjects(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteExpandoObjects(cmdText, parameters, commandType, null); + return @this.ExecuteExpandoObjects(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteNonQuery.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteNonQuery.cs similarity index 70% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteNonQuery.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteNonQuery.cs index 0ca786a7..b1e6064b 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteNonQuery.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteNonQuery.cs @@ -18,7 +18,7 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// The transaction. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -40,7 +40,7 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdTe /// /// The @this to act on. /// The command factory. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, Action commandFactory) + public static void ExecuteNonQuery(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { @@ -55,9 +55,9 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, Action /// The @this to act on. /// The command text. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText) { - @this.MySqlExecuteNonQuery(cmdText, null, CommandType.Text, null); + @this.ExecuteNonQuery(cmdText, null, CommandType.Text, null); } /// @@ -66,9 +66,9 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdTe /// The @this to act on. /// The command text. /// The transaction. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - @this.MySqlExecuteNonQuery(cmdText, null, CommandType.Text, transaction); + @this.ExecuteNonQuery(cmdText, null, CommandType.Text, transaction); } /// @@ -77,9 +77,9 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdTe /// The @this to act on. /// The command text. /// Type of the command. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText, CommandType commandType) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText, CommandType commandType) { - @this.MySqlExecuteNonQuery(cmdText, null, commandType, null); + @this.ExecuteNonQuery(cmdText, null, commandType, null); } /// @@ -89,9 +89,9 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdTe /// The command text. /// Type of the command. /// The transaction. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - @this.MySqlExecuteNonQuery(cmdText, null, commandType, transaction); + @this.ExecuteNonQuery(cmdText, null, commandType, transaction); } /// @@ -100,9 +100,9 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdTe /// The @this to act on. /// The command text. /// Options for controlling the operation. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - @this.MySqlExecuteNonQuery(cmdText, parameters, CommandType.Text, null); + @this.ExecuteNonQuery(cmdText, parameters, CommandType.Text, null); } /// @@ -112,9 +112,9 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// The transaction. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - @this.MySqlExecuteNonQuery(cmdText, parameters, CommandType.Text, transaction); + @this.ExecuteNonQuery(cmdText, parameters, CommandType.Text, transaction); } /// @@ -124,8 +124,8 @@ public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// Type of the command. - public static void MySqlExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static void ExecuteNonQuery(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - @this.MySqlExecuteNonQuery(cmdText, parameters, commandType, null); + @this.ExecuteNonQuery(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteReader.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteReader.cs similarity index 71% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteReader.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteReader.cs index f6414742..621fdb77 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteReader.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteReader.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -42,7 +42,7 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, str /// The @this to act on. /// The command factory. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, Action commandFactory) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { @@ -58,9 +58,9 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, Act /// The @this to act on. /// The command text. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteReader(cmdText, null, CommandType.Text, null); + return @this.ExecuteReader(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, str /// The command text. /// The transaction. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteReader(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteReader(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, str /// The command text. /// Type of the command. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText, CommandType commandType) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteReader(cmdText, null, commandType, null); + return @this.ExecuteReader(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, str /// Type of the command. /// The transaction. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteReader(cmdText, null, commandType, transaction); + return @this.ExecuteReader(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, str /// The command text. /// Options for controlling the operation. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteReader(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteReader(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, str /// Options for controlling the operation. /// The transaction. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteReader(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteReader(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, str /// Options for controlling the operation. /// Type of the command. /// A MySqlDataReader. - public static MySqlDataReader MySqlExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static MySqlDataReader ExecuteReader(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteReader(cmdText, parameters, commandType, null); + return @this.ExecuteReader(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalarAs.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalar.cs similarity index 69% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalarAs.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalar.cs index ff184899..2f7ee7d2 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalarAs.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalar.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -32,7 +32,7 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe command.Parameters.AddRange(parameters); } - return (T) command.ExecuteScalar(); + return command.ExecuteScalar(); } } @@ -42,13 +42,13 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe /// The @this to act on. /// The command factory. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, Action commandFactory) + public static object ExecuteScalar(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { commandFactory(command); - return (T) command.ExecuteScalar(); + return command.ExecuteScalar(); } } @@ -58,9 +58,9 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteScalarAs(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalar(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe /// The command text. /// The transaction. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteScalarAs(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalar(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe /// The command text. /// Type of the command. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText, CommandType commandType) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteScalarAs(cmdText, null, commandType, null); + return @this.ExecuteScalar(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe /// Type of the command. /// The transaction. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteScalarAs(cmdText, null, commandType, transaction); + return @this.ExecuteScalar(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteScalarAs(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalar(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe /// Options for controlling the operation. /// The transaction. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteScalarAs(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalar(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdTe /// Options for controlling the operation. /// Type of the command. /// An object. - public static T MySqlExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static object ExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteScalarAs(cmdText, parameters, commandType, null); + return @this.ExecuteScalar(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalar.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalarAs.cs similarity index 72% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalar.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalarAs.cs index eb186eb6..f758290c 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalar.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalarAs.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -32,7 +32,7 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe command.Parameters.AddRange(parameters); } - return command.ExecuteScalar(); + return (T) command.ExecuteScalar(); } } @@ -42,13 +42,13 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe /// The @this to act on. /// The command factory. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, Action commandFactory) + public static T ExecuteScalarAs(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { commandFactory(command); - return command.ExecuteScalar(); + return (T) command.ExecuteScalar(); } } @@ -58,9 +58,9 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteScalar(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalarAs(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe /// The command text. /// The transaction. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteScalar(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalarAs(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe /// The command text. /// Type of the command. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText, CommandType commandType) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteScalar(cmdText, null, commandType, null); + return @this.ExecuteScalarAs(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe /// Type of the command. /// The transaction. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteScalar(cmdText, null, commandType, transaction); + return @this.ExecuteScalarAs(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteScalar(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalarAs(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe /// Options for controlling the operation. /// The transaction. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteScalar(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalarAs(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdTe /// Options for controlling the operation. /// Type of the command. /// An object. - public static object MySqlExecuteScalar(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static T ExecuteScalarAs(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteScalar(cmdText, parameters, commandType, null); + return @this.ExecuteScalarAs(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalarTo.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalarTo.cs similarity index 71% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalarTo.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalarTo.cs index 91bcb329..3f8212ac 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.MySqlExecuteScalarTo.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlConnection/MySqlConnection.ExecuteScalarTo.cs @@ -7,6 +7,7 @@ using System; using System.Data; using MySql.Data.MySqlClient; +using Z.Data.MySql; public static partial class Extensions { @@ -19,7 +20,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType, MySqlTransaction transaction) { using (MySqlCommand command = @this.CreateCommand()) { @@ -42,7 +43,7 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdTe /// The @this to act on. /// The command factory. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, Action commandFactory) + public static T ExecuteScalarTo(this MySqlConnection @this, Action commandFactory) { using (MySqlCommand command = @this.CreateCommand()) { @@ -58,9 +59,9 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText) { - return @this.MySqlExecuteScalarTo(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalarTo(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +71,9 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdTe /// The command text. /// The transaction. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlTransaction transaction) { - return @this.MySqlExecuteScalarTo(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalarTo(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +83,9 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdTe /// The command text. /// Type of the command. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText, CommandType commandType) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText, CommandType commandType) { - return @this.MySqlExecuteScalarTo(cmdText, null, commandType, null); + return @this.ExecuteScalarTo(cmdText, null, commandType, null); } /// @@ -95,9 +96,9 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdTe /// Type of the command. /// The transaction. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText, CommandType commandType, MySqlTransaction transaction) { - return @this.MySqlExecuteScalarTo(cmdText, null, commandType, transaction); + return @this.ExecuteScalarTo(cmdText, null, commandType, transaction); } /// @@ -107,9 +108,9 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters) { - return @this.MySqlExecuteScalarTo(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalarTo(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +121,9 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdTe /// Options for controlling the operation. /// The transaction. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, MySqlTransaction transaction) { - return @this.MySqlExecuteScalarTo(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalarTo(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +134,8 @@ public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdTe /// Options for controlling the operation. /// Type of the command. /// An object. - public static T MySqlExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) + public static T ExecuteScalarTo(this MySqlConnection @this, string cmdText, MySqlParameter[] parameters, CommandType commandType) { - return @this.MySqlExecuteScalarTo(cmdText, parameters, commandType, null); + return @this.ExecuteScalarTo(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlParameterCollection/MySqlParameterCollection.MySqlAddRangeWithValue.cs b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlParameterCollection/MySqlParameterCollection.AddRangeWithValue.cs similarity index 88% rename from src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlParameterCollection/MySqlParameterCollection.MySqlAddRangeWithValue.cs rename to src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlParameterCollection/MySqlParameterCollection.AddRangeWithValue.cs index a97afc2a..3a21df4a 100644 --- a/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlParameterCollection/MySqlParameterCollection.MySqlAddRangeWithValue.cs +++ b/src/Z.Data.MySql/MySql.Data.MySqlClient.MySqlParameterCollection/MySqlParameterCollection.AddRangeWithValue.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// The values. - public static void MySqlAddRangeWithValue(this MySqlParameterCollection @this, Dictionary values) + public static void AddRangeWithValue(this MySqlParameterCollection @this, Dictionary values) { foreach (var keyValuePair in values) { diff --git a/src/Z.Data.MySql/Z.Data.MySql.csproj b/src/Z.Data.MySql/Z.Data.MySql.csproj index 9f92d6d8..e68e3780 100644 --- a/src/Z.Data.MySql/Z.Data.MySql.csproj +++ b/src/Z.Data.MySql/Z.Data.MySql.csproj @@ -70,31 +70,27 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - {02f009f8-720b-4cbd-98ff-f2c33f4441d5} - Z.Core - - - {6edebb64-2d4b-43cc-a94e-919b44e254a2} - Z.Data - + + + + + + diff --git a/src/Z.Data.MySql/_Internal/IDataReader.ToEntities.cs b/src/Z.Data.MySql/_Internal/IDataReader.ToEntities.cs new file mode 100644 index 00000000..dc214db7 --- /dev/null +++ b/src/Z.Data.MySql/_Internal/IDataReader.ToEntities.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; + +namespace Z.Data.MySql +{ + internal static partial class Extensions + { + /// + /// Enumerates to entities in this collection. + /// + /// Generic type parameter. + /// The @this to act on. + /// @this as an IEnumerable<T> + public static IEnumerable ToEntities(this IDataReader @this) where T : new() + { + Type type = typeof (T); + PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); + FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance); + + var list = new List(); + + var hash = new HashSet(Enumerable.Range(0, @this.FieldCount) + .Select(@this.GetName)); + + while (@this.Read()) + { + var entity = new T(); + + foreach (PropertyInfo property in properties) + { + if (hash.Contains(property.Name)) + { + Type valueType = property.PropertyType; + property.SetValue(entity, @this[property.Name].To(valueType), null); + } + } + + foreach (FieldInfo field in fields) + { + if (hash.Contains(field.Name)) + { + Type valueType = field.FieldType; + field.SetValue(entity, @this[field.Name].To(valueType)); + } + } + + list.Add(entity); + } + + return list; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.MySql/_Internal/IDataReader.ToEntity.cs b/src/Z.Data.MySql/_Internal/IDataReader.ToEntity.cs new file mode 100644 index 00000000..99d006d6 --- /dev/null +++ b/src/Z.Data.MySql/_Internal/IDataReader.ToEntity.cs @@ -0,0 +1,55 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; + +namespace Z.Data.MySql +{ + internal static partial class Extensions + { + /// + /// An IDataReader extension method that converts the @this to an entity. + /// + /// Generic type parameter. + /// The @this to act on. + /// @this as a T. + public static T ToEntity(this IDataReader @this) where T : new() + { + Type type = typeof (T); + PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); + FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance); + + var entity = new T(); + + var hash = new HashSet(Enumerable.Range(0, @this.FieldCount) + .Select(@this.GetName)); + + foreach (PropertyInfo property in properties) + { + if (hash.Contains(property.Name)) + { + Type valueType = property.PropertyType; + property.SetValue(entity, @this[property.Name].To(valueType), null); + } + } + + foreach (FieldInfo field in fields) + { + if (hash.Contains(field.Name)) + { + Type valueType = field.FieldType; + field.SetValue(entity, @this[field.Name].To(valueType)); + } + } + + return entity; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObject.cs b/src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObject.cs new file mode 100644 index 00000000..9e583649 --- /dev/null +++ b/src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObject.cs @@ -0,0 +1,37 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System.Collections.Generic; +using System.Data; +using System.Dynamic; +using System.Linq; + +namespace Z.Data.MySql +{ + internal static partial class Extensions + { + /// + /// An IDataReader extension method that converts the @this to an expando object. + /// + /// The @this to act on. + /// @this as a dynamic. + public static dynamic ToExpandoObject(this IDataReader @this) + { + Dictionary> columnNames = Enumerable.Range(0, @this.FieldCount) + .Select(x => new KeyValuePair(x, @this.GetName(x))) + .ToDictionary(pair => pair.Key); + + dynamic entity = new ExpandoObject(); + var expandoDict = (IDictionary) entity; + + Enumerable.Range(0, @this.FieldCount) + .ToList() + .ForEach(x => expandoDict.Add(columnNames[x].Value, @this[x])); + + return entity; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObjects.cs b/src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObjects.cs new file mode 100644 index 00000000..3229e762 --- /dev/null +++ b/src/Z.Data.MySql/_Internal/IDataReader.ToExpandoObjects.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System.Collections.Generic; +using System.Data; +using System.Dynamic; +using System.Linq; + +namespace Z.Data.MySql +{ + internal static partial class Extensions + { + /// + /// Enumerates to expando objects in this collection. + /// + /// The @this to act on. + /// @this as an IEnumerable<dynamic> + public static IEnumerable ToExpandoObjects(this IDataReader @this) + { + Dictionary> columnNames = Enumerable.Range(0, @this.FieldCount) + .Select(x => new KeyValuePair(x, @this.GetName(x))) + .ToDictionary(pair => pair.Key); + + var list = new List(); + + while (@this.Read()) + { + dynamic entity = new ExpandoObject(); + var expandoDict = (IDictionary) entity; + + Enumerable.Range(0, @this.FieldCount) + .ToList() + .ForEach(x => expandoDict.Add(columnNames[x].Value, @this[x])); + + list.Add(entity); + } + + return list; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.MySql/_Internal/Object.As.cs b/src/Z.Data.MySql/_Internal/Object.As.cs new file mode 100644 index 00000000..7520f7c8 --- /dev/null +++ b/src/Z.Data.MySql/_Internal/Object.As.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +namespace Z.Data.MySql +{ + internal static partial class Extensions + { + /// + /// An object extension method that cast anonymous type to the specified type. + /// + /// Generic type parameter. The specified type. + /// The @this to act on. + /// The object as the specified type. + public static T As(this object @this) + { + return (T) @this; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.MySql/_Internal/Object.To.cs b/src/Z.Data.MySql/_Internal/Object.To.cs new file mode 100644 index 00000000..a4d21412 --- /dev/null +++ b/src/Z.Data.MySql/_Internal/Object.To.cs @@ -0,0 +1,240 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System; +using System.ComponentModel; + +namespace Z.Data.MySql +{ + internal static partial class Extensions + { + /// + /// A System.Object extension method that toes the given this. + /// + /// Generic type parameter. + /// this. + /// A T. + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// using Z.ExtensionMethods.Object; + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + public static T To(this Object @this) + { + if (@this != null) + { + Type targetType = typeof (T); + + if (@this.GetType() == targetType) + { + return (T) @this; + } + + TypeConverter converter = TypeDescriptor.GetConverter(@this); + if (converter != null) + { + if (converter.CanConvertTo(targetType)) + { + return (T) converter.ConvertTo(@this, targetType); + } + } + + converter = TypeDescriptor.GetConverter(targetType); + if (converter != null) + { + if (converter.CanConvertFrom(@this.GetType())) + { + return (T) converter.ConvertFrom(@this); + } + } + + if (@this == DBNull.Value) + { + return (T) (object) null; + } + } + + return (T) @this; + } + + /// + /// A System.Object extension method that toes the given this. + /// + /// this. + /// The type. + /// An object. + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// using Z.ExtensionMethods.Object; + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + /// ### + /// Generic type parameter. + public static object To(this Object @this, Type type) + { + if (@this != null) + { + Type targetType = type; + + if (@this.GetType() == targetType) + { + return @this; + } + + TypeConverter converter = TypeDescriptor.GetConverter(@this); + if (converter != null) + { + if (converter.CanConvertTo(targetType)) + { + return converter.ConvertTo(@this, targetType); + } + } + + converter = TypeDescriptor.GetConverter(targetType); + if (converter != null) + { + if (converter.CanConvertFrom(@this.GetType())) + { + return converter.ConvertFrom(@this); + } + } + + if (@this == DBNull.Value) + { + return null; + } + } + + return @this; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.SQLiteExecuteDataSet.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.ExecuteDataSet.cs similarity index 92% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.SQLiteExecuteDataSet.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.ExecuteDataSet.cs index 4e1e68bb..e557d2b4 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.SQLiteExecuteDataSet.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.ExecuteDataSet.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// A DataSet that is equivalent to the result set. - public static DataSet SQLiteExecuteDataSet(this SQLiteCommand @this) + public static DataSet ExecuteDataSet(this SQLiteCommand @this) { var ds = new DataSet(); using (var dataAdapter = new SQLiteDataAdapter(@this)) diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.SQLiteExecuteDataTable.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.ExecuteDataTable.cs similarity index 92% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.SQLiteExecuteDataTable.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.ExecuteDataTable.cs index 9413d9da..338160de 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.SQLiteExecuteDataTable.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteCommand/SQLiteCommand.ExecuteDataTable.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// A DataTable that is equivalent to the first result set. - public static DataTable SQLiteExecuteDataTable(this SQLiteCommand @this) + public static DataTable ExecuteDataTable(this SQLiteCommand @this) { var dt = new DataTable(); using (var dataAdapter = new SQLiteDataAdapter(@this)) diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteDataSet.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteDataSet.cs similarity index 73% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteDataSet.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteDataSet.cs index 4656a6bb..14b5aa2b 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteDataSet.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteDataSet.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -48,7 +48,7 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string c /// The @this to act on. /// The command factory. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, Action commandFactory) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -70,9 +70,9 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, ActionThe @this to act on. /// The command text. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteDataSet(cmdText, null, CommandType.Text, null); + return @this.ExecuteDataSet(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +82,9 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string c /// The command text. /// The transaction. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteDataSet(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteDataSet(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +94,9 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string c /// The command text. /// Type of the command. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteDataSet(cmdText, null, commandType, null); + return @this.ExecuteDataSet(cmdText, null, commandType, null); } /// @@ -107,9 +107,9 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string c /// Type of the command. /// The transaction. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteDataSet(cmdText, null, commandType, transaction); + return @this.ExecuteDataSet(cmdText, null, commandType, transaction); } /// @@ -119,9 +119,9 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string c /// The command text. /// Options for controlling the operation. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteDataSet(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteDataSet(cmdText, parameters, CommandType.Text, null); } /// @@ -132,9 +132,9 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string c /// Options for controlling the operation. /// The transaction. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteDataSet(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteDataSet(cmdText, parameters, CommandType.Text, transaction); } /// @@ -145,8 +145,8 @@ public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string c /// Options for controlling the operation. /// Type of the command. /// A DataSet. - public static DataSet SQLiteExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static DataSet ExecuteDataSet(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteDataSet(cmdText, parameters, commandType, null); + return @this.ExecuteDataSet(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteDataTable.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteDataTable.cs similarity index 73% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteDataTable.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteDataTable.cs index 5d318bf8..4f18c7fd 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteDataTable.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteDataTable.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -48,7 +48,7 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, stri /// The @this to act on. /// The command factory. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, Action commandFactory) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -70,9 +70,9 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, Acti /// The @this to act on. /// The command text. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteDataTable(cmdText, null, CommandType.Text, null); + return @this.ExecuteDataTable(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +82,9 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, stri /// The command text. /// The transaction. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteDataTable(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteDataTable(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +94,9 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, stri /// The command text. /// Type of the command. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteDataTable(cmdText, null, commandType, null); + return @this.ExecuteDataTable(cmdText, null, commandType, null); } /// @@ -107,9 +107,9 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, stri /// Type of the command. /// The transaction. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteDataTable(cmdText, null, commandType, transaction); + return @this.ExecuteDataTable(cmdText, null, commandType, transaction); } /// @@ -119,9 +119,9 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, stri /// The command text. /// Options for controlling the operation. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteDataTable(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteDataTable(cmdText, parameters, CommandType.Text, null); } /// @@ -132,9 +132,9 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, stri /// Options for controlling the operation. /// The transaction. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteDataTable(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteDataTable(cmdText, parameters, CommandType.Text, transaction); } /// @@ -145,8 +145,8 @@ public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, stri /// Options for controlling the operation. /// Type of the command. /// A DataTable. - public static DataTable SQLiteExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static DataTable ExecuteDataTable(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteDataTable(cmdText, parameters, commandType, null); + return @this.ExecuteDataTable(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteEntities.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteEntities.cs similarity index 74% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteEntities.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteEntities.cs index a7fe78ee..1706d247 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteEntities.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteEntities.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Data; using System.Data.SQLite; +using Z.Data.SQLite; public static partial class Extensions { @@ -21,7 +22,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) where T : new() { using (SQLiteCommand command = @this.CreateCommand()) { @@ -48,7 +49,7 @@ public static partial class Extensions /// The @this to act on. /// The command factory. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, Action commandFactory) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, Action commandFactory) where T : new() { using (SQLiteCommand command = @this.CreateCommand()) { @@ -68,9 +69,9 @@ public static partial class Extensions /// The @this to act on. /// The command text. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText) where T : new() { - return @this.SQLiteExecuteEntities(cmdText, null, CommandType.Text, null); + return @this.ExecuteEntities(cmdText, null, CommandType.Text, null); } /// @@ -81,9 +82,9 @@ public static partial class Extensions /// The command text. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) where T : new() { - return @this.SQLiteExecuteEntities(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteEntities(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +95,9 @@ public static partial class Extensions /// The command text. /// Type of the command. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText, CommandType commandType) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText, CommandType commandType) where T : new() { - return @this.SQLiteExecuteEntities(cmdText, null, commandType, null); + return @this.ExecuteEntities(cmdText, null, commandType, null); } /// @@ -108,9 +109,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) where T : new() { - return @this.SQLiteExecuteEntities(cmdText, null, commandType, transaction); + return @this.ExecuteEntities(cmdText, null, commandType, transaction); } /// @@ -121,9 +122,9 @@ public static partial class Extensions /// The command text. /// Options for controlling the operation. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) where T : new() { - return @this.SQLiteExecuteEntities(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteEntities(cmdText, parameters, CommandType.Text, null); } /// @@ -135,9 +136,9 @@ public static partial class Extensions /// Options for controlling the operation. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) where T : new() { - return @this.SQLiteExecuteEntities(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteEntities(cmdText, parameters, CommandType.Text, transaction); } /// @@ -149,8 +150,8 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SQLiteExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) where T : new() + public static IEnumerable ExecuteEntities(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) where T : new() { - return @this.SQLiteExecuteEntities(cmdText, parameters, commandType, null); + return @this.ExecuteEntities(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteEntity.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteEntity.cs similarity index 73% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteEntity.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteEntity.cs index 31be0e65..60040933 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteEntity.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteEntity.cs @@ -7,6 +7,7 @@ using System; using System.Data; using System.Data.SQLite; +using Z.Data.SQLite; public static partial class Extensions { @@ -20,7 +21,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) where T : new() { using (SQLiteCommand command = @this.CreateCommand()) { @@ -48,7 +49,7 @@ public static partial class Extensions /// The @this to act on. /// The command factory. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, Action commandFactory) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, Action commandFactory) where T : new() { using (SQLiteCommand command = @this.CreateCommand()) { @@ -69,9 +70,9 @@ public static partial class Extensions /// The @this to act on. /// The command text. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText) where T : new() { - return @this.SQLiteExecuteEntity(cmdText, null, CommandType.Text, null); + return @this.ExecuteEntity(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +83,9 @@ public static partial class Extensions /// The command text. /// The transaction. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) where T : new() { - return @this.SQLiteExecuteEntity(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteEntity(cmdText, null, CommandType.Text, transaction); } /// @@ -95,9 +96,9 @@ public static partial class Extensions /// The command text. /// Type of the command. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText, CommandType commandType) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText, CommandType commandType) where T : new() { - return @this.SQLiteExecuteEntity(cmdText, null, commandType, null); + return @this.ExecuteEntity(cmdText, null, commandType, null); } /// @@ -109,9 +110,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) where T : new() { - return @this.SQLiteExecuteEntity(cmdText, null, commandType, transaction); + return @this.ExecuteEntity(cmdText, null, commandType, transaction); } /// @@ -122,9 +123,9 @@ public static partial class Extensions /// The command text. /// Options for controlling the operation. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) where T : new() { - return @this.SQLiteExecuteEntity(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteEntity(cmdText, parameters, CommandType.Text, null); } /// @@ -136,9 +137,9 @@ public static partial class Extensions /// Options for controlling the operation. /// The transaction. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) where T : new() { - return @this.SQLiteExecuteEntity(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteEntity(cmdText, parameters, CommandType.Text, transaction); } /// @@ -150,8 +151,8 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// A T. - public static T SQLiteExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) where T : new() + public static T ExecuteEntity(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) where T : new() { - return @this.SQLiteExecuteEntity(cmdText, parameters, commandType, null); + return @this.ExecuteEntity(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteExpandoObject.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteExpandoObject.cs similarity index 72% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteExpandoObject.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteExpandoObject.cs index 00ee8635..8915267e 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteExpandoObject.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteExpandoObject.cs @@ -7,6 +7,7 @@ using System; using System.Data; using System.Data.SQLite; +using Z.Data.SQLite; public static partial class Extensions { @@ -19,7 +20,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -46,7 +47,7 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, st /// The @this to act on. /// The command factory. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, Action commandFactory) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -66,9 +67,9 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, Ac /// The @this to act on. /// The command text. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteExpandoObject(cmdText, null, CommandType.Text, null); + return @this.ExecuteExpandoObject(cmdText, null, CommandType.Text, null); } /// @@ -78,9 +79,9 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, st /// The command text. /// The transaction. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteExpandoObject(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteExpandoObject(cmdText, null, CommandType.Text, transaction); } /// @@ -90,9 +91,9 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, st /// The command text. /// Type of the command. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteExpandoObject(cmdText, null, commandType, null); + return @this.ExecuteExpandoObject(cmdText, null, commandType, null); } /// @@ -103,9 +104,9 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, st /// Type of the command. /// The transaction. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteExpandoObject(cmdText, null, commandType, transaction); + return @this.ExecuteExpandoObject(cmdText, null, commandType, transaction); } /// @@ -115,9 +116,9 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, st /// The command text. /// Options for controlling the operation. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteExpandoObject(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteExpandoObject(cmdText, parameters, CommandType.Text, null); } /// @@ -128,9 +129,9 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, st /// Options for controlling the operation. /// The transaction. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteExpandoObject(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteExpandoObject(cmdText, parameters, CommandType.Text, transaction); } /// @@ -141,8 +142,8 @@ public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, st /// Options for controlling the operation. /// Type of the command. /// A dynamic. - public static dynamic SQLiteExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static dynamic ExecuteExpandoObject(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteExpandoObject(cmdText, parameters, commandType, null); + return @this.ExecuteExpandoObject(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteExpandoObjects.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteExpandoObjects.cs similarity index 74% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteExpandoObjects.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteExpandoObjects.cs index 17f8532b..b0ee6dc2 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteExpandoObjects.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteExpandoObjects.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Data; using System.Data.SQLite; +using Z.Data.SQLite; public static partial class Extensions { @@ -22,7 +23,7 @@ public static partial class Extensions /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -50,7 +51,7 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, Action commandFactory) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -71,9 +72,9 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteExpandoObjects(cmdText, null, CommandType.Text, null); + return @this.ExecuteExpandoObjects(cmdText, null, CommandType.Text, null); } /// @@ -85,9 +86,9 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteExpandoObjects(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteExpandoObjects(cmdText, null, CommandType.Text, transaction); } /// @@ -99,9 +100,9 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteExpandoObjects(cmdText, null, commandType, null); + return @this.ExecuteExpandoObjects(cmdText, null, commandType, null); } /// @@ -114,9 +115,9 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteExpandoObjects(cmdText, null, commandType, transaction); + return @this.ExecuteExpandoObjects(cmdText, null, commandType, transaction); } /// @@ -128,9 +129,9 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteExpandoObjects(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteExpandoObjects(cmdText, parameters, CommandType.Text, null); } /// @@ -143,9 +144,9 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteExpandoObjects(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteExpandoObjects(cmdText, parameters, CommandType.Text, transaction); } /// @@ -158,8 +159,8 @@ public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnec /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SQLiteExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static IEnumerable ExecuteExpandoObjects(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteExpandoObjects(cmdText, parameters, commandType, null); + return @this.ExecuteExpandoObjects(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteNonQuery.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteNonQuery.cs similarity index 70% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteNonQuery.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteNonQuery.cs index 7fdbfd27..6b3cf7a6 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteNonQuery.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteNonQuery.cs @@ -18,7 +18,7 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// The transaction. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -40,7 +40,7 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmd /// /// The @this to act on. /// The command factory. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, Action commandFactory) + public static void ExecuteNonQuery(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -55,9 +55,9 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, Action /// The @this to act on. /// The command text. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText) { - @this.SQLiteExecuteNonQuery(cmdText, null, CommandType.Text, null); + @this.ExecuteNonQuery(cmdText, null, CommandType.Text, null); } /// @@ -66,9 +66,9 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmd /// The @this to act on. /// The command text. /// The transaction. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - @this.SQLiteExecuteNonQuery(cmdText, null, CommandType.Text, transaction); + @this.ExecuteNonQuery(cmdText, null, CommandType.Text, transaction); } /// @@ -77,9 +77,9 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmd /// The @this to act on. /// The command text. /// Type of the command. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText, CommandType commandType) { - @this.SQLiteExecuteNonQuery(cmdText, null, commandType, null); + @this.ExecuteNonQuery(cmdText, null, commandType, null); } /// @@ -89,9 +89,9 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmd /// The command text. /// Type of the command. /// The transaction. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - @this.SQLiteExecuteNonQuery(cmdText, null, commandType, transaction); + @this.ExecuteNonQuery(cmdText, null, commandType, transaction); } /// @@ -100,9 +100,9 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmd /// The @this to act on. /// The command text. /// Options for controlling the operation. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - @this.SQLiteExecuteNonQuery(cmdText, parameters, CommandType.Text, null); + @this.ExecuteNonQuery(cmdText, parameters, CommandType.Text, null); } /// @@ -112,9 +112,9 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmd /// The command text. /// Options for controlling the operation. /// The transaction. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - @this.SQLiteExecuteNonQuery(cmdText, parameters, CommandType.Text, transaction); + @this.ExecuteNonQuery(cmdText, parameters, CommandType.Text, transaction); } /// @@ -124,8 +124,8 @@ public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmd /// The command text. /// Options for controlling the operation. /// Type of the command. - public static void SQLiteExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static void ExecuteNonQuery(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - @this.SQLiteExecuteNonQuery(cmdText, parameters, commandType, null); + @this.ExecuteNonQuery(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteReader.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteReader.cs similarity index 71% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteReader.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteReader.cs index c9832493..c233b0aa 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteReader.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteReader.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -42,7 +42,7 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// The @this to act on. /// The command factory. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, Action commandFactory) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -58,9 +58,9 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// The @this to act on. /// The command text. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteReader(cmdText, null, CommandType.Text, null); + return @this.ExecuteReader(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// The command text. /// The transaction. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteReader(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteReader(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// The command text. /// Type of the command. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteReader(cmdText, null, commandType, null); + return @this.ExecuteReader(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// Type of the command. /// The transaction. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteReader(cmdText, null, commandType, transaction); + return @this.ExecuteReader(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// The command text. /// Options for controlling the operation. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteReader(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteReader(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// Options for controlling the operation. /// The transaction. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteReader(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteReader(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, /// Options for controlling the operation. /// Type of the command. /// A SQLiteDataReader. - public static SQLiteDataReader SQLiteExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static SQLiteDataReader ExecuteReader(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteReader(cmdText, parameters, commandType, null); + return @this.ExecuteReader(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalar.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalar.cs similarity index 72% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalar.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalar.cs index f0e20e9d..13310d91 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalar.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalar.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -42,7 +42,7 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmd /// The @this to act on. /// The command factory. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, Action commandFactory) + public static object ExecuteScalar(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -58,9 +58,9 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteScalar(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalar(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmd /// The command text. /// The transaction. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalar(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalar(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmd /// The command text. /// Type of the command. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteScalar(cmdText, null, commandType, null); + return @this.ExecuteScalar(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmd /// Type of the command. /// The transaction. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalar(cmdText, null, commandType, transaction); + return @this.ExecuteScalar(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmd /// The command text. /// Options for controlling the operation. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteScalar(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalar(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmd /// Options for controlling the operation. /// The transaction. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalar(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalar(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmd /// Options for controlling the operation. /// Type of the command. /// An object. - public static object SQLiteExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static object ExecuteScalar(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteScalar(cmdText, parameters, commandType, null); + return @this.ExecuteScalar(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalarAs.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalarAs.cs similarity index 72% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalarAs.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalarAs.cs index e7d48a30..f65681a4 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalarAs.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalarAs.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -42,7 +42,7 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmd /// The @this to act on. /// The command factory. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, Action commandFactory) + public static T ExecuteScalarAs(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -58,9 +58,9 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteScalarAs(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalarAs(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmd /// The command text. /// The transaction. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalarAs(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalarAs(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmd /// The command text. /// Type of the command. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteScalarAs(cmdText, null, commandType, null); + return @this.ExecuteScalarAs(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmd /// Type of the command. /// The transaction. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalarAs(cmdText, null, commandType, transaction); + return @this.ExecuteScalarAs(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmd /// The command text. /// Options for controlling the operation. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteScalarAs(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalarAs(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmd /// Options for controlling the operation. /// The transaction. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalarAs(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalarAs(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmd /// Options for controlling the operation. /// Type of the command. /// An object. - public static T SQLiteExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static T ExecuteScalarAs(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteScalarAs(cmdText, parameters, commandType, null); + return @this.ExecuteScalarAs(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalarTo.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalarTo.cs similarity index 72% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalarTo.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalarTo.cs index 21e4fbd3..2357b5e5 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.SQLiteExecuteScalarTo.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteConnection/SQLiteConnection.ExecuteScalarTo.cs @@ -7,6 +7,7 @@ using System; using System.Data; using System.Data.SQLite; +using Z.Data.SQLite; public static partial class Extensions { @@ -19,7 +20,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType, SQLiteTransaction transaction) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -42,7 +43,7 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmd /// The @this to act on. /// The command factory. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, Action commandFactory) + public static T ExecuteScalarTo(this SQLiteConnection @this, Action commandFactory) { using (SQLiteCommand command = @this.CreateCommand()) { @@ -58,9 +59,9 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText) { - return @this.SQLiteExecuteScalarTo(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalarTo(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +71,9 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmd /// The command text. /// The transaction. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalarTo(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalarTo(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +83,9 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmd /// The command text. /// Type of the command. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText, CommandType commandType) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText, CommandType commandType) { - return @this.SQLiteExecuteScalarTo(cmdText, null, commandType, null); + return @this.ExecuteScalarTo(cmdText, null, commandType, null); } /// @@ -95,9 +96,9 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmd /// Type of the command. /// The transaction. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText, CommandType commandType, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalarTo(cmdText, null, commandType, transaction); + return @this.ExecuteScalarTo(cmdText, null, commandType, transaction); } /// @@ -107,9 +108,9 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmd /// The command text. /// Options for controlling the operation. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters) { - return @this.SQLiteExecuteScalarTo(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalarTo(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +121,9 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmd /// Options for controlling the operation. /// The transaction. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, SQLiteTransaction transaction) { - return @this.SQLiteExecuteScalarTo(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalarTo(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +134,8 @@ public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmd /// Options for controlling the operation. /// Type of the command. /// An object. - public static T SQLiteExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) + public static T ExecuteScalarTo(this SQLiteConnection @this, string cmdText, SQLiteParameter[] parameters, CommandType commandType) { - return @this.SQLiteExecuteScalarTo(cmdText, parameters, commandType, null); + return @this.ExecuteScalarTo(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteParameterCollection/SQLiteParameterCollection.SQLiteAddRangeWithValue.cs b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteParameterCollection/SQLiteParameterCollection.AddRangeWithValue.cs similarity index 87% rename from src/Z.Data.SQLite/System.Data.SQLite.SQLiteParameterCollection/SQLiteParameterCollection.SQLiteAddRangeWithValue.cs rename to src/Z.Data.SQLite/System.Data.SQLite.SQLiteParameterCollection/SQLiteParameterCollection.AddRangeWithValue.cs index 2698c22b..0698c58e 100644 --- a/src/Z.Data.SQLite/System.Data.SQLite.SQLiteParameterCollection/SQLiteParameterCollection.SQLiteAddRangeWithValue.cs +++ b/src/Z.Data.SQLite/System.Data.SQLite.SQLiteParameterCollection/SQLiteParameterCollection.AddRangeWithValue.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// The values. - public static void SQLiteAddRangeWithValue(this SQLiteParameterCollection @this, Dictionary values) + public static void AddRangeWithValue(this SQLiteParameterCollection @this, Dictionary values) { foreach (var keyValuePair in values) { diff --git a/src/Z.Data.SQLite/Z.Data.SQLite.csproj b/src/Z.Data.SQLite/Z.Data.SQLite.csproj index 21a62400..2e9bb5bd 100644 --- a/src/Z.Data.SQLite/Z.Data.SQLite.csproj +++ b/src/Z.Data.SQLite/Z.Data.SQLite.csproj @@ -72,30 +72,26 @@ - - - - - - - - - - - - - - - - - - {02f009f8-720b-4cbd-98ff-f2c33f4441d5} - Z.Core - - - {6edebb64-2d4b-43cc-a94e-919b44e254a2} - Z.Data - + + + + + + + + + + + + + + + + + + + + diff --git a/src/Z.Data.SQLite/_Internal/IDataReader.ToEntities.cs b/src/Z.Data.SQLite/_Internal/IDataReader.ToEntities.cs new file mode 100644 index 00000000..e9484c18 --- /dev/null +++ b/src/Z.Data.SQLite/_Internal/IDataReader.ToEntities.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; + +namespace Z.Data.SQLite +{ + internal static partial class Extensions + { + /// + /// Enumerates to entities in this collection. + /// + /// Generic type parameter. + /// The @this to act on. + /// @this as an IEnumerable<T> + public static IEnumerable ToEntities(this IDataReader @this) where T : new() + { + Type type = typeof (T); + PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); + FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance); + + var list = new List(); + + var hash = new HashSet(Enumerable.Range(0, @this.FieldCount) + .Select(@this.GetName)); + + while (@this.Read()) + { + var entity = new T(); + + foreach (PropertyInfo property in properties) + { + if (hash.Contains(property.Name)) + { + Type valueType = property.PropertyType; + property.SetValue(entity, @this[property.Name].To(valueType), null); + } + } + + foreach (FieldInfo field in fields) + { + if (hash.Contains(field.Name)) + { + Type valueType = field.FieldType; + field.SetValue(entity, @this[field.Name].To(valueType)); + } + } + + list.Add(entity); + } + + return list; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.SQLite/_Internal/IDataReader.ToEntity.cs b/src/Z.Data.SQLite/_Internal/IDataReader.ToEntity.cs new file mode 100644 index 00000000..8d865c74 --- /dev/null +++ b/src/Z.Data.SQLite/_Internal/IDataReader.ToEntity.cs @@ -0,0 +1,55 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; + +namespace Z.Data.SQLite +{ + internal static partial class Extensions + { + /// + /// An IDataReader extension method that converts the @this to an entity. + /// + /// Generic type parameter. + /// The @this to act on. + /// @this as a T. + public static T ToEntity(this IDataReader @this) where T : new() + { + Type type = typeof (T); + PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); + FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance); + + var entity = new T(); + + var hash = new HashSet(Enumerable.Range(0, @this.FieldCount) + .Select(@this.GetName)); + + foreach (PropertyInfo property in properties) + { + if (hash.Contains(property.Name)) + { + Type valueType = property.PropertyType; + property.SetValue(entity, @this[property.Name].To(valueType), null); + } + } + + foreach (FieldInfo field in fields) + { + if (hash.Contains(field.Name)) + { + Type valueType = field.FieldType; + field.SetValue(entity, @this[field.Name].To(valueType)); + } + } + + return entity; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObject.cs b/src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObject.cs new file mode 100644 index 00000000..fcfc7b60 --- /dev/null +++ b/src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObject.cs @@ -0,0 +1,37 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System.Collections.Generic; +using System.Data; +using System.Dynamic; +using System.Linq; + +namespace Z.Data.SQLite +{ + internal static partial class Extensions + { + /// + /// An IDataReader extension method that converts the @this to an expando object. + /// + /// The @this to act on. + /// @this as a dynamic. + public static dynamic ToExpandoObject(this IDataReader @this) + { + Dictionary> columnNames = Enumerable.Range(0, @this.FieldCount) + .Select(x => new KeyValuePair(x, @this.GetName(x))) + .ToDictionary(pair => pair.Key); + + dynamic entity = new ExpandoObject(); + var expandoDict = (IDictionary) entity; + + Enumerable.Range(0, @this.FieldCount) + .ToList() + .ForEach(x => expandoDict.Add(columnNames[x].Value, @this[x])); + + return entity; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObjects.cs b/src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObjects.cs new file mode 100644 index 00000000..ed78fcd8 --- /dev/null +++ b/src/Z.Data.SQLite/_Internal/IDataReader.ToExpandoObjects.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System.Collections.Generic; +using System.Data; +using System.Dynamic; +using System.Linq; + +namespace Z.Data.SQLite +{ + internal static partial class Extensions + { + /// + /// Enumerates to expando objects in this collection. + /// + /// The @this to act on. + /// @this as an IEnumerable<dynamic> + public static IEnumerable ToExpandoObjects(this IDataReader @this) + { + Dictionary> columnNames = Enumerable.Range(0, @this.FieldCount) + .Select(x => new KeyValuePair(x, @this.GetName(x))) + .ToDictionary(pair => pair.Key); + + var list = new List(); + + while (@this.Read()) + { + dynamic entity = new ExpandoObject(); + var expandoDict = (IDictionary) entity; + + Enumerable.Range(0, @this.FieldCount) + .ToList() + .ForEach(x => expandoDict.Add(columnNames[x].Value, @this[x])); + + list.Add(entity); + } + + return list; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.SQLite/_Internal/Object.As.cs b/src/Z.Data.SQLite/_Internal/Object.As.cs new file mode 100644 index 00000000..81a773be --- /dev/null +++ b/src/Z.Data.SQLite/_Internal/Object.As.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +namespace Z.Data.SQLite +{ + internal static partial class Extensions + { + /// + /// An object extension method that cast anonymous type to the specified type. + /// + /// Generic type parameter. The specified type. + /// The @this to act on. + /// The object as the specified type. + public static T As(this object @this) + { + return (T) @this; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.SQLite/_Internal/Object.To.cs b/src/Z.Data.SQLite/_Internal/Object.To.cs new file mode 100644 index 00000000..d664dbb9 --- /dev/null +++ b/src/Z.Data.SQLite/_Internal/Object.To.cs @@ -0,0 +1,240 @@ +// Copyright (c) 2015 ZZZ Projects. All rights reserved +// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) +// Website: http://www.zzzprojects.com/ +// Feedback / Feature Requests / Issues : http://zzzprojects.uservoice.com/forums/283927 +// All ZZZ Projects products: Entity Framework Extensions / Bulk Operations / Extension Methods /Icon Library + +using System; +using System.ComponentModel; + +namespace Z.Data.SQLite +{ + internal static partial class Extensions + { + /// + /// A System.Object extension method that toes the given this. + /// + /// Generic type parameter. + /// this. + /// A T. + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// using Z.ExtensionMethods.Object; + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + public static T To(this Object @this) + { + if (@this != null) + { + Type targetType = typeof (T); + + if (@this.GetType() == targetType) + { + return (T) @this; + } + + TypeConverter converter = TypeDescriptor.GetConverter(@this); + if (converter != null) + { + if (converter.CanConvertTo(targetType)) + { + return (T) converter.ConvertTo(@this, targetType); + } + } + + converter = TypeDescriptor.GetConverter(targetType); + if (converter != null) + { + if (converter.CanConvertFrom(@this.GetType())) + { + return (T) converter.ConvertFrom(@this); + } + } + + if (@this == DBNull.Value) + { + return (T) (object) null; + } + } + + return (T) @this; + } + + /// + /// A System.Object extension method that toes the given this. + /// + /// this. + /// The type. + /// An object. + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + /// + /// + /// using System; + /// using Microsoft.VisualStudio.TestTools.UnitTesting; + /// using Z.ExtensionMethods.Object; + /// + /// namespace ExtensionMethods.Examples + /// { + /// [TestClass] + /// public class System_Object_To + /// { + /// [TestMethod] + /// public void To() + /// { + /// string nullValue = null; + /// string value = "1"; + /// object dbNullValue = DBNull.Value; + /// + /// // Exemples + /// var result1 = value.To<int>(); // return 1; + /// var result2 = value.To<int?>(); // return 1; + /// var result3 = nullValue.To<int?>(); // return null; + /// var result4 = dbNullValue.To<int?>(); // return null; + /// + /// // Unit Test + /// Assert.AreEqual(1, result1); + /// Assert.AreEqual(1, result2.Value); + /// Assert.IsFalse(result3.HasValue); + /// Assert.IsFalse(result4.HasValue); + /// } + /// } + /// } + /// + /// + /// ### + /// Generic type parameter. + public static object To(this Object @this, Type type) + { + if (@this != null) + { + Type targetType = type; + + if (@this.GetType() == targetType) + { + return @this; + } + + TypeConverter converter = TypeDescriptor.GetConverter(@this); + if (converter != null) + { + if (converter.CanConvertTo(targetType)) + { + return converter.ConvertTo(@this, targetType); + } + } + + converter = TypeDescriptor.GetConverter(targetType); + if (converter != null) + { + if (converter.CanConvertFrom(@this.GetType())) + { + return converter.ConvertFrom(@this); + } + } + + if (@this == DBNull.Value) + { + return null; + } + } + + return @this; + } + } +} \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.SqlCeExecuteDataSet.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.ExecuteDataSet.cs similarity index 92% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.SqlCeExecuteDataSet.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.ExecuteDataSet.cs index 2d55e02c..979afd32 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.SqlCeExecuteDataSet.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.ExecuteDataSet.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// A DataSet that is equivalent to the result set. - public static DataSet SqlCeExecuteDataSet(this SqlCeCommand @this) + public static DataSet ExecuteDataSet(this SqlCeCommand @this) { var ds = new DataSet(); using (var dataAdapter = new SqlCeDataAdapter(@this)) diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.SqlCeExecuteDataTable.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.ExecuteDataTable.cs similarity index 92% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.SqlCeExecuteDataTable.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.ExecuteDataTable.cs index 376cc05f..dcab6ad1 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.SqlCeExecuteDataTable.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeCommand/SqlCeCommand.ExecuteDataTable.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// A DataTable that is equivalent to the first result set. - public static DataTable SqlCeExecuteDataTable(this SqlCeCommand @this) + public static DataTable ExecuteDataTable(this SqlCeCommand @this) { var dt = new DataTable(); using (var dataAdapter = new SqlCeDataAdapter(@this)) diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteDataSet.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteDataSet.cs similarity index 72% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteDataSet.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteDataSet.cs index 779776cc..fcdeb3c3 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteDataSet.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteDataSet.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -48,7 +48,7 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmd /// The @this to act on. /// The command factory. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, Action commandFactory) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -70,9 +70,9 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, ActionThe @this to act on. /// The command text. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteDataSet(cmdText, null, CommandType.Text, null); + return @this.ExecuteDataSet(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +82,9 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmd /// The command text. /// The transaction. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteDataSet(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteDataSet(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +94,9 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmd /// The command text. /// Type of the command. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteDataSet(cmdText, null, commandType, null); + return @this.ExecuteDataSet(cmdText, null, commandType, null); } /// @@ -107,9 +107,9 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmd /// Type of the command. /// The transaction. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteDataSet(cmdText, null, commandType, transaction); + return @this.ExecuteDataSet(cmdText, null, commandType, transaction); } /// @@ -119,9 +119,9 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmd /// The command text. /// Options for controlling the operation. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteDataSet(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteDataSet(cmdText, parameters, CommandType.Text, null); } /// @@ -132,9 +132,9 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmd /// Options for controlling the operation. /// The transaction. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteDataSet(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteDataSet(cmdText, parameters, CommandType.Text, transaction); } /// @@ -145,8 +145,8 @@ public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmd /// Options for controlling the operation. /// Type of the command. /// A DataSet. - public static DataSet SqlCeExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static DataSet ExecuteDataSet(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteDataSet(cmdText, parameters, commandType, null); + return @this.ExecuteDataSet(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteDataTable.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteDataTable.cs similarity index 72% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteDataTable.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteDataTable.cs index c04ec661..5620579e 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteDataTable.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteDataTable.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -48,7 +48,7 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string /// The @this to act on. /// The command factory. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, Action commandFactory) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -70,9 +70,9 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, Action /// The @this to act on. /// The command text. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteDataTable(cmdText, null, CommandType.Text, null); + return @this.ExecuteDataTable(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +82,9 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string /// The command text. /// The transaction. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteDataTable(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteDataTable(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +94,9 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string /// The command text. /// Type of the command. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteDataTable(cmdText, null, commandType, null); + return @this.ExecuteDataTable(cmdText, null, commandType, null); } /// @@ -107,9 +107,9 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string /// Type of the command. /// The transaction. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteDataTable(cmdText, null, commandType, transaction); + return @this.ExecuteDataTable(cmdText, null, commandType, transaction); } /// @@ -119,9 +119,9 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string /// The command text. /// Options for controlling the operation. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteDataTable(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteDataTable(cmdText, parameters, CommandType.Text, null); } /// @@ -132,9 +132,9 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string /// Options for controlling the operation. /// The transaction. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteDataTable(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteDataTable(cmdText, parameters, CommandType.Text, transaction); } /// @@ -145,8 +145,8 @@ public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string /// Options for controlling the operation. /// Type of the command. /// A DataTable. - public static DataTable SqlCeExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static DataTable ExecuteDataTable(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteDataTable(cmdText, parameters, commandType, null); + return @this.ExecuteDataTable(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteEntities.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteEntities.cs similarity index 74% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteEntities.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteEntities.cs index 347d6efe..84a0900c 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteEntities.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteEntities.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlServerCe; +using Z.Data.SQLite; public static partial class Extensions { @@ -21,7 +22,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) where T : new() { using (SqlCeCommand command = @this.CreateCommand()) { @@ -48,7 +49,7 @@ public static partial class Extensions /// The @this to act on. /// The command factory. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, Action commandFactory) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, Action commandFactory) where T : new() { using (SqlCeCommand command = @this.CreateCommand()) { @@ -68,9 +69,9 @@ public static partial class Extensions /// The @this to act on. /// The command text. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText) where T : new() { - return @this.SqlCeExecuteEntities(cmdText, null, CommandType.Text, null); + return @this.ExecuteEntities(cmdText, null, CommandType.Text, null); } /// @@ -81,9 +82,9 @@ public static partial class Extensions /// The command text. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) where T : new() { - return @this.SqlCeExecuteEntities(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteEntities(cmdText, null, CommandType.Text, transaction); } /// @@ -94,9 +95,9 @@ public static partial class Extensions /// The command text. /// Type of the command. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText, CommandType commandType) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText, CommandType commandType) where T : new() { - return @this.SqlCeExecuteEntities(cmdText, null, commandType, null); + return @this.ExecuteEntities(cmdText, null, commandType, null); } /// @@ -108,9 +109,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) where T : new() { - return @this.SqlCeExecuteEntities(cmdText, null, commandType, transaction); + return @this.ExecuteEntities(cmdText, null, commandType, transaction); } /// @@ -121,9 +122,9 @@ public static partial class Extensions /// The command text. /// Options for controlling the operation. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) where T : new() { - return @this.SqlCeExecuteEntities(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteEntities(cmdText, parameters, CommandType.Text, null); } /// @@ -135,9 +136,9 @@ public static partial class Extensions /// Options for controlling the operation. /// The transaction. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) where T : new() { - return @this.SqlCeExecuteEntities(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteEntities(cmdText, parameters, CommandType.Text, transaction); } /// @@ -149,8 +150,8 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// An enumerator that allows foreach to be used to process execute entities in this collection. - public static IEnumerable SqlCeExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) where T : new() + public static IEnumerable ExecuteEntities(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) where T : new() { - return @this.SqlCeExecuteEntities(cmdText, parameters, commandType, null); + return @this.ExecuteEntities(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteEntity.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteEntity.cs similarity index 73% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteEntity.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteEntity.cs index b0adda5c..4e7f359b 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteEntity.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteEntity.cs @@ -7,6 +7,7 @@ using System; using System.Data; using System.Data.SqlServerCe; +using Z.Data.SQLite; public static partial class Extensions { @@ -20,7 +21,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) where T : new() { using (SqlCeCommand command = @this.CreateCommand()) { @@ -48,7 +49,7 @@ public static partial class Extensions /// The @this to act on. /// The command factory. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, Action commandFactory) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, Action commandFactory) where T : new() { using (SqlCeCommand command = @this.CreateCommand()) { @@ -69,9 +70,9 @@ public static partial class Extensions /// The @this to act on. /// The command text. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText) where T : new() { - return @this.SqlCeExecuteEntity(cmdText, null, CommandType.Text, null); + return @this.ExecuteEntity(cmdText, null, CommandType.Text, null); } /// @@ -82,9 +83,9 @@ public static partial class Extensions /// The command text. /// The transaction. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) where T : new() { - return @this.SqlCeExecuteEntity(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteEntity(cmdText, null, CommandType.Text, transaction); } /// @@ -95,9 +96,9 @@ public static partial class Extensions /// The command text. /// Type of the command. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText, CommandType commandType) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText, CommandType commandType) where T : new() { - return @this.SqlCeExecuteEntity(cmdText, null, commandType, null); + return @this.ExecuteEntity(cmdText, null, commandType, null); } /// @@ -109,9 +110,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) where T : new() { - return @this.SqlCeExecuteEntity(cmdText, null, commandType, transaction); + return @this.ExecuteEntity(cmdText, null, commandType, transaction); } /// @@ -122,9 +123,9 @@ public static partial class Extensions /// The command text. /// Options for controlling the operation. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) where T : new() { - return @this.SqlCeExecuteEntity(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteEntity(cmdText, parameters, CommandType.Text, null); } /// @@ -136,9 +137,9 @@ public static partial class Extensions /// Options for controlling the operation. /// The transaction. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) where T : new() { - return @this.SqlCeExecuteEntity(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteEntity(cmdText, parameters, CommandType.Text, transaction); } /// @@ -150,8 +151,8 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// A T. - public static T SqlCeExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) where T : new() + public static T ExecuteEntity(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) where T : new() { - return @this.SqlCeExecuteEntity(cmdText, parameters, commandType, null); + return @this.ExecuteEntity(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteExpandoObject.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteExpandoObject.cs similarity index 71% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteExpandoObject.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteExpandoObject.cs index 1faf5292..08d3aad0 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteExpandoObject.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteExpandoObject.cs @@ -7,6 +7,7 @@ using System; using System.Data; using System.Data.SqlServerCe; +using Z.Data.SQLite; public static partial class Extensions { @@ -19,7 +20,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -46,7 +47,7 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, stri /// The @this to act on. /// The command factory. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, Action commandFactory) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -66,9 +67,9 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, Acti /// The @this to act on. /// The command text. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteExpandoObject(cmdText, null, CommandType.Text, null); + return @this.ExecuteExpandoObject(cmdText, null, CommandType.Text, null); } /// @@ -78,9 +79,9 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, stri /// The command text. /// The transaction. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteExpandoObject(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteExpandoObject(cmdText, null, CommandType.Text, transaction); } /// @@ -90,9 +91,9 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, stri /// The command text. /// Type of the command. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteExpandoObject(cmdText, null, commandType, null); + return @this.ExecuteExpandoObject(cmdText, null, commandType, null); } /// @@ -103,9 +104,9 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, stri /// Type of the command. /// The transaction. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteExpandoObject(cmdText, null, commandType, transaction); + return @this.ExecuteExpandoObject(cmdText, null, commandType, transaction); } /// @@ -115,9 +116,9 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, stri /// The command text. /// Options for controlling the operation. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteExpandoObject(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteExpandoObject(cmdText, parameters, CommandType.Text, null); } /// @@ -128,9 +129,9 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, stri /// Options for controlling the operation. /// The transaction. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteExpandoObject(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteExpandoObject(cmdText, parameters, CommandType.Text, transaction); } /// @@ -141,8 +142,8 @@ public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, stri /// Options for controlling the operation. /// Type of the command. /// A dynamic. - public static dynamic SqlCeExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static dynamic ExecuteExpandoObject(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteExpandoObject(cmdText, parameters, commandType, null); + return @this.ExecuteExpandoObject(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteExpandoObjects.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteExpandoObjects.cs similarity index 73% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteExpandoObjects.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteExpandoObjects.cs index 73b76751..f2fa183c 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteExpandoObjects.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteExpandoObjects.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlServerCe; +using Z.Data.SQLite; public static partial class Extensions { @@ -22,7 +23,7 @@ public static partial class Extensions /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -50,7 +51,7 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, Action commandFactory) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -71,9 +72,9 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteExpandoObjects(cmdText, null, CommandType.Text, null); + return @this.ExecuteExpandoObjects(cmdText, null, CommandType.Text, null); } /// @@ -85,9 +86,9 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteExpandoObjects(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteExpandoObjects(cmdText, null, CommandType.Text, transaction); } /// @@ -99,9 +100,9 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteExpandoObjects(cmdText, null, commandType, null); + return @this.ExecuteExpandoObjects(cmdText, null, commandType, null); } /// @@ -114,9 +115,9 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteExpandoObjects(cmdText, null, commandType, transaction); + return @this.ExecuteExpandoObjects(cmdText, null, commandType, transaction); } /// @@ -128,9 +129,9 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteExpandoObjects(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteExpandoObjects(cmdText, parameters, CommandType.Text, null); } /// @@ -143,9 +144,9 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteExpandoObjects(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteExpandoObjects(cmdText, parameters, CommandType.Text, transaction); } /// @@ -158,8 +159,8 @@ public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnecti /// /// An enumerator that allows foreach to be used to process execute expando objects in this collection. /// - public static IEnumerable SqlCeExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static IEnumerable ExecuteExpandoObjects(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteExpandoObjects(cmdText, parameters, commandType, null); + return @this.ExecuteExpandoObjects(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteNonQuery.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteNonQuery.cs similarity index 70% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteNonQuery.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteNonQuery.cs index e4d2508b..4f4f31c7 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteNonQuery.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteNonQuery.cs @@ -18,7 +18,7 @@ public static partial class Extensions /// Options for controlling the operation. /// Type of the command. /// The transaction. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -40,7 +40,7 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdTe /// /// The @this to act on. /// The command factory. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, Action commandFactory) + public static void ExecuteNonQuery(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -55,9 +55,9 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, Action /// The @this to act on. /// The command text. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText) { - @this.SqlCeExecuteNonQuery(cmdText, null, CommandType.Text, null); + @this.ExecuteNonQuery(cmdText, null, CommandType.Text, null); } /// @@ -66,9 +66,9 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdTe /// The @this to act on. /// The command text. /// The transaction. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - @this.SqlCeExecuteNonQuery(cmdText, null, CommandType.Text, transaction); + @this.ExecuteNonQuery(cmdText, null, CommandType.Text, transaction); } /// @@ -77,9 +77,9 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdTe /// The @this to act on. /// The command text. /// Type of the command. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText, CommandType commandType) { - @this.SqlCeExecuteNonQuery(cmdText, null, commandType, null); + @this.ExecuteNonQuery(cmdText, null, commandType, null); } /// @@ -89,9 +89,9 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdTe /// The command text. /// Type of the command. /// The transaction. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - @this.SqlCeExecuteNonQuery(cmdText, null, commandType, transaction); + @this.ExecuteNonQuery(cmdText, null, commandType, transaction); } /// @@ -100,9 +100,9 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdTe /// The @this to act on. /// The command text. /// Options for controlling the operation. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - @this.SqlCeExecuteNonQuery(cmdText, parameters, CommandType.Text, null); + @this.ExecuteNonQuery(cmdText, parameters, CommandType.Text, null); } /// @@ -112,9 +112,9 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// The transaction. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - @this.SqlCeExecuteNonQuery(cmdText, parameters, CommandType.Text, transaction); + @this.ExecuteNonQuery(cmdText, parameters, CommandType.Text, transaction); } /// @@ -124,8 +124,8 @@ public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// Type of the command. - public static void SqlCeExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static void ExecuteNonQuery(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - @this.SqlCeExecuteNonQuery(cmdText, parameters, commandType, null); + @this.ExecuteNonQuery(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteReader.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteReader.cs similarity index 71% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteReader.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteReader.cs index 11be75ff..9ef7c6cf 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteReader.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteReader.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -42,7 +42,7 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, str /// The @this to act on. /// The command factory. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, Action commandFactory) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -58,9 +58,9 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, Act /// The @this to act on. /// The command text. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteReader(cmdText, null, CommandType.Text, null); + return @this.ExecuteReader(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, str /// The command text. /// The transaction. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteReader(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteReader(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, str /// The command text. /// Type of the command. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteReader(cmdText, null, commandType, null); + return @this.ExecuteReader(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, str /// Type of the command. /// The transaction. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteReader(cmdText, null, commandType, transaction); + return @this.ExecuteReader(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, str /// The command text. /// Options for controlling the operation. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteReader(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteReader(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, str /// Options for controlling the operation. /// The transaction. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteReader(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteReader(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, str /// Options for controlling the operation. /// Type of the command. /// A SqlCeDataReader. - public static SqlCeDataReader SqlCeExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static SqlCeDataReader ExecuteReader(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteReader(cmdText, parameters, commandType, null); + return @this.ExecuteReader(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalarAs.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalar.cs similarity index 68% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalarAs.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalar.cs index 87fdb243..ac210308 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalarAs.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalar.cs @@ -19,9 +19,9 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { - using (SqlCeCommand command = @this.CreateCommand()) + using (var command = @this.CreateCommand()) { command.CommandText = cmdText; command.CommandType = commandType; @@ -32,7 +32,7 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe command.Parameters.AddRange(parameters); } - return (T) command.ExecuteScalar(); + return command.ExecuteScalar(); } } @@ -42,13 +42,13 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe /// The @this to act on. /// The command factory. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, Action commandFactory) + public static object ExecuteScalar(this SqlCeConnection @this, Action commandFactory) { - using (SqlCeCommand command = @this.CreateCommand()) + using (var command = @this.CreateCommand()) { commandFactory(command); - return (T) command.ExecuteScalar(); + return command.ExecuteScalar(); } } @@ -58,9 +58,9 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteScalarAs(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalar(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe /// The command text. /// The transaction. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalarAs(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalar(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe /// The command text. /// Type of the command. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteScalarAs(cmdText, null, commandType, null); + return @this.ExecuteScalar(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe /// Type of the command. /// The transaction. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalarAs(cmdText, null, commandType, transaction); + return @this.ExecuteScalar(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteScalarAs(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalar(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe /// Options for controlling the operation. /// The transaction. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalarAs(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalar(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdTe /// Options for controlling the operation. /// Type of the command. /// An object. - public static T SqlCeExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static object ExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteScalarAs(cmdText, parameters, commandType, null); + return @this.ExecuteScalar(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalar.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalarAs.cs similarity index 72% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalar.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalarAs.cs index d31d2cdf..9e585851 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalar.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalarAs.cs @@ -19,7 +19,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -32,7 +32,7 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe command.Parameters.AddRange(parameters); } - return command.ExecuteScalar(); + return (T) command.ExecuteScalar(); } } @@ -42,13 +42,13 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe /// The @this to act on. /// The command factory. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, Action commandFactory) + public static T ExecuteScalarAs(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { commandFactory(command); - return command.ExecuteScalar(); + return (T) command.ExecuteScalar(); } } @@ -58,9 +58,9 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteScalar(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalarAs(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +70,9 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe /// The command text. /// The transaction. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalar(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalarAs(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +82,9 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe /// The command text. /// Type of the command. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteScalar(cmdText, null, commandType, null); + return @this.ExecuteScalarAs(cmdText, null, commandType, null); } /// @@ -95,9 +95,9 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe /// Type of the command. /// The transaction. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalar(cmdText, null, commandType, transaction); + return @this.ExecuteScalarAs(cmdText, null, commandType, transaction); } /// @@ -107,9 +107,9 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteScalar(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalarAs(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +120,9 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe /// Options for controlling the operation. /// The transaction. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalar(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalarAs(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +133,8 @@ public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdTe /// Options for controlling the operation. /// Type of the command. /// An object. - public static object SqlCeExecuteScalar(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static T ExecuteScalarAs(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteScalar(cmdText, parameters, commandType, null); + return @this.ExecuteScalarAs(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalarTo.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalarTo.cs similarity index 71% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalarTo.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalarTo.cs index 29d7f4cb..b423ba39 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.SqlCeExecuteScalarTo.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeConnection/SqlCeConnection.ExecuteScalarTo.cs @@ -7,6 +7,7 @@ using System; using System.Data; using System.Data.SqlServerCe; +using Z.Data.SQLite; public static partial class Extensions { @@ -19,7 +20,7 @@ public static partial class Extensions /// Type of the command. /// The transaction. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType, SqlCeTransaction transaction) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -42,7 +43,7 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdTe /// The @this to act on. /// The command factory. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, Action commandFactory) + public static T ExecuteScalarTo(this SqlCeConnection @this, Action commandFactory) { using (SqlCeCommand command = @this.CreateCommand()) { @@ -58,9 +59,9 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, ActionThe @this to act on. /// The command text. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText) { - return @this.SqlCeExecuteScalarTo(cmdText, null, CommandType.Text, null); + return @this.ExecuteScalarTo(cmdText, null, CommandType.Text, null); } /// @@ -70,9 +71,9 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdTe /// The command text. /// The transaction. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalarTo(cmdText, null, CommandType.Text, transaction); + return @this.ExecuteScalarTo(cmdText, null, CommandType.Text, transaction); } /// @@ -82,9 +83,9 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdTe /// The command text. /// Type of the command. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText, CommandType commandType) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText, CommandType commandType) { - return @this.SqlCeExecuteScalarTo(cmdText, null, commandType, null); + return @this.ExecuteScalarTo(cmdText, null, commandType, null); } /// @@ -95,9 +96,9 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdTe /// Type of the command. /// The transaction. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText, CommandType commandType, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalarTo(cmdText, null, commandType, transaction); + return @this.ExecuteScalarTo(cmdText, null, commandType, transaction); } /// @@ -107,9 +108,9 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdTe /// The command text. /// Options for controlling the operation. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters) { - return @this.SqlCeExecuteScalarTo(cmdText, parameters, CommandType.Text, null); + return @this.ExecuteScalarTo(cmdText, parameters, CommandType.Text, null); } /// @@ -120,9 +121,9 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdTe /// Options for controlling the operation. /// The transaction. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, SqlCeTransaction transaction) { - return @this.SqlCeExecuteScalarTo(cmdText, parameters, CommandType.Text, transaction); + return @this.ExecuteScalarTo(cmdText, parameters, CommandType.Text, transaction); } /// @@ -133,8 +134,8 @@ public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdTe /// Options for controlling the operation. /// Type of the command. /// An object. - public static T SqlCeExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) + public static T ExecuteScalarTo(this SqlCeConnection @this, string cmdText, SqlCeParameter[] parameters, CommandType commandType) { - return @this.SqlCeExecuteScalarTo(cmdText, parameters, commandType, null); + return @this.ExecuteScalarTo(cmdText, parameters, commandType, null); } } \ No newline at end of file diff --git a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeParameterCollection/SqlCeParameterCollection.SqlCeAddRangeWithValue.cs b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeParameterCollection/SqlCeParameterCollection.AddRangeWithValue.cs similarity index 88% rename from src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeParameterCollection/SqlCeParameterCollection.SqlCeAddRangeWithValue.cs rename to src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeParameterCollection/SqlCeParameterCollection.AddRangeWithValue.cs index 8792df6e..8f7cc15d 100644 --- a/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeParameterCollection/SqlCeParameterCollection.SqlCeAddRangeWithValue.cs +++ b/src/Z.Data.SqlServerCe/System.Data.SqlServerCe.SqlCeParameterCollection/SqlCeParameterCollection.AddRangeWithValue.cs @@ -14,7 +14,7 @@ public static partial class Extensions /// /// The @this to act on. /// The values. - public static void SqlCeAddRangeWithValue(this SqlCeParameterCollection @this, Dictionary values) + public static void AddRangeWithValue(this SqlCeParameterCollection @this, Dictionary values) { foreach (var keyValuePair in values) { diff --git a/src/Z.Data.SqlServerCe/Z.Data.SqlServerCe.csproj b/src/Z.Data.SqlServerCe/Z.Data.SqlServerCe.csproj index 4cc7f4fe..38b995a7 100644 --- a/src/Z.Data.SqlServerCe/Z.Data.SqlServerCe.csproj +++ b/src/Z.Data.SqlServerCe/Z.Data.SqlServerCe.csproj @@ -72,30 +72,26 @@ - - - - - - - - - - - - - - - - - - {02f009f8-720b-4cbd-98ff-f2c33f4441d5} - Z.Core - - - {6edebb64-2d4b-43cc-a94e-919b44e254a2} - Z.Data - + + + + + + + + + + + + + + + + + + + +