|
@@ -2,6 +2,7 @@
|
2
|
2
|
using Luticate2.Auth.Auth.Business;
|
3
|
3
|
using Luticate2.Auth.Auth.DataAccess;
|
4
|
4
|
using Luticate2.Auth.ConsoleSample.Commands;
|
|
5
|
+using Luticate2.Auth.Utils.Business.Converters;
|
5
|
6
|
using Microsoft.EntityFrameworkCore;
|
6
|
7
|
using Microsoft.Extensions.DependencyInjection;
|
7
|
8
|
using NClap.Metadata;
|
|
@@ -24,45 +25,16 @@ namespace Luticate2.Auth.ConsoleSample
|
24
|
25
|
class Program
|
25
|
26
|
{
|
26
|
27
|
public static IServiceProvider ServiceProvider;
|
27
|
|
-
|
28
|
|
-// protected static void AddILuExpressionConverter<TTypeFrom, TTypeTo, TTypeImpl>(IServiceCollection services)
|
29
|
|
-// where TTypeImpl : class, ILuExpressionConverter<TTypeFrom, TTypeTo>
|
30
|
|
-// {
|
31
|
|
-// services.AddSingleton<ILuExpressionConverter<TTypeFrom, TTypeTo>, TTypeImpl>();
|
32
|
|
-// services.TryAddSingleton<ILuExpressionConverter<TTypeFrom>, TTypeImpl>();
|
33
|
|
-// }
|
34
|
28
|
|
35
|
29
|
static void Main(string[] args)
|
36
|
30
|
{
|
37
|
31
|
IServiceCollection services = new ServiceCollection();
|
|
32
|
+
|
|
33
|
+ services.AddLuObjectConverterDescriptors();
|
|
34
|
+ services.AddLuObjectConverters();
|
38
|
35
|
|
39
|
36
|
services.AddScoped<LuGroupsBusiness>();
|
40
|
37
|
|
41
|
|
-
|
42
|
|
-// services.AddSingleton<ILuDboModelExpressionConverter<TestDbo1, TestModel1>, LuDMECTest1>();
|
43
|
|
-// AddILuExpressionConverter<LuGroupDbo, LuGroups, LuDMECGroupsToModel>(services);
|
44
|
|
-// AddILuExpressionConverter<string, string, LuExpressionConverterIdentity<string>>(services);
|
45
|
|
-// AddILuExpressionConverter<Guid, Guid, LuExpressionConverterIdentity<Guid>>(services);
|
46
|
|
-// AddILuExpressionConverter<bool, bool, LuExpressionConverterIdentity<bool>>(services);
|
47
|
|
-
|
48
|
|
-
|
49
|
|
-// services.AddSingleton<ILuFieldsExpressions<LuObjectsMetadataDbo, LuObjectsMetadata>, LuFieldsExpressionsLuMetadataDboLuMetadata>();
|
50
|
|
-// services.AddSingleton<ILuFieldsExpressions<LuGroupDbo, LuGroups>, LuFieldsExpressionsLuGroupDboLuGroups>();
|
51
|
|
-//
|
52
|
|
-// services.AddSingleton<ILuFieldsExpressions<string, string>, LuFieldsExpressionsString>();
|
53
|
|
-// services.AddSingleton<ILuFieldsExpressions<int, int>, LuFieldsExpressions<int, int>>();
|
54
|
|
-// services.AddSingleton<ILuFieldsExpressions<Guid, Guid>, LuFieldsExpressions<Guid, Guid>>();
|
55
|
|
-//
|
56
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTime, DateTime>, LuFieldsExpressions<DateTime, DateTime>>();
|
57
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTimeOffset, DateTimeOffset>, LuFieldsExpressions<DateTimeOffset, DateTimeOffset>>();
|
58
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTime, DateTimeOffset>, LuFieldsExpressions<DateTime, DateTimeOffset>>();
|
59
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTimeOffset, DateTime>, LuFieldsExpressions<DateTimeOffset, DateTime>>();
|
60
|
|
-//
|
61
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTime?, DateTime?>, LuFieldsExpressions<DateTime?, DateTime?>>();
|
62
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTimeOffset?, DateTimeOffset?>, LuFieldsExpressions<DateTimeOffset?, DateTimeOffset?>>();
|
63
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTime?, DateTimeOffset?>, LuFieldsExpressions<DateTime?, DateTimeOffset?>>();
|
64
|
|
-// services.AddSingleton<ILuFieldsExpressions<DateTimeOffset?, DateTime?>, LuFieldsExpressions<DateTimeOffset?, DateTime?>>();
|
65
|
|
-
|
66
|
38
|
services.AddDbContext<Luticate2DbContext>(options =>
|
67
|
39
|
{
|
68
|
40
|
options.UseNpgsql(@"Host=localhost;Database=luticate2;Username=dev;Password=dev");
|