-
-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathDocumentCommand.cs
38 lines (30 loc) · 1.11 KB
/
DocumentCommand.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Reflection;
using System.Threading.Tasks;
namespace YesSql.Commands
{
public abstract class DocumentCommand : IIndexCommand, ICollectionName
{
protected static readonly PropertyInfo[] AllProperties =
[
typeof(Document).GetProperty("Type")
];
protected static readonly PropertyInfo[] AllKeys =
[
typeof(Document).GetProperty("Id")
];
public abstract int ExecutionOrder { get; }
public DocumentCommand(Document document, string collection)
{
Document = document;
Collection = collection;
}
public Document Document { get; }
public string Collection { get; }
public abstract Task ExecuteAsync(DbConnection connection, DbTransaction transaction, ISqlDialect dialect, ILogger logger);
public abstract bool AddToBatch(ISqlDialect dialect, List<string> queries, DbCommand parameters, List<Action<DbDataReader>> actions, int index);
}
}