1
- using System . Collections . Generic ;
2
- using System . Reflection ;
1
+ using System . Reflection ;
3
2
using System . Text ;
4
3
using DbSyncKit . DB . Helper ;
5
- using DbSyncKit . DB . Interface ;
4
+ using DbSyncKit . Templates . Interface ;
6
5
using DbSyncKit . Templates . MySql ;
7
6
using Fluid ;
8
7
@@ -81,7 +80,7 @@ public string GenerateComment(string comment)
81
80
/// <param name="entity">The entity object.</param>
82
81
/// <param name="keyColumns">The list of key columns for deletion.</param>
83
82
/// <returns>The generated SQL delete query.</returns>
84
- public string GenerateDeleteQuery < T > ( T entity , List < string > keyColumns ) where T : IDataContract
83
+ public string GenerateDeleteQuery < T > ( T entity , List < string > keyColumns )
85
84
{
86
85
87
86
string tableName = GetTableName < T > ( ) ;
@@ -103,7 +102,7 @@ public string GenerateDeleteQuery<T>(T entity, List<string> keyColumns) where T
103
102
/// <param name="keyColumns">The list of key columns for insertion.</param>
104
103
/// <param name="excludedColumns">The list of columns to exclude from insertion.</param>
105
104
/// <returns>The generated SQL insert query.</returns>
106
- public string GenerateInsertQuery < T > ( T entity , List < string > keyColumns , List < string > excludedColumns ) where T : IDataContract
105
+ public string GenerateInsertQuery < T > ( T entity , List < string > keyColumns , List < string > excludedColumns )
107
106
{
108
107
string tableName = GetTableName < T > ( ) ;
109
108
string schemaName = GetTableSchema < T > ( ) ?? DEFAULT_SCHEMA_NAME ;
@@ -137,7 +136,7 @@ public string GenerateInsertQuery<T>(T entity, List<string> keyColumns, List<str
137
136
/// <param name="ListOfColumns">The list of columns to select.</param>
138
137
/// <param name="schemaName">The schema name (if applicable).</param>
139
138
/// <returns>The generated SQL select query.</returns>
140
- public string GenerateSelectQuery < T > ( string tableName , List < string > ListOfColumns , string schemaName ) where T : IDataContract
139
+ public string GenerateSelectQuery < T > ( string tableName , List < string > ListOfColumns , string schemaName )
141
140
{
142
141
if ( string . IsNullOrEmpty ( tableName ) || ListOfColumns == null || ListOfColumns . Count == 0 )
143
142
{
@@ -166,7 +165,7 @@ public string GenerateSelectQuery<T>(string tableName, List<string> ListOfColumn
166
165
/// <param name="excludedColumns">The list of columns to exclude from update.</param>
167
166
/// <param name="editedProperties">The dictionary containing edited properties.</param>
168
167
/// <returns>The generated SQL update query.</returns>
169
- public string GenerateUpdateQuery < T > ( T DataContract , List < string > keyColumns , List < string > excludedColumns , ( string propName , object propValue ) [ ] editedProperties ) where T : IDataContract
168
+ public string GenerateUpdateQuery < T > ( T DataContract , List < string > keyColumns , List < string > excludedColumns , ( string propName , object propValue ) [ ] editedProperties )
170
169
{
171
170
string tableName = GetTableName < T > ( ) ;
172
171
@@ -188,7 +187,7 @@ public string GenerateUpdateQuery<T>(T DataContract, List<string> keyColumns, Li
188
187
/// <param name="entity">The entity object.</param>
189
188
/// <param name="keyColumns">The list of key columns for the condition.</param>
190
189
/// <returns>The generated SQL condition.</returns>
191
- public List < string > GetCondition < T > ( T entity , List < string > keyColumns ) where T : IDataContract
190
+ public List < string > GetCondition < T > ( T entity , List < string > keyColumns )
192
191
{
193
192
Type entityType = typeof ( T ) ;
194
193
PropertyInfo [ ] keyProperties = GetKeyProperties < T > ( ) ;
0 commit comments