-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIEntityFrameworkRepository.cs
More file actions
92 lines (86 loc) · 3.97 KB
/
IEntityFrameworkRepository.cs
File metadata and controls
92 lines (86 loc) · 3.97 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using Microsoft.EntityFrameworkCore;
using RapidField.SolidInstruments.Core.Domain;
using System;
namespace RapidField.SolidInstruments.DataAccess.EntityFramework
{
/// <summary>
/// Performs data access operations against an Entity Framework data model type using a single transaction.
/// </summary>
/// <typeparam name="TIdentifier">
/// The type of the unique primary identifier for the data model.
/// </typeparam>
/// <typeparam name="TDataAccessModel">
/// The type of the data model.
/// </typeparam>
/// <typeparam name="TDomainModel">
/// The type of the domain model to which the data access model is mapped.
/// </typeparam>
/// <typeparam name="TContext">
/// The type of the database session for the repository.
/// </typeparam>
public interface IEntityFrameworkRepository<TIdentifier, TDataAccessModel, TDomainModel, TContext> : IEntityFrameworkRepository<TIdentifier, TDataAccessModel, TContext>, IDomainModelRepository<TIdentifier, TDataAccessModel, TDomainModel>
where TIdentifier : IComparable, IComparable<TIdentifier>, IEquatable<TIdentifier>
where TDomainModel : class, IDomainModel<TIdentifier>
where TDataAccessModel : class, IDataAccessModel<TIdentifier, TDomainModel>, new()
where TContext : DbContext
{
}
/// <summary>
/// Performs data access operations against an Entity Framework data model type using a single transaction.
/// </summary>
/// <typeparam name="TIdentifier">
/// The type of the unique primary identifier for the data model.
/// </typeparam>
/// <typeparam name="TDataAccessModel">
/// The type of the data model.
/// </typeparam>
/// <typeparam name="TContext">
/// The type of the database session for the repository.
/// </typeparam>
public interface IEntityFrameworkRepository<TIdentifier, TDataAccessModel, TContext> : IEntityFrameworkRepository<TDataAccessModel, TContext>, IDataAccessModelRepository<TIdentifier, TDataAccessModel>
where TIdentifier : IComparable, IComparable<TIdentifier>, IEquatable<TIdentifier>
where TDataAccessModel : class, IDataAccessModel<TIdentifier>
where TContext : DbContext
{
}
/// <summary>
/// Performs data access operations against an Entity Framework entity type using a single transaction.
/// </summary>
/// <typeparam name="TEntity">
/// The type of the entity.
/// </typeparam>
/// <typeparam name="TContext">
/// The type of the database session for the repository.
/// </typeparam>
public interface IEntityFrameworkRepository<TEntity, TContext> : IDataAccessRepository<TEntity>, IEntityFrameworkRepository<TContext>
where TEntity : class
where TContext : DbContext
{
}
/// <summary>
/// Performs data access operations against an Entity Framework entity type using a single transaction.
/// </summary>
/// <typeparam name="TContext">
/// The type of the database session for the repository.
/// </typeparam>
public interface IEntityFrameworkRepository<TContext> : IEntityFrameworkRepository
where TContext : DbContext
{
/// <summary>
/// Gets the database session type of the current <see cref="IEntityFrameworkRepository{TContext}" />.
/// </summary>
public Type ContextType
{
get;
}
}
/// <summary>
/// Performs data access operations against an Entity Framework entity type using a single transaction.
/// </summary>
public interface IEntityFrameworkRepository : IDataAccessRepository
{
}
}