|
@@ -641,11 +641,8 @@ public class SQLiteProviderFactory : IProviderFactory
|
|
|
return "TEXT";
|
|
|
}
|
|
|
|
|
|
- private void LoadFields(Type type, Dictionary<string, string> fields, List<PropertyInfo>? prefixes, CustomProperty[] customproperties)
|
|
|
+ private void LoadFields(Type type, Dictionary<string, string> fields)
|
|
|
{
|
|
|
- if (prefixes == null)
|
|
|
- prefixes = new List<PropertyInfo>();
|
|
|
-
|
|
|
AutoEntity? view = type.GetCustomAttribute<AutoEntity>();
|
|
|
Type definition = view?.Generator != null
|
|
|
? view.Generator.Definition
|
|
@@ -794,7 +791,7 @@ public class SQLiteProviderFactory : IProviderFactory
|
|
|
else
|
|
|
{
|
|
|
var type_fields = new Dictionary<string, string>();
|
|
|
- LoadFields(view.Generator.Definition, type_fields, null, customproperties);
|
|
|
+ LoadFields(view.Generator.Definition, type_fields);
|
|
|
|
|
|
using (var access = MainProvider.GetWriteAccess())
|
|
|
{
|
|
@@ -808,7 +805,7 @@ public class SQLiteProviderFactory : IProviderFactory
|
|
|
private Dictionary<string, object?> CheckDefaultColumns(IAutoEntityGenerator generator)
|
|
|
{
|
|
|
var viewfields = new Dictionary<string, string>();
|
|
|
- LoadFields(generator.Definition, viewfields, null, new CustomProperty[] { });
|
|
|
+ LoadFields(generator.Definition, viewfields);
|
|
|
Dictionary<String, object?> result = new Dictionary<string, object?>();
|
|
|
if (!viewfields.ContainsKey("ID"))
|
|
|
result["ID"] = null;
|
|
@@ -855,10 +852,10 @@ public class SQLiteProviderFactory : IProviderFactory
|
|
|
var constants = CheckDefaultColumns(union);
|
|
|
|
|
|
var interfacefields = new Dictionary<string, string>();
|
|
|
- LoadFields(union.Definition, interfacefields, null, new CustomProperty[] { });
|
|
|
+ LoadFields(union.Definition, interfacefields);
|
|
|
|
|
|
var entityfields = new Dictionary<string, string>();
|
|
|
- LoadFields(table.Entity, entityfields, null, new CustomProperty[] { });
|
|
|
+ LoadFields(table.Entity, entityfields);
|
|
|
|
|
|
foreach (var field in interfacefields.Keys)
|
|
|
{
|
|
@@ -980,7 +977,7 @@ public class SQLiteProviderFactory : IProviderFactory
|
|
|
var fields = new Dictionary<string, string>();
|
|
|
var constraints = new List<string>();
|
|
|
var indexes = new List<string>();
|
|
|
- LoadFields(type, fields, null, customproperties);
|
|
|
+ LoadFields(type, fields);
|
|
|
var defs = new List<string>();
|
|
|
foreach (var key in fields.Keys)
|
|
|
defs.Add(string.Format("[{0}] {1}", key, fields[key]));
|
|
@@ -1162,13 +1159,10 @@ public class SQLiteProviderFactory : IProviderFactory
|
|
|
|
|
|
private void CheckFields(SQLiteWriteAccessor access, Type type, Dictionary<string, string> current_fields, CustomProperty[] customproperties)
|
|
|
{
|
|
|
+ var name = type.Name;
|
|
|
var type_fields = new Dictionary<string, string>();
|
|
|
var view = type.GetCustomAttribute<AutoEntity>();
|
|
|
- if ((view != null) && (view.Generator != null))
|
|
|
- LoadFields(view.Generator.Definition, type_fields, null, customproperties);
|
|
|
- else
|
|
|
- LoadFields(type, type_fields, null, customproperties);
|
|
|
-
|
|
|
+ LoadFields(type, type_fields);
|
|
|
|
|
|
var bRebuild = false;
|
|
|
foreach (var field in type_fields.Keys)
|
|
@@ -1243,18 +1237,6 @@ public class SQLiteProviderFactory : IProviderFactory
|
|
|
//#endif
|
|
|
}
|
|
|
|
|
|
- // private void CheckViews(SQLiteWriteAccessor access, Type type, Dictionary<String, String> db_views)
|
|
|
- // {
|
|
|
- // var type_view = LoadView(type);
|
|
|
- //
|
|
|
- //
|
|
|
- // if (!type_triggers.Contains(db_triggers[viewname]))
|
|
|
- // ExecuteSQL(access, string.Format("DROP TRIGGER {0}", trigger));
|
|
|
- //
|
|
|
- // if (!db_views.ContainsValue(type_view))
|
|
|
- // ExecuteSQL(access, type_view);
|
|
|
- // }
|
|
|
-
|
|
|
#endregion
|
|
|
|
|
|
private void Log(LogType type, string message)
|