Skip to content

Commit 39c7246

Browse files
committed
removed IDataContract Interface dependency
1 parent 03dff52 commit 39c7246

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/QueryGenerator.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public QueryGenerator()
4444
/// <param name="schemaName">Optional schema name, default is 'public'.</param>
4545
/// <returns>Select Query in string.</returns>
4646
/// <exception cref="ArgumentException">Thrown when table name or columns are null or empty.</exception>
47-
public string GenerateSelectQuery<T>(string tableName, List<string> listOfColumns, string schemaName) where T : IDataContract
47+
public string GenerateSelectQuery<T>(string tableName, List<string> listOfColumns, string schemaName)
4848
{
4949
if (string.IsNullOrEmpty(tableName) || listOfColumns == null || listOfColumns.Count == 0)
5050
{
@@ -78,7 +78,7 @@ public string GenerateSelectQuery<T>(string tableName, List<string> listOfColumn
7878
/// <param name="excludedColumns">List of excluded columns.</param>
7979
/// <param name="editedProperties">Dictionary of edited properties.</param>
8080
/// <returns>Update Query in string.</returns>
81-
public string GenerateUpdateQuery<T>(T DataContract, List<string> keyColumns, List<string> excludedColumns, (string propName, object propValue)[] editedProperties) where T : IDataContract
81+
public string GenerateUpdateQuery<T>(T DataContract, List<string> keyColumns, List<string> excludedColumns, (string propName, object propValue)[] editedProperties)
8282
{
8383
string tableName = GetTableName<T>();
8484
string schemaName = GetTableSchema<T>() ?? DEFAULT_SCHEMA_NAME;
@@ -101,7 +101,7 @@ public string GenerateUpdateQuery<T>(T DataContract, List<string> keyColumns, Li
101101
/// <param name="entity">The entity to be deleted.</param>
102102
/// <param name="keyColumns">List of key columns.</param>
103103
/// <returns>Delete Query in string.</returns>
104-
public string GenerateDeleteQuery<T>(T entity, List<string> keyColumns) where T : IDataContract
104+
public string GenerateDeleteQuery<T>(T entity, List<string> keyColumns)
105105
{
106106
string tableName = GetTableName<T>();
107107
string schemaName = GetTableSchema<T>() ?? DEFAULT_SCHEMA_NAME;
@@ -123,7 +123,7 @@ public string GenerateDeleteQuery<T>(T entity, List<string> keyColumns) where T
123123
/// <param name="keyColumns">List of key columns.</param>
124124
/// <param name="excludedColumns">List of excluded columns.</param>
125125
/// <returns>Insert Query in string.</returns>
126-
public string GenerateInsertQuery<T>(T entity, List<string> keyColumns, List<string> excludedColumns) where T : IDataContract
126+
public string GenerateInsertQuery<T>(T entity, List<string> keyColumns, List<string> excludedColumns)
127127
{
128128
string tableName = GetTableName<T>();
129129
string schemaName = GetTableSchema<T>() ?? DEFAULT_SCHEMA_NAME;
@@ -183,11 +183,10 @@ public void Dispose()
183183
/// <summary>
184184
/// Generates a SQL WHERE clause based on the specified entity and key columns.
185185
/// </summary>
186-
/// <typeparam name="T">The type of the entity that implements IDataContract.</typeparam>
187186
/// <param name="entity">The entity for which the condition is generated.</param>
188187
/// <param name="keyColumns">The list of key columns used to create the condition.</param>
189188
/// <returns>A string representing the SQL WHERE clause based on the key columns of the entity.</returns>
190-
public List<string> GetCondition<T>(T entity, List<string> keyColumns) where T : IDataContract
189+
public List<string> GetCondition<T>(T entity, List<string> keyColumns)
191190
{
192191
Type entityType = typeof(T);
193192
PropertyInfo[] keyProperties = GetKeyProperties<T>();

0 commit comments

Comments
 (0)