Skip to content

Commit

Permalink
LINQ - kniha
Browse files Browse the repository at this point in the history
  • Loading branch information
moravcikj24 authored and moravcikj24 committed Nov 12, 2024
1 parent 7914d27 commit 4a7488f
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
17 changes: 16 additions & 1 deletion AppsLab.CSharp.Exercises.sln
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mesto a obcan", "Mesto a ob
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Autopozicovna", "Autopozicovnaň\Autopozicovna.csproj", "{D5127D7B-EA97-4E8B-AA94-C3CA1F3DEABB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINQ", "LINQ\LINQ.csproj", "{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINQ", "LINQ\LINQ.csproj", "{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINQ - kniha", "LINQ - kniha\LINQ - kniha.csproj", "{62B727AC-A174-466E-ABBF-5BB8F8929CEF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -733,6 +735,18 @@ Global
{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8}.Release|x64.Build.0 = Release|Any CPU
{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8}.Release|x86.ActiveCfg = Release|Any CPU
{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8}.Release|x86.Build.0 = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Debug|x64.ActiveCfg = Debug|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Debug|x64.Build.0 = Debug|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Debug|x86.ActiveCfg = Debug|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Debug|x86.Build.0 = Debug|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|Any CPU.Build.0 = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|x64.ActiveCfg = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|x64.Build.0 = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|x86.ActiveCfg = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -789,6 +803,7 @@ Global
{2E9A1963-6CE5-4581-A842-CE82EA1D43F1} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
{D5127D7B-EA97-4E8B-AA94-C3CA1F3DEABB} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
{62B727AC-A174-466E-ABBF-5BB8F8929CEF} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3C50C64B-7126-4A88-B950-9B6071C82736}
Expand Down
11 changes: 11 additions & 0 deletions LINQ - kniha/LINQ - kniha.csproj
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>
28 changes: 28 additions & 0 deletions LINQ - kniha/Program.cs
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}");
}
}


}
}
15 changes: 15 additions & 0 deletions LINQ - kniha/kniha.cs
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; }
}
}

0 comments on commit 4a7488f

Please sign in to comment.