/
DiagnosticCommand.cs
40 lines (35 loc) · 1 KB
/
DiagnosticCommand.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
39
40
using System;
using System.Collections.Generic;
using MongoDB.Driver;
using MongoFramework.Infrastructure.Linq;
namespace MongoFramework.Infrastructure.Diagnostics
{
public abstract class DiagnosticCommand
{
public Guid CommandId { get; set; }
public string Source { get; set; }
public CommandState CommandState { get; set; }
public Type EntityType { get; set; }
}
public enum CommandState
{
Start,
FirstResult,
End,
Error
}
public class ReadDiagnosticCommand : DiagnosticCommand
{
public IMongoFrameworkQueryable Queryable { get; set; }
}
public abstract class WriteDiagnosticCommandBase : DiagnosticCommand { }
public class WriteDiagnosticCommand<TEntity> : WriteDiagnosticCommandBase
{
public IEnumerable<WriteModel<TEntity>> WriteModel { get; set; }
}
public abstract class IndexDiagnosticCommandBase : DiagnosticCommand { }
public class IndexDiagnosticCommand<TEntity> : IndexDiagnosticCommandBase
{
public IEnumerable<CreateIndexModel<TEntity>> IndexModel { get; set; }
}
}