From 39c724610d55687b1ba138d8611f9fe4f4e5923d Mon Sep 17 00:00:00 2001 From: RohitM-IN Date: Sat, 3 Feb 2024 18:06:30 +0530 Subject: [PATCH] removed IDataContract Interface dependency --- src/QueryGenerator.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/QueryGenerator.cs b/src/QueryGenerator.cs index 6b05f42..eec8368 100644 --- a/src/QueryGenerator.cs +++ b/src/QueryGenerator.cs @@ -44,7 +44,7 @@ public QueryGenerator() /// Optional schema name, default is 'public'. /// Select Query in string. /// Thrown when table name or columns are null or empty. - public string GenerateSelectQuery(string tableName, List listOfColumns, string schemaName) where T : IDataContract + public string GenerateSelectQuery(string tableName, List listOfColumns, string schemaName) { if (string.IsNullOrEmpty(tableName) || listOfColumns == null || listOfColumns.Count == 0) { @@ -78,7 +78,7 @@ public string GenerateSelectQuery(string tableName, List listOfColumn /// List of excluded columns. /// Dictionary of edited properties. /// Update Query in string. - public string GenerateUpdateQuery(T DataContract, List keyColumns, List excludedColumns, (string propName, object propValue)[] editedProperties) where T : IDataContract + public string GenerateUpdateQuery(T DataContract, List keyColumns, List excludedColumns, (string propName, object propValue)[] editedProperties) { string tableName = GetTableName(); string schemaName = GetTableSchema() ?? DEFAULT_SCHEMA_NAME; @@ -101,7 +101,7 @@ public string GenerateUpdateQuery(T DataContract, List keyColumns, Li /// The entity to be deleted. /// List of key columns. /// Delete Query in string. - public string GenerateDeleteQuery(T entity, List keyColumns) where T : IDataContract + public string GenerateDeleteQuery(T entity, List keyColumns) { string tableName = GetTableName(); string schemaName = GetTableSchema() ?? DEFAULT_SCHEMA_NAME; @@ -123,7 +123,7 @@ public string GenerateDeleteQuery(T entity, List keyColumns) where T /// List of key columns. /// List of excluded columns. /// Insert Query in string. - public string GenerateInsertQuery(T entity, List keyColumns, List excludedColumns) where T : IDataContract + public string GenerateInsertQuery(T entity, List keyColumns, List excludedColumns) { string tableName = GetTableName(); string schemaName = GetTableSchema() ?? DEFAULT_SCHEMA_NAME; @@ -183,11 +183,10 @@ public void Dispose() /// /// Generates a SQL WHERE clause based on the specified entity and key columns. /// - /// The type of the entity that implements IDataContract. /// The entity for which the condition is generated. /// The list of key columns used to create the condition. /// A string representing the SQL WHERE clause based on the key columns of the entity. - public List GetCondition(T entity, List keyColumns) where T : IDataContract + public List GetCondition(T entity, List keyColumns) { Type entityType = typeof(T); PropertyInfo[] keyProperties = GetKeyProperties();