Esempio n. 1
0
 /// <summary>
 ///    Maps a list of models to the corresponding snapshot arrays. If the list if null or empty, null will be returned
 /// </summary>
 public static Task <TSnapshot[]> MapToSnapshots <TModel, TSnapshot, TSnapshotContext, TModelContext>(this ObjectBaseSnapshotMapperBase <TModel, TSnapshot, TSnapshotContext, TModelContext> mapper, IEnumerable <TModel> models, TModelContext modelContext)
     where TSnapshot : IWithName, IWithDescription, new()
     where TModel : IWithName, IWithDescription
     where TSnapshotContext : SnapshotContext
 {
     return(MapTo(models, m => mapper.MapToSnapshot(m, modelContext)));
 }
Esempio n. 2
0
 /// <summary>
 ///    Maps a list of snapshot to the corresponding model arrays. If the list if null or empty, null will be returned
 /// </summary>
 public static Task <TModel[]> MapToModels <TModel, TSnapshot, TSnapshotContext>(this ObjectBaseSnapshotMapperBase <TModel, TSnapshot, TSnapshotContext> mapper, IEnumerable <TSnapshot> snapshots, TSnapshotContext context)
     where TSnapshot : IWithName, IWithDescription, new()
     where TModel : IWithName, IWithDescription
     where TSnapshotContext : SnapshotContext
 {
     return(MapToModels(mapper, snapshots, s => mapper.MapToModel(s, context)));
 }