Skip to content

Commit b3b1189

Browse files
committed
rename lite.Retrieve() to lite.RetrieveAndRemember()
1 parent 9dfe0be commit b3b1189

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Signum.Engine/Database.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static int InsertView<T>(this T viewObject) where T : IView
8888

8989

9090

91-
public static T Retrieve<T>(this Lite<T> lite) where T : class, IEntity
91+
public static T RetrieveAndRemember<T>(this Lite<T> lite) where T : class, IEntity
9292
{
9393
if (lite == null)
9494
throw new ArgumentNullException(nameof(lite));
@@ -99,7 +99,7 @@ public static T Retrieve<T>(this Lite<T> lite) where T : class, IEntity
9999
return lite.EntityOrNull!;
100100
}
101101

102-
public static async Task<T> RetrieveAsyc<T>(this Lite<T> lite, CancellationToken token) where T : class, IEntity
102+
public static async Task<T> RetrieveAndRememberAsyc<T>(this Lite<T> lite, CancellationToken token) where T : class, IEntity
103103
{
104104
if (lite == null)
105105
throw new ArgumentNullException(nameof(lite));

Signum.Test/Environment/MusicLogic.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public static void Register()
270270
ToStates = { AlbumState.New },
271271
Construct = (albumLites, _) =>
272272
{
273-
List<AlbumEntity> albums = albumLites.Select(a => a.Retrieve()).ToList();
273+
List<AlbumEntity> albums = albumLites.Select(a => a.RetrieveAndRemember()).ToList();
274274
if (albums.Select(a => a.Author).Distinct().Count() > 1)
275275
throw new ArgumentException("All album authors must be the same in order to create a Greatest Hits Album");
276276

@@ -289,7 +289,7 @@ public static void Register()
289289
ToStates = { AlbumState.New },
290290
Construct = (albumLites, _) =>
291291
{
292-
List<AlbumEntity> albums = albumLites.Select(a => a.Retrieve()).ToList();
292+
List<AlbumEntity> albums = albumLites.Select(a => a.RetrieveAndRemember()).ToList();
293293
if (albums.Select(a => a.Author).Distinct().Count() > 1)
294294
throw new ArgumentException("All album authors must be the same in order to create a Greatest Hits Album");
295295

Signum.Test/LinqProvider/RetriverTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void RetrieveWithMListCount()
8787
{
8888
var artist = Database.Query<ArtistEntity>().OrderBy(a => a.Name).First();
8989

90-
Assert.Equal(artist.ToLite().Retrieve().Friends.Count, artist.Friends.Count);
90+
Assert.Equal(artist.ToLite().RetrieveAndRemember().Friends.Count, artist.Friends.Count);
9191
}
9292
}
9393
}

Signum.Test/LinqProvider/SelectTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ public void SelectView()
642642
[Fact]
643643
public void SelectRetrieve()
644644
{
645-
var e = Assert.Throws<InvalidOperationException>(() => Database.Query<LabelEntity>().Select(l => l.Owner!.Retrieve()).ToList());
645+
var e = Assert.Throws<InvalidOperationException>(() => Database.Query<LabelEntity>().Select(l => l.Owner!.RetrieveAndRemember()).ToList());
646646
Assert.Contains("not supported", e.Message);
647647
}
648648

Signum.Test/SaveTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void SmartSaveMList()
173173
album.Save();
174174

175175
{
176-
var album2 = album.ToLite().Retrieve();
176+
var album2 = album.ToLite().RetrieveAndRemember();
177177

178178
Assert.True(album.Songs.Count == album2.Songs.Count);
179179
Assert.True(innerList[0].RowId == ((IMListPrivate<SongEmbedded>)album2.Songs).InnerList[0].RowId);
@@ -185,7 +185,7 @@ public void SmartSaveMList()
185185
album.Save();
186186

187187
{
188-
var album2 = album.ToLite().Retrieve();
188+
var album2 = album.ToLite().RetrieveAndRemember();
189189

190190
Assert.True(album.Songs.Count == album2.Songs.Count);
191191
Assert.True(innerList[0].RowId == ((IMListPrivate<SongEmbedded>)album2.Songs).InnerList[0].RowId);
@@ -249,7 +249,7 @@ public void SmartSaveMListOrder()
249249
AssertSequenceEquals(album.MListElements(a => a.Songs).OrderBy(a => a.Order).Select(mle => KVP.Create(mle.Order, mle.Element.Name)),
250250
new Dictionary<int, string> { { 0, "Song 1" }, { 1, "Song 2" }, { 2, "Song 0" } });
251251

252-
AssertSequenceEquals(album.ToLite().Retrieve().Songs.Select(a => a.Name), new[] { "Song 1", "Song 2", "Song 0" });
252+
AssertSequenceEquals(album.ToLite().RetrieveAndRemember().Songs.Select(a => a.Name), new[] { "Song 1", "Song 2", "Song 0" });
253253

254254
//tr.Commit();
255255
}

0 commit comments

Comments
 (0)