-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
moravcikj24
authored and
moravcikj24
committed
Nov 12, 2024
1 parent
7914d27
commit 4a7488f
Showing
4 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<RootNamespace>LINQ___kniha</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace LINQ___kniha | ||
{ | ||
internal class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
List<Kniha> Knihy = new List<Kniha>() | ||
{ | ||
new Kniha { Autor = "Anna Maria", RokVydania = 2011, JePreDeti = true }, | ||
new Kniha { Autor = "Anna Hruskova",RokVydania = 2009, JePreDeti = false }, | ||
new Kniha { Autor = "Bob", RokVydania = 2022, JePreDeti = true }, | ||
new Kniha { Autor = "Charlie", RokVydania = 2018, JePreDeti = true }, | ||
new Kniha { Autor = "Bob", RokVydania = 2020 , JePreDeti = false}, | ||
}; | ||
|
||
|
||
List<Kniha> knihaJePreDeti = Knihy.Where(kniha => kniha.JePreDeti == true).ToList(); | ||
foreach (Kniha kniha in knihaJePreDeti) | ||
{ | ||
Console.WriteLine($" Autor: {kniha.Autor}, {kniha.RokVydania}. Je pre deti ? { kniha.JePreDeti}"); | ||
} | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace LINQ___kniha | ||
{ | ||
internal class Kniha | ||
{ | ||
public string Autor { get; set; } | ||
public int RokVydania { get; set; } | ||
public bool JePreDeti { get; set; } | ||
} | ||
} |