Skip to content

Commit 2fd7470

Browse files
committed
Rename ITopicMappingService.MapAsync() parameter to associations
To correspond with the rename of the `Relationships` enum to the more general `Associations` (191262a), I've renamed the `ITopicMappingService`'s `MapAsync()` methods to use the parameter `associations` instead of `relationships`. This change was applied to all concrete implementations of `ITopicMappingService`, as well as their internal variable references.
1 parent a993214 commit 2fd7470

File tree

4 files changed

+51
-51
lines changed

4 files changed

+51
-51
lines changed

OnTopic.TestDoubles/DummyTopicMappingService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ public DummyTopicMappingService() {
3636
\-------------------------------------------------------------------------------------------------------------------------*/
3737
/// <inheritdoc />
3838
[return: NotNullIfNotNull("topic")]
39-
public async Task<object?> MapAsync(Topic? topic, AssociationTypes relationships = AssociationTypes.All)
39+
public async Task<object?> MapAsync(Topic? topic, AssociationTypes associations = AssociationTypes.All)
4040
=> throw new NotImplementedException();
4141

4242
/*==========================================================================================================================
4343
| METHOD: MAP (T)
4444
\-------------------------------------------------------------------------------------------------------------------------*/
4545
/// <inheritdoc />
46-
public async Task<T?> MapAsync<T>(Topic? topic, AssociationTypes relationships = AssociationTypes.All) where T : class, new()
46+
public async Task<T?> MapAsync<T>(Topic? topic, AssociationTypes associations = AssociationTypes.All) where T : class, new()
4747
=> throw new NotImplementedException();
4848

4949
/*==========================================================================================================================
5050
| METHOD: MAP (OBJECTS)
5151
\-------------------------------------------------------------------------------------------------------------------------*/
5252
/// <inheritdoc />
53-
public async Task<object?> MapAsync(Topic? topic, object target, AssociationTypes relationships = AssociationTypes.All)
53+
public async Task<object?> MapAsync(Topic? topic, object target, AssociationTypes associations = AssociationTypes.All)
5454
=> throw new NotImplementedException();
5555

5656
} //Class

