public class SearchingService private bool isDisposed false private IM

 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
public class SearchingService {
private bool isDisposed = false;
private IMapper mapper;
private ILibraryUnitOfWork unitOfWork;
#region UserCard
public UserCardDTO FindUserCard(Expression<Func<UserCardDTO, bool>> predicate) {
return unitOfWork.UserCards.FindBy(mapper.Map<>()predicate);
}
#endregion
public void Dispose() {
Dispose(true);
// TODO: uncomment the following line if the finalizer is overridden above.
// GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing) {
if (!isDisposed && disposing) {
unitOfWork.Dispose();
isDisposed = true;
}
}
}