From b3b1189f148477d71ce70bf716b7820693abce4b Mon Sep 17 00:00:00 2001 From: Olmo del Corral Cano Date: Tue, 16 Jul 2019 11:33:04 +0200 Subject: [PATCH] rename lite.Retrieve() to lite.RetrieveAndRemember() --- Signum.Engine/Database.cs | 4 ++-- Signum.Test/Environment/MusicLogic.cs | 4 ++-- Signum.Test/LinqProvider/RetriverTest.cs | 2 +- Signum.Test/LinqProvider/SelectTest.cs | 2 +- Signum.Test/SaveTest.cs | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Signum.Engine/Database.cs b/Signum.Engine/Database.cs index 46baa0a240..6d0874409f 100644 --- a/Signum.Engine/Database.cs +++ b/Signum.Engine/Database.cs @@ -88,7 +88,7 @@ public static int InsertView(this T viewObject) where T : IView - public static T Retrieve(this Lite lite) where T : class, IEntity + public static T RetrieveAndRemember(this Lite lite) where T : class, IEntity { if (lite == null) throw new ArgumentNullException(nameof(lite)); @@ -99,7 +99,7 @@ public static T Retrieve(this Lite lite) where T : class, IEntity return lite.EntityOrNull!; } - public static async Task RetrieveAsyc(this Lite lite, CancellationToken token) where T : class, IEntity + public static async Task RetrieveAndRememberAsyc(this Lite lite, CancellationToken token) where T : class, IEntity { if (lite == null) throw new ArgumentNullException(nameof(lite)); diff --git a/Signum.Test/Environment/MusicLogic.cs b/Signum.Test/Environment/MusicLogic.cs index 90f5371bad..6bf6fb9e38 100644 --- a/Signum.Test/Environment/MusicLogic.cs +++ b/Signum.Test/Environment/MusicLogic.cs @@ -270,7 +270,7 @@ public static void Register() ToStates = { AlbumState.New }, Construct = (albumLites, _) => { - List albums = albumLites.Select(a => a.Retrieve()).ToList(); + List albums = albumLites.Select(a => a.RetrieveAndRemember()).ToList(); if (albums.Select(a => a.Author).Distinct().Count() > 1) throw new ArgumentException("All album authors must be the same in order to create a Greatest Hits Album"); @@ -289,7 +289,7 @@ public static void Register() ToStates = { AlbumState.New }, Construct = (albumLites, _) => { - List albums = albumLites.Select(a => a.Retrieve()).ToList(); + List albums = albumLites.Select(a => a.RetrieveAndRemember()).ToList(); if (albums.Select(a => a.Author).Distinct().Count() > 1) throw new ArgumentException("All album authors must be the same in order to create a Greatest Hits Album"); diff --git a/Signum.Test/LinqProvider/RetriverTest.cs b/Signum.Test/LinqProvider/RetriverTest.cs index abda3581fa..8ed06b3d81 100644 --- a/Signum.Test/LinqProvider/RetriverTest.cs +++ b/Signum.Test/LinqProvider/RetriverTest.cs @@ -87,7 +87,7 @@ public void RetrieveWithMListCount() { var artist = Database.Query().OrderBy(a => a.Name).First(); - Assert.Equal(artist.ToLite().Retrieve().Friends.Count, artist.Friends.Count); + Assert.Equal(artist.ToLite().RetrieveAndRemember().Friends.Count, artist.Friends.Count); } } } diff --git a/Signum.Test/LinqProvider/SelectTest.cs b/Signum.Test/LinqProvider/SelectTest.cs index 2a0c4e5d41..fb111fa0bf 100644 --- a/Signum.Test/LinqProvider/SelectTest.cs +++ b/Signum.Test/LinqProvider/SelectTest.cs @@ -642,7 +642,7 @@ public void SelectView() [Fact] public void SelectRetrieve() { - var e = Assert.Throws(() => Database.Query().Select(l => l.Owner!.Retrieve()).ToList()); + var e = Assert.Throws(() => Database.Query().Select(l => l.Owner!.RetrieveAndRemember()).ToList()); Assert.Contains("not supported", e.Message); } diff --git a/Signum.Test/SaveTest.cs b/Signum.Test/SaveTest.cs index 21b5db1a8b..fc1627699a 100644 --- a/Signum.Test/SaveTest.cs +++ b/Signum.Test/SaveTest.cs @@ -173,7 +173,7 @@ public void SmartSaveMList() album.Save(); { - var album2 = album.ToLite().Retrieve(); + var album2 = album.ToLite().RetrieveAndRemember(); Assert.True(album.Songs.Count == album2.Songs.Count); Assert.True(innerList[0].RowId == ((IMListPrivate)album2.Songs).InnerList[0].RowId); @@ -185,7 +185,7 @@ public void SmartSaveMList() album.Save(); { - var album2 = album.ToLite().Retrieve(); + var album2 = album.ToLite().RetrieveAndRemember(); Assert.True(album.Songs.Count == album2.Songs.Count); Assert.True(innerList[0].RowId == ((IMListPrivate)album2.Songs).InnerList[0].RowId); @@ -249,7 +249,7 @@ public void SmartSaveMListOrder() AssertSequenceEquals(album.MListElements(a => a.Songs).OrderBy(a => a.Order).Select(mle => KVP.Create(mle.Order, mle.Element.Name)), new Dictionary { { 0, "Song 1" }, { 1, "Song 2" }, { 2, "Song 0" } }); - AssertSequenceEquals(album.ToLite().Retrieve().Songs.Select(a => a.Name), new[] { "Song 1", "Song 2", "Song 0" }); + AssertSequenceEquals(album.ToLite().RetrieveAndRemember().Songs.Select(a => a.Name), new[] { "Song 1", "Song 2", "Song 0" }); //tr.Commit(); }