OnTopic/Mapping/CachedTopicMappingService.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public CachedTopicMappingService(ITopicMappingService topicMappingService) {
4545
| METHOD: MAP
4646
\-------------------------------------------------------------------------------------------------------------------------*/
4747
/// <inheritdoc />
48-
public async Task<object?> MapAsync(Topic? topic, AssociationTypes relationships = AssociationTypes.All) {
48+
public async Task<object?> MapAsync(Topic? topic, AssociationTypes associations = AssociationTypes.All) {
4949

5050
/*------------------------------------------------------------------------------------------------------------------------
5151
| Handle null source
@@ -55,15 +55,15 @@ public CachedTopicMappingService(ITopicMappingService topicMappingService) {
5555
/*------------------------------------------------------------------------------------------------------------------------
5656
| Ensure cache is populated
5757
\-----------------------------------------------------------------------------------------------------------------------*/
58-
var cacheKey = (topic.Id, (Type?)null, relationships);
58+
var cacheKey = (topic.Id, (Type?)null, associations);
5959
if(_cache.TryGetValue(cacheKey, out var viewModel)) {
6060
return viewModel;
6161
}
6262

6363
/*------------------------------------------------------------------------------------------------------------------------
6464
| Process result
6565
\-----------------------------------------------------------------------------------------------------------------------*/
66-
viewModel = await _topicMappingService.MapAsync(topic, relationships).ConfigureAwait(false);
66+
viewModel = await _topicMappingService.MapAsync(topic, associations).ConfigureAwait(false);
6767

6868
/*------------------------------------------------------------------------------------------------------------------------
6969
| Return (cached) result
@@ -83,7 +83,7 @@ public CachedTopicMappingService(ITopicMappingService topicMappingService) {
8383
| METHOD: MAP (T)
8484
\-------------------------------------------------------------------------------------------------------------------------*/
8585
/// <inheritdoc />
86-
public async Task<T?> MapAsync<T>(Topic? topic, AssociationTypes relationships = AssociationTypes.All) where T : class, new() {
86+
public async Task<T?> MapAsync<T>(Topic? topic, AssociationTypes associations = AssociationTypes.All) where T : class, new() {
8787

8888
/*------------------------------------------------------------------------------------------------------------------------
8989
| Handle null source
@@ -93,15 +93,15 @@ public CachedTopicMappingService(ITopicMappingService topicMappingService) {
9393
/*------------------------------------------------------------------------------------------------------------------------
9494
| Ensure cache is populated
9595
\-----------------------------------------------------------------------------------------------------------------------*/
96-
var cacheKey = (topic.Id, typeof(T), relationships);
96+
var cacheKey = (topic.Id, typeof(T), associations);
9797
if (_cache.TryGetValue(cacheKey, out var viewModel)) {
9898
return (T)viewModel;
9999
}
100100

101101
/*------------------------------------------------------------------------------------------------------------------------
102102
| Process result
103103
\-----------------------------------------------------------------------------------------------------------------------*/
104-
viewModel = await _topicMappingService.MapAsync<T>(topic, relationships).ConfigureAwait(false);
104+
viewModel = await _topicMappingService.MapAsync<T>(topic, associations).ConfigureAwait(false);
105105

106106
/*------------------------------------------------------------------------------------------------------------------------
107107
| Return (cached) result
@@ -121,7 +121,7 @@ public CachedTopicMappingService(ITopicMappingService topicMappingService) {
121121
| METHOD: MAP (OBJECTS)
122122
\-------------------------------------------------------------------------------------------------------------------------*/
123123
/// <inheritdoc />
124-
public async Task<object?> MapAsync(Topic? topic, object target, AssociationTypes relationships = AssociationTypes.All) {
124+
public async Task<object?> MapAsync(Topic? topic, object target, AssociationTypes associations = AssociationTypes.All) {
125125

126126
/*------------------------------------------------------------------------------------------------------------------------
127127
| Handle null source
@@ -136,15 +136,15 @@ public CachedTopicMappingService(ITopicMappingService topicMappingService) {
136136
/*------------------------------------------------------------------------------------------------------------------------
137137
| Ensure cache is populated
138138
\-----------------------------------------------------------------------------------------------------------------------*/
139-
var cacheKey = (topic.Id, target.GetType(), relationships);
139+
var cacheKey = (topic.Id, target.GetType(), associations);
140140
if (_cache.TryGetValue(cacheKey, out var viewModel)) {
141141
return viewModel;
142142
}
143143

144144
/*------------------------------------------------------------------------------------------------------------------------
145145
| Process result
146146
\-----------------------------------------------------------------------------------------------------------------------*/
147-
viewModel = await _topicMappingService.MapAsync(topic, relationships).ConfigureAwait(false);
147+
viewModel = await _topicMappingService.MapAsync(topic, associations).ConfigureAwait(false);
148148

149149
/*------------------------------------------------------------------------------------------------------------------------
150150
| Return (cached) result

OnTopic/Mapping/ITopicMappingService.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public interface ITopicMappingService {
3838
/// </para>
3939
/// </remarks>
4040
/// <param name="topic">The <see cref="Topic"/> entity to derive the data from.</param>
41-
/// <param name="relationships">Determines what relationships the mapping should follow, if any.</param>
41+
/// <param name="associations">Determines what associations the mapping should follow, if any.</param>
4242
/// <returns>An instance of the dynamically determined View Model with properties appropriately mapped.</returns>
43-
Task<object?> MapAsync(Topic? topic, AssociationTypes relationships = AssociationTypes.All);
43+
Task<object?> MapAsync(Topic? topic, AssociationTypes associations = AssociationTypes.All);
4444

4545
/*==========================================================================================================================
4646
| METHOD: MAP (GENERIC)
@@ -55,11 +55,11 @@ public interface ITopicMappingService {
5555
/// </para>
5656
/// </remarks>
5757
/// <param name="topic">The <see cref="Topic"/> entity to derive the data from.</param>
58-
/// <param name="relationships">Determines what relationships the mapping should follow, if any.</param>
58+
/// <param name="associations">Determines what associations the mapping should follow, if any.</param>
5959
/// <returns>
6060
/// An instance of the requested View Model <typeparamref name="T"/> with properties appropriately mapped.
6161
/// </returns>
62-
Task<T?> MapAsync<T>(Topic? topic, AssociationTypes relationships = AssociationTypes.All) where T : class, new();
62+
Task<T?> MapAsync<T>(Topic? topic, AssociationTypes associations = AssociationTypes.All) where T : class, new();
6363

6464
/*==========================================================================================================================
6565
| METHOD: MAP (INSTANCES)
@@ -70,11 +70,11 @@ public interface ITopicMappingService {
7070
/// </summary>
7171
/// <param name="topic">The <see cref="Topic"/> entity to derive the data from.</param>
7272
/// <param name="target">The data transfer object to populate.</param>
73-
/// <param name="relationships">Determines what relationships the mapping should follow, if any.</param>
73+
/// <param name="associations">Determines what associations the mapping should follow, if any.</param>
7474
/// <returns>
7575
/// An instance of the requested View Model instance with properties appropriately mapped.
7676
/// </returns>
77-
Task<object?> MapAsync(Topic? topic, object target, AssociationTypes relationships = AssociationTypes.All);
77+
Task<object?> MapAsync(Topic? topic, object target, AssociationTypes associations = AssociationTypes.All);
7878

7979
} //Interface
8080
} //Namespace

0 commit comments

Comments
 (0)