-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIReadOnlyDataAccessRepository.cs
More file actions
113 lines (106 loc) · 4.87 KB
/
IReadOnlyDataAccessRepository.cs
File metadata and controls
113 lines (106 loc) · 4.87 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using System;
using System.Linq;
using System.Linq.Expressions;
namespace RapidField.SolidInstruments.DataAccess
{
/// <summary>
/// Performs read-only data access operations for a specified entity type.
/// </summary>
/// <typeparam name="TEntity">
/// The type of the entity.
/// </typeparam>
public interface IReadOnlyDataAccessRepository<TEntity> : IReadOnlyDataAccessRepository
where TEntity : class
{
/// <summary>
/// Returns all entities from the current <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </summary>
/// <returns>
/// All entities within the current <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </returns>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public IQueryable<TEntity> All();
/// <summary>
/// Determines whether or not the specified entity exists in the current
/// <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </summary>
/// <param name="entity">
/// The entity to evaluate.
/// </param>
/// <returns>
/// <see langword="true" /> if the specified entity exists in the current
/// <see cref="IReadOnlyDataAccessRepository{TEntity}" />, otherwise <see langword="false" />.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="entity" /> is <see langword="null" />.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public Boolean Contains(TEntity entity);
/// <summary>
/// Determines whether or not any entities matching the specified predicate exist in the current
/// <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </summary>
/// <param name="predicate">
/// An expression to test each entity for a condition.
/// </param>
/// <returns>
/// <see langword="true" /> if any entities matching the specified predicate exist in the current
/// <see cref="IReadOnlyDataAccessRepository{TEntity}" />, otherwise <see langword="false" />.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="predicate" /> is <see langword="null" />.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public Boolean ContainsWhere(Expression<Func<TEntity, Boolean>> predicate);
/// <summary>
/// Returns the number of entities matching the specified predicate in the current
/// <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </summary>
/// <param name="predicate">
/// An expression to test each entity for a condition.
/// </param>
/// <returns>
/// The number of entities matching the specified predicate in the current
/// <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="predicate" /> is <see langword="null" />.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public Int64 CountWhere(Expression<Func<TEntity, Boolean>> predicate);
/// <summary>
/// Returns all entities matching the specified predicate from the current
/// <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </summary>
/// <param name="predicate">
/// An expression to test each entity for a condition.
/// </param>
/// <returns>
/// All entities matching the specified predicate within the current <see cref="IReadOnlyDataAccessRepository{TEntity}" />.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="predicate" /> is <see langword="null" />.
/// </exception>
/// <exception cref="ObjectDisposedException">
/// The object is disposed.
/// </exception>
public IQueryable<TEntity> FindWhere(Expression<Func<TEntity, Boolean>> predicate);
}
/// <summary>
/// Performs read-only data access operations for a specified entity type.
/// </summary>
public interface IReadOnlyDataAccessRepository : IDataAccessRepository
{
}
}