Skip to content

Commit

Permalink
Merge pull request #32 from muratbaseren/master
Browse files Browse the repository at this point in the history
v 2.3.2 : Mongo update bugfix and sample app improvement
  • Loading branch information
muratbaseren authored May 1, 2022
2 parents d6fc924 + 7f30a25 commit cf1f0e3
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageProjectUrl>https://github.com/muratbaseren/MFramework.Services</PackageProjectUrl>
<RepositoryUrl>https://github.com/muratbaseren/MFramework.Services</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageProjectUrl>https://github.com/muratbaseren/MFramework.Services</PackageProjectUrl>
<RepositoryUrl>https://github.com/muratbaseren/MFramework.Services</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageProjectUrl>https://github.com/muratbaseren/MFramework.Services</PackageProjectUrl>
<RepositoryUrl>https://github.com/muratbaseren/MFramework.Services</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/muratbaseren/MFramework.Services</RepositoryUrl>
<PackageProjectUrl>https://github.com/muratbaseren/MFramework.Services</PackageProjectUrl>
<Version>2.3.1</Version>
<Version>2.3.2</Version>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Authors>K. Murat Başeren</Authors>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageProjectUrl>https://github.com/muratbaseren/MFramework.Services</PackageProjectUrl>
<RepositoryUrl>https://github.com/muratbaseren/MFramework.Services</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>2.3.0</Version>
<Version>2.3.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
41 changes: 26 additions & 15 deletions SampleConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ static void Main(string[] args)
AlbumManager albumManager = new AlbumManager(mapper);
CreateFakeData(albumManager);

//QueryTest(albumManager);
//UpdateTest(albumManager);
QueryTest(albumManager);
UpdateTest(albumManager);
QueryTest(albumManager);

Console.WriteLine();
Console.WriteLine("List retrieve is completed. Please enter to quit!!..");
Console.WriteLine("Please enter to quit!!..");
Console.ReadKey();
}

Expand All @@ -78,44 +79,54 @@ private static void CreateFakeData(AlbumManager albumManager)
});
}

Console.WriteLine("Sample data created. Please enter for continue..");
Console.WriteLine("Sample data created. Please enter key to continue..");
Console.WriteLine();
Console.ReadKey();
}
}

private static void QueryTest(AlbumManager albumManager)
{
var list = albumManager.Query().Where(x => x.IsSales).ToList();
var list = albumManager.List().ToList();
list.ForEach(x => Console.WriteLine(x.ToJson()));

//var list = albumManager.Query().Where(x => x.IsSales).ToList();
//list.ForEach(x => Console.WriteLine(x.ToJson()));

//var list = albumManager.Query().Where(x => x.Name.StartsWith("A")).ToList();
//list.ForEach(x => Console.WriteLine(x.ToJson()));

//var list = albumManager.Query().Where(x => x.Price >= 200 && x.Price <= 300).ToList();
//list.ForEach(x => Console.WriteLine(x.ToJson()));

Console.WriteLine();
Console.WriteLine("All items listed. Please enter key to continue..");
Console.ReadKey();
Console.WriteLine();
}

private static void UpdateTest(AlbumManager albumManager)
{
var album = albumManager.Create(new Album { IsSales = false, Name = "testo11", Price = 10, Year = 2021 });
Console.WriteLine(album.ToJson());
Console.WriteLine("Album created.");
Console.WriteLine("Album created. Please enter key to continue..");
Console.WriteLine();
Console.ReadKey();

album = albumManager.Find(album.Id);
album.Name = "testo112";
albumManager.Update(album.Id, album);
Console.WriteLine(album.ToJson());
Console.WriteLine("Album updated 1.");
var album2 = albumManager.Find(album.Id);
album2.Name = "testo112";
albumManager.Update(album2.Id, album2);
var album3 = albumManager.Find(album2.Id);
Console.WriteLine(album3.ToJson());
Console.WriteLine($"Album name updated {album.Name} => {album3.Name} by Update method. Please enter key to continue..");
Console.WriteLine();
Console.ReadKey();

album = albumManager.Find(album.Id);
albumManager.UpdateProperties(album.Id, new { Name = "testo113" }.ToExpando());
Console.WriteLine(album.ToJson());
Console.WriteLine("Album updated 2.");
var album4 = albumManager.Find(album.Id);
albumManager.UpdateProperties(album4.Id, new { Name = "testo113" }.ToExpando());
var album5 = albumManager.Find(album4.Id);
Console.WriteLine(album5.ToJson());
Console.WriteLine($"Album name updated {album4.Name} => {album5.Name} by UpdateProperties method. Please enter key to continue..");
Console.WriteLine();
Console.ReadKey();
}
Expand Down

0 comments on commit cf1f0e3

Please sign in to comment.