diff --git a/AsbCloud.sln b/AsbCloud.sln
index 7cd3f161..21e8350f 100644
--- a/AsbCloud.sln
+++ b/AsbCloud.sln
@@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleApp1", "ConsoleApp1\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsbCloudDb", "AsbCloudDb\AsbCloudDb.csproj", "{40FBD29B-724B-4496-B5D9-1A5D14102456}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataTable", "DataTable\DataTable.csproj", "{28AD7CD5-17A0-448C-8C16-A34AE5DE40FB}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsbCloudWebApi.Tests", "AsbCloudWebApi.Tests\AsbCloudWebApi.Tests.csproj", "{9CF6FBB1-9AF5-45AB-A521-24F11A79B540}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AsbCloudDevOperations", "AsbCloudDbDemoData\AsbCloudDevOperations.csproj", "{1208822E-9099-4D13-B72F-8721E5758577}"
@@ -45,10 +43,6 @@ Global
{40FBD29B-724B-4496-B5D9-1A5D14102456}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40FBD29B-724B-4496-B5D9-1A5D14102456}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40FBD29B-724B-4496-B5D9-1A5D14102456}.Release|Any CPU.Build.0 = Release|Any CPU
- {28AD7CD5-17A0-448C-8C16-A34AE5DE40FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {28AD7CD5-17A0-448C-8C16-A34AE5DE40FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {28AD7CD5-17A0-448C-8C16-A34AE5DE40FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {28AD7CD5-17A0-448C-8C16-A34AE5DE40FB}.Release|Any CPU.Build.0 = Release|Any CPU
{9CF6FBB1-9AF5-45AB-A521-24F11A79B540}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9CF6FBB1-9AF5-45AB-A521-24F11A79B540}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9CF6FBB1-9AF5-45AB-A521-24F11A79B540}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/AsbCloudWebApi/AsbCloudWebApi.csproj b/AsbCloudWebApi/AsbCloudWebApi.csproj
index 738633de..95ae553b 100644
--- a/AsbCloudWebApi/AsbCloudWebApi.csproj
+++ b/AsbCloudWebApi/AsbCloudWebApi.csproj
@@ -42,5 +42,7 @@
+
+
diff --git a/AsbCloudWebApi/appsettings.json b/AsbCloudWebApi/appsettings.json
index fd0ca1a8..55675a79 100644
--- a/AsbCloudWebApi/appsettings.json
+++ b/AsbCloudWebApi/appsettings.json
@@ -7,7 +7,7 @@
}
},
"ConnectionStrings": {
- "DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;",
+ "DefaultConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True",
"DebugConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True;Include Error Detail=True",
"ServerConnection": "Host=192.168.1.70;Database=postgres;Username=postgres;Password=q;Persist Security Info=True",
"LocalConnection": "Host=localhost;Database=postgres;Username=postgres;Password=q;Persist Security Info=True"
diff --git a/DataTable/DataTable.csproj b/DataTable/DataTable.csproj
deleted file mode 100644
index 20827042..00000000
--- a/DataTable/DataTable.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- net5.0
-
-
-
diff --git a/DataTable/Header.cs b/DataTable/Header.cs
deleted file mode 100644
index 471ce6cc..00000000
--- a/DataTable/Header.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace DataTable
-{
- [Serializable]
- public class Header
- {
- public string Name { get; set; }
- public string Desctiption { get; set; }
- //public System.Type ColumnType { get; set; } = typeof(object);
- public string ColumnType { get; set; }
- }
-}
\ No newline at end of file
diff --git a/DataTable/Program.cs b/DataTable/Program.cs
deleted file mode 100644
index b7bdb23a..00000000
--- a/DataTable/Program.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-namespace DataTable
-{
- class Program
- {
- static void Main(/*string[] args*/)
- {
- //var listDtos = new List(100);
-
- /* *** Size of TestDto calc ***
- *
- * ** data binary size (Not implemented) **
- * Date : DateTime : 4b
- * Mode : int32? : 4b
- * User : string : 2-64b
- * WellDepth : double? : 8b
- * TOTAL data size = 18-80b
- *
- * ** header binary size (Not implemented) **
- *
- *DateTime : len("DateTime") + 2 + len("Date") + 2 = 16b
- * Mode : 14b
- * User : 14b
- * WellDepth : 20b
- * columnsCount : 2b
- * TOTAL header size = 66b
- *
- * ** json as tab **
- *
- * header size: 137b
- * json row size: 63b
- *
- * total for 1 record : 200b
- * total for 2 records : 263b
- *
- * ** json as list **
- *
- * Raw listItem size: 175b
- * total for 2 records : 350b
- *
- * ** example 100 records **
- * tabJsonBytes: 6602
- * listJsonBytes: 9628
- * tabBinBytes: 7765 (by dangerous BinaryFormatter)
- * listBinBytes: 4366 (by dangerous BinaryFormatter)
- */
-
- //for (int i = 0; i < 100; i++)
- // listDtos.Add(new TestDto{
- // Date = DateTime.Now.AddSeconds(i),
- // Mode = 1,
- // WellDepth = i * Math.PI
- // });
-
- //var tMapper = new TableMapper();
-
- //var tab = tMapper.MakeTable(listDtos);
-
- //var e = tMapper.AsEnumerable(tab);
-
- //var tabJson = JsonSerializer.Serialize(tab);
- //var listJson = JsonSerializer.Serialize(listDtos);
-
- //var tabJsonBytes = JsonSerializer.SerializeToUtf8Bytes(tab);
- //var listJsonBytes = JsonSerializer.SerializeToUtf8Bytes(listDtos);
-
- //var formatter = new BinaryFormatter();
- //var mem = new MemoryStream();
- //formatter.Serialize(mem, tab);
- //var tabBinBytes = new byte[mem.Length];
- //Array.Copy(mem.GetBuffer(), tabBinBytes, mem.Length);
-
- //mem = new MemoryStream();
- //formatter.Serialize(mem, listDtos);
- //var listBinBytes = new byte[mem.Length];
- //Array.Copy(mem.GetBuffer(), listBinBytes, mem.Length);
-
- //Console.WriteLine($"tabJsonBytes:{tabJsonBytes.Length}");
- //Console.WriteLine($"listJsonBytes:{listJsonBytes.Length}");
- //Console.WriteLine($"tabBinBytes:{tabBinBytes.Length}");
- //Console.WriteLine($"listBinBytes:{listBinBytes.Length}");
- }
- }
-}
diff --git a/DataTable/PropertyHelper.cs b/DataTable/PropertyHelper.cs
deleted file mode 100644
index 9b453051..00000000
--- a/DataTable/PropertyHelper.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq.Expressions;
-using System.Reflection;
-
-namespace DataTable
-{
- ///
- /// Ускоренный обработчик свойства
- ///
- class PropertyHelper
- {
- delegate void SetterDelegate(object instanse, object[] values);
-
- delegate object GetterDelegate(object instanse);
-
- public string PropertyName { get; }
- public string PropertyDesctiption { get; }
- public Type PropertyType { get; }
- public string Id { get; }
-
- SetterDelegate Setter { get; }
- GetterDelegate Getter { get; }
- public PropertyHelper(PropertyInfo property)
- {
- PropertyName = property.Name;
- PropertyType = property.PropertyType;
- Id = MakeIdentity(property.PropertyType.Name, property.Name);
- PropertyDesctiption = GetDescription(property);
-
- var setter = property.SetMethod;
- var getter = property.GetMethod;
-
- var instanceExpression = Expression.Parameter(typeof(object), "instance");
- var argumentsExpression = Expression.Parameter(typeof(object[]), "arguments");
- var argumentExpressions = new List { Expression.Convert(Expression.ArrayIndex(argumentsExpression, Expression.Constant(0)), PropertyType) };
- var callExpression = Expression.Call(Expression.Convert(instanceExpression, setter.ReflectedType), setter, argumentExpressions);
- Setter = Expression.Lambda(callExpression, instanceExpression, argumentsExpression).Compile();
- callExpression = Expression.Call(Expression.Convert(instanceExpression, getter.ReflectedType), getter);
- Getter = Expression.Lambda(Expression.Convert(callExpression, typeof(object)), instanceExpression).Compile();
- }
-
- private string GetDescription(PropertyInfo property)
- {
- var descriptionAttr = property.GetCustomAttribute();
- return descriptionAttr?.Description ?? string.Empty;
- }
-
- void SetValues(object instance, params object[] values)
- => Setter(instance, values);
-
- public void Set(object instance, object value)
- => SetValues(instance, value);
-
- public object Get(object instance)
- => Getter(instance);
-
- public static string MakeIdentity(string propertyTypeName, string propertyName)
- => $"{propertyTypeName}_{propertyName}".ToLower();
- }
-}
diff --git a/DataTable/Table.cs b/DataTable/Table.cs
deleted file mode 100644
index b5f8f5ae..00000000
--- a/DataTable/Table.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace DataTable
-{
- [Serializable]
- public class Table
- {
- public IEnumerable Headers { get; set; }
-
- public IEnumerable> Rows { get; set; }
-
- }
-}
diff --git a/DataTable/TableMapper.cs b/DataTable/TableMapper.cs
deleted file mode 100644
index 1af75273..00000000
--- a/DataTable/TableMapper.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace DataTable
-{
- public class TableMapper
- where T : new()
- {
- private readonly Dictionary props;
-
- public TableMapper()
- {
- var props = typeof(T).GetProperties();
- this.props = new Dictionary(props.Length);
- foreach (var prop in props)
- {
- var helper = new PropertyHelper(prop);
- this.props.Add(helper.Id, helper);
- }
- }
-
- public IEnumerable AsEnumerable(Table table)
- {
- if ((table?.Headers is null) ||
- (table?.Rows is null) ||
- (!table.Headers.Any()) ||
- (!table.Rows.Any()) ||
- (!props.Any()))
- yield break;
-
- var headerIdToProp = new Dictionary(props.Count);
- foreach (var (_, propHelper) in props)
- for (var i = 0; i < table.Headers.Count(); i++)
- {
- var header = table.Headers.ElementAt(i);
- var columnType = System.Type.GetType(header.ColumnType);
- if (columnType.IsAssignableTo(propHelper.PropertyType) &&
- ((header.Name == propHelper.PropertyName) ||
- (header.Name.ToLower() == propHelper.PropertyName.ToLower())))
- headerIdToProp.Add(i, propHelper);
- }
-
- if (!headerIdToProp.Any())
- yield break;
-
- foreach (var row in table.Rows)
- {
- var obj = new T();
- foreach (var (i, propHelper) in headerIdToProp)
- propHelper.Set(obj, row.ElementAt(i));
- yield return obj;
- }
-
- yield break;
- }
-
- public Table MakeTable(IEnumerable data)
- {
- var table = new Table();
- table.Headers = props.Select(pair => new Header
- {
- Name = pair.Value.PropertyName,
- ColumnType = pair.Value.PropertyType.Name,
- }).ToArray();
-
- var rows = new List>(data.Count());
- foreach (var dataItem in data)
- rows.Add(MakeRow(dataItem));
-
- table.Rows = rows;
-
- return table;
- }
-
- private List