Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef7ac54e36 | ||
|
|
83dc8d6045 | ||
|
|
ff6fb08a08 | ||
|
|
d2900f364d | ||
|
|
b014c2f392 | ||
|
|
0ad7221680 | ||
|
|
36da32f870 | ||
|
|
d8c9867e50 | ||
|
|
166956f10f | ||
|
|
ddb7f6dc89 | ||
|
|
06aa7969bf |
@@ -16,7 +16,7 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System.Attributes
|
|||||||
/// <param name="dbAttributeName">Name of database-attribute (case-sensitivity is determined from database-attribute-settings) ['null' if the same as field-name]</param>
|
/// <param name="dbAttributeName">Name of database-attribute (case-sensitivity is determined from database-attribute-settings) ['null' if the same as field-name]</param>
|
||||||
public DbAttribute(string attributeName = null)
|
public DbAttribute(string attributeName = null)
|
||||||
{
|
{
|
||||||
this._attributeName = attributeName;
|
this._attributeName = attributeName; // Todo: Automatic resolving of name if it is null (?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace eu.railduction.netcore.dll.Database_Attribute_System.Attributes
|
namespace eu.railduction.netcore.dll.Database_Attribute_System.Attributes
|
||||||
@@ -10,16 +11,33 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System.Attributes
|
|||||||
{
|
{
|
||||||
public Type _classType;
|
public Type _classType;
|
||||||
public string _attributeName;
|
public string _attributeName;
|
||||||
|
public string _foreignKeyFieldName;
|
||||||
|
public FieldInfo _foreignKeyField;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marks variable as foreignKey of given class
|
/// Marks variable as foreignKey of given class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="classType">Type of class to which this is the ForeignKey</param>
|
/// <param name="classType">Type of class to which this is the ForeignKey</param>
|
||||||
/// <param name="dbAttributeName">Name of database-attribute (case-sensitivity is determined from database-attribute-settings) ['null' if the same as field-name]</param>
|
/// <param name="dbAttributeName">Name of database-attribute (case-sensitivity is determined from database-attribute-settings) ['null' if the same as field-name]</param>
|
||||||
public DbForeignKey(Type classType, string attributeName = null)
|
/// <param name="foreignKeyFieldName">Name of foreignKey-fieldName ['null' if the same as classType-name]</param>
|
||||||
|
public DbForeignKey(Type classType, string foreignKeyFieldName = null, string attributeName = null)
|
||||||
{
|
{
|
||||||
this._classType = classType;
|
this._classType = classType;
|
||||||
this._attributeName = attributeName;
|
this._attributeName = attributeName; // Todo: Automatic resolving of name if it is null (?)
|
||||||
|
|
||||||
|
bool fieldFound = false;
|
||||||
|
foreach (System.Reflection.FieldInfo fi in classType.GetRuntimeFields())
|
||||||
|
{
|
||||||
|
if(fi.Name.ToLower() == foreignKeyFieldName.ToLower())
|
||||||
|
{
|
||||||
|
this._foreignKeyFieldName = fi.Name;
|
||||||
|
this._foreignKeyField = fi;
|
||||||
|
|
||||||
|
fieldFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!fieldFound) throw new InvalidOperationException($"Field with name='{foreignKeyFieldName}' not found in {classType.Name}.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System.Attributes
|
|||||||
/// <param name="tableName">Name of database-table (case-sensitivity is determined from database-table-settings) ['null' if the same as class-name]</param>
|
/// <param name="tableName">Name of database-table (case-sensitivity is determined from database-table-settings) ['null' if the same as class-name]</param>
|
||||||
public DbObject(string tableName = null)
|
public DbObject(string tableName = null)
|
||||||
{
|
{
|
||||||
this._tableName = tableName;
|
this._tableName = tableName; // Todo: Automatic resolving of name if it is null (?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System.Attributes
|
|||||||
/// <param name="dbAttributeName">Name of database-attribute (case-sensitivity is determined from database-attribute-settings) ['null' if the same as field-name]</param>
|
/// <param name="dbAttributeName">Name of database-attribute (case-sensitivity is determined from database-attribute-settings) ['null' if the same as field-name]</param>
|
||||||
public DbPrimaryKey(string attributeName = null)
|
public DbPrimaryKey(string attributeName = null)
|
||||||
{
|
{
|
||||||
this._attributeName = attributeName;
|
this._attributeName = attributeName; // Todo: Automatic resolving of name if it is null (?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using eu.railduction.netcore.dll.Database_Attribute_System.Attributes;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -22,7 +23,7 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
string tableName = Function.GetDbTableName(classType);
|
string tableName = Function.GetDbTableName(classType);
|
||||||
|
|
||||||
// Get class-fields
|
// Get class-fields
|
||||||
Dictionary<string, FieldInfo> dbFields = Function.ReadDbClassFields(classObject);
|
Dictionary<string, FieldInfo> dbFields = Function.ReadDbClassFields(classType);
|
||||||
|
|
||||||
if (runDataLossChecks)
|
if (runDataLossChecks)
|
||||||
{
|
{
|
||||||
@@ -57,9 +58,6 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
// Iterate through data
|
// Iterate through data
|
||||||
foreach (KeyValuePair<string, object> data_keySet in data)
|
foreach (KeyValuePair<string, object> data_keySet in data)
|
||||||
{
|
{
|
||||||
// If the data was set
|
|
||||||
bool dataIsSet = false;
|
|
||||||
|
|
||||||
// Interate through class-fields
|
// Interate through class-fields
|
||||||
foreach (KeyValuePair<string, FieldInfo> field_keySet in dbFields)
|
foreach (KeyValuePair<string, FieldInfo> field_keySet in dbFields)
|
||||||
{
|
{
|
||||||
@@ -67,7 +65,6 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
if (field_keySet.Key.ToLower() == data_keySet.Key.ToLower())
|
if (field_keySet.Key.ToLower() == data_keySet.Key.ToLower())
|
||||||
{
|
{
|
||||||
field_keySet.Value.SetValue(classObject, data_keySet.Value);
|
field_keySet.Value.SetValue(classObject, data_keySet.Value);
|
||||||
dataIsSet = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,21 +73,90 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolves an object with the database<para/>
|
/// Gets an dbObject
|
||||||
/// Needs to have primaryKey/s set!<para/>
|
|
||||||
/// - Generates an query<para/>
|
|
||||||
/// - Sends an query via Func<para/>
|
|
||||||
/// - Fills the object with data
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
/// <param name="classObject">Given object (marked with Db-attributes)</param>
|
/// <param name="classObject">Given object (marked with Db-attributes)</param>
|
||||||
/// <param name="queryExecutor">Function to handle query-calls - Has to return Dictionary[attributeName, attributeValue]</param>
|
/// <param name="queryExecutor">Function to handle query-calls - Has to return Dictionary[attributeName, attributeValue]</param>
|
||||||
/// <param name="runDataLossChecks">This checks if any class-field and data-attribute does not exists in either (Slower)</param>
|
/// <param name="runDataLossChecks">This checks if any class-field and data-attribute does not exists in either (Slower)</param>
|
||||||
public static void ResolveByPrimaryKey<T>(T classObject, Func<string, Dictionary<string, object>> queryExecutor, bool runDataLossChecks = true)
|
public static T GetByPrimaryKey<T>(Type classType, Func<string, List<Dictionary<string, object>>> queryExecutor, bool runDataLossChecks = true) where T: new()
|
||||||
{
|
{
|
||||||
string query = QueryBuilder.SelectByPrimaryKey(classObject);
|
T obj = new T();
|
||||||
Dictionary<string, object> data = queryExecutor(query);
|
|
||||||
FillObject(classObject, data, runDataLossChecks);
|
string query = QueryBuilder.SelectByPrimaryKey(obj); // Generate query
|
||||||
|
List<Dictionary<string, object>> dataSet = queryExecutor(query); // Execute
|
||||||
|
FillObject(obj, dataSet[0], runDataLossChecks); // Fill the object
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of dbObjects by attribute/s
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="classType">Type of class</param>
|
||||||
|
/// <param name="fields">class-fields for select</param>
|
||||||
|
/// <param name="queryExecutor">Function to handle query-calls - Has to return Dictionary[attributeName, attributeValue]</param>
|
||||||
|
/// <param name="runDataLossChecks">This checks if any class-field and data-attribute does not exists in either (Slower)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static List<T> GetListByAttribute<T>(Type classType, Dictionary<string, object> fields, Func<string, List<Dictionary<string, object>>> queryExecutor, bool runDataLossChecks = true) where T : new()
|
||||||
|
{
|
||||||
|
string tableName = Function.GetDbTableName(classType); // Get database-tableName
|
||||||
|
|
||||||
|
Function.ConvertAttributeToDbAttributes(classType, fields);
|
||||||
|
|
||||||
|
string query = QueryBuilder.SelectByAttribute(tableName, fields); // Generate query
|
||||||
|
List<Dictionary<string, object>> dataSet = queryExecutor(query); // Execute
|
||||||
|
|
||||||
|
List<T> objs = new List<T>() { };
|
||||||
|
foreach(Dictionary<string, object> data in dataSet)
|
||||||
|
{
|
||||||
|
T obj = new T(); // New object
|
||||||
|
FillObject(obj, data, runDataLossChecks); // Fill it
|
||||||
|
objs.Add(obj); // Add to list
|
||||||
|
}
|
||||||
|
|
||||||
|
return objs; // Return list
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resolves all foreignKeys with the database
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="classObject">Given object (marked with Db-attributes)</param>
|
||||||
|
/// <param name="queryExecutor">Function to handle query-calls - Has to return Dictionary[attributeName, attributeValue]</param>
|
||||||
|
/// <param name="max_depth">Determents how deep resolving will be executed</param>
|
||||||
|
/// <param name="runDataLossChecks">This checks if any class-field and data-attribute does not exists in either (Slower)</param>
|
||||||
|
public static void ResolveForeignKeys<T>(T classObject, Func<string, List<Dictionary<string, object>>> queryExecutor, int max_depth = 1, bool runDataLossChecks = true) where T: new()
|
||||||
|
{
|
||||||
|
Type classType = classObject.GetType();
|
||||||
|
|
||||||
|
// Get class-fields
|
||||||
|
Dictionary<string, FieldInfo> dbFields = Function.ReadDbClassFields(classType);
|
||||||
|
|
||||||
|
foreach (KeyValuePair<string, FieldInfo> dbField in dbFields)
|
||||||
|
{
|
||||||
|
// If field is foreignKey
|
||||||
|
if (dbField.Value.GetCustomAttribute(typeof(DbForeignKey), true) is DbForeignKey fkey)
|
||||||
|
{
|
||||||
|
FieldInfo f_Field = fkey._foreignKeyField;
|
||||||
|
object f_value = f_Field.GetValue(classObject);
|
||||||
|
|
||||||
|
// When its empty, get it
|
||||||
|
if(f_value == null)
|
||||||
|
{
|
||||||
|
f_value = GetByPrimaryKey<T>(classType, queryExecutor, runDataLossChecks); ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recursive resolving
|
||||||
|
if (max_depth - 1 > 0)
|
||||||
|
{
|
||||||
|
ResolveForeignKeys(f_value, queryExecutor, max_depth - 1, runDataLossChecks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<RootNamespace>eu.railduction.netcore.dll.Database_Attribute_System</RootNamespace>
|
<RootNamespace>eu.railduction.netcore.dll.Database_Attribute_System</RootNamespace>
|
||||||
<SignAssembly>false</SignAssembly>
|
<SignAssembly>false</SignAssembly>
|
||||||
|
<Version>1.4</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
public class QueryBuilder
|
public class QueryBuilder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds an SELECT-Sql-query based on an object<para/>
|
/// Builds an SELECT-Sql-query based on an object
|
||||||
/// Object needs to have at least 1 primary-key!
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
/// <param name="classObject">Given object (marked with Db-attributes)</param>
|
/// <param name="classObject">Given object (marked with Db-attributes)</param>
|
||||||
|
/// <param name="tableName">The db-table-name</param>
|
||||||
/// <returns>SELECT-Sql-query</returns>
|
/// <returns>SELECT-Sql-query</returns>
|
||||||
public static string SelectByPrimaryKey<T>(T classObject)
|
public static string SelectByPrimaryKey<T>(T classObject)
|
||||||
{
|
{
|
||||||
@@ -28,11 +28,33 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
Function.ReadDbClassFields(classObject, ref dbPrimaryKeys, ref dbAttributes, ref dbForeignKeys);
|
Function.ReadDbClassFields(classObject, ref dbPrimaryKeys, ref dbAttributes, ref dbForeignKeys);
|
||||||
if (dbPrimaryKeys.Count == 0) throw new InvalidOperationException($"Cannot generate SQL-Query of '{classType.Name}'. No primary-key/s found!");
|
if (dbPrimaryKeys.Count == 0) throw new InvalidOperationException($"Cannot generate SQL-Query of '{classType.Name}'. No primary-key/s found!");
|
||||||
|
|
||||||
// Build where statements with primaryKey/s
|
return SelectByAttribute(tableName, dbPrimaryKeys);
|
||||||
object[] param = DbFunction.BuildKeyEqualQuery(dbPrimaryKeys, " AND ");
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builds an SELECT-Sql-query based on an object<para/>
|
||||||
|
/// Object needs to have at least 1 attribute!
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
/// <param name="tableName">The db-table-name</param>
|
||||||
|
/// <param name="dbAttributes">The db-attributes with dbAttribute-name and value<para/>If null is given, it will generate a default 'SELECT * FROM tableName'</param>
|
||||||
|
/// <returns>SELECT-Sql-query</returns>
|
||||||
|
public static string SelectByAttribute(string tableName, Dictionary<string, object> dbAttributes = null)
|
||||||
|
{
|
||||||
|
object[] param = new object[1];
|
||||||
|
if (dbAttributes != null)
|
||||||
|
{
|
||||||
|
// Build where statements with primaryKey/s
|
||||||
|
param = DbFunction.BuildKeyEqualQuery(dbAttributes, " AND ");
|
||||||
|
}
|
||||||
|
|
||||||
|
string sqlCmd = $"SELECT * FROM {tableName}";
|
||||||
// Add SQL-command part
|
// Add SQL-command part
|
||||||
param[0] = $"SELECT * FROM {tableName} WHERE "+ param[0];
|
if (dbAttributes != null)
|
||||||
|
param[0] = $"{sqlCmd} WHERE {param[0]}";
|
||||||
|
else
|
||||||
|
param[0] = sqlCmd;
|
||||||
|
|
||||||
// Build and return the query
|
// Build and return the query
|
||||||
return BuildQuery(param);
|
return BuildQuery(param);
|
||||||
}
|
}
|
||||||
@@ -99,15 +121,32 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
Function.ReadDbClassFields(classObject, ref dbPrimaryKeys, ref dbAttributes, ref dbForeignKeys);
|
Function.ReadDbClassFields(classObject, ref dbPrimaryKeys, ref dbAttributes, ref dbForeignKeys);
|
||||||
if (dbPrimaryKeys.Count == 0) throw new InvalidOperationException($"Cannot generate SQL-Query of '{classType.Name}'. No primary-key/s found!");
|
if (dbPrimaryKeys.Count == 0) throw new InvalidOperationException($"Cannot generate SQL-Query of '{classType.Name}'. No primary-key/s found!");
|
||||||
|
|
||||||
// Build where-parameters
|
// Build and return the query
|
||||||
object[] paramWhere = DbFunction.BuildKeyEqualQuery(dbPrimaryKeys, " AND ");
|
return DeleteByAttribute(tableName, dbPrimaryKeys);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string DeleteByAttribute(string tableName, Dictionary<string, object> dbAttributes = null)
|
||||||
|
{
|
||||||
|
object[] param = new object[1];
|
||||||
|
if (dbAttributes != null)
|
||||||
|
{
|
||||||
|
// Build where statements with primaryKey/s
|
||||||
|
param = DbFunction.BuildKeyEqualQuery(dbAttributes, " AND ");
|
||||||
|
}
|
||||||
|
|
||||||
|
string sqlCmd = $"DELETE FROM {tableName}";
|
||||||
// Add SQL-command part
|
// Add SQL-command part
|
||||||
paramWhere[0] = $"DELETE FROM {tableName} WHERE "+ paramWhere[0];
|
if (dbAttributes != null)
|
||||||
|
param[0] = $"{sqlCmd} WHERE {param[0]}";
|
||||||
|
else
|
||||||
|
param[0] = sqlCmd;
|
||||||
|
|
||||||
// Build and return the query
|
// Build and return the query
|
||||||
return BuildQuery(paramWhere);
|
return BuildQuery(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -31,6 +31,52 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static void ConvertAttributeToDbAttributes(Type classType, Dictionary<string, object> attributeNameAndValues)
|
||||||
|
{
|
||||||
|
Dictionary<string, FieldInfo> classFields = ReadDbClassFields(classType);
|
||||||
|
|
||||||
|
foreach (KeyValuePair<string, object> attributeNameAndValue in attributeNameAndValues)
|
||||||
|
{
|
||||||
|
bool nameFound = false;
|
||||||
|
foreach (KeyValuePair<string, FieldInfo> classField in classFields)
|
||||||
|
{
|
||||||
|
if (attributeNameAndValue.Key.ToLower() == classField.Value.Name.ToLower())
|
||||||
|
{
|
||||||
|
attributeNameAndValues.Remove(attributeNameAndValue.Key);
|
||||||
|
|
||||||
|
attributeNameAndValues.Add(classField.Key, attributeNameAndValue.Value);
|
||||||
|
|
||||||
|
nameFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nameFound) throw new InvalidOperationException($"{attributeNameAndValue.Key} has no classField!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
internal static void ConvertAttributeToDbAttributes(Type classType, List<string> attributeNames)
|
||||||
|
{
|
||||||
|
Dictionary<string, FieldInfo> classFields = ReadDbClassFields(classType);
|
||||||
|
|
||||||
|
List<string> dbAttributes = new List<string>() { };
|
||||||
|
for(int i=0; i< attributeNames.Count; i++)
|
||||||
|
{
|
||||||
|
bool nameFound = false;
|
||||||
|
foreach (KeyValuePair<string, FieldInfo> classField in classFields)
|
||||||
|
{
|
||||||
|
if(attributeNames[i].ToLower() == classField.Value.Name.ToLower())
|
||||||
|
{
|
||||||
|
attributeNames[i] = classField.Key;
|
||||||
|
|
||||||
|
nameFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!nameFound) throw new InvalidOperationException($"{attributeNames[i]} has no classField!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal static void ReadDbClassFields<T>(T classObject, ref Dictionary<string, object> dbPrimaryKeys, ref Dictionary<string, object> dbAttributes, ref Dictionary<string, object> dbForeignKeys)
|
internal static void ReadDbClassFields<T>(T classObject, ref Dictionary<string, object> dbPrimaryKeys, ref Dictionary<string, object> dbAttributes, ref Dictionary<string, object> dbForeignKeys)
|
||||||
{
|
{
|
||||||
Type classType = typeof(T);
|
Type classType = typeof(T);
|
||||||
@@ -65,10 +111,8 @@ namespace eu.railduction.netcore.dll.Database_Attribute_System
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static Dictionary<string, FieldInfo> ReadDbClassFields<T>(T classObject)
|
internal static Dictionary<string, FieldInfo> ReadDbClassFields(Type classType)
|
||||||
{
|
{
|
||||||
Type classType = typeof(T);
|
|
||||||
|
|
||||||
Dictionary<string, FieldInfo> dbFields = new Dictionary<string, FieldInfo>();
|
Dictionary<string, FieldInfo> dbFields = new Dictionary<string, FieldInfo>();
|
||||||
|
|
||||||
// Iterate thru all properties
|
// Iterate thru all properties
|
||||||
|
|||||||
Reference in New Issue
Block a user