├── .gitignore ├── LINQTut08.Shared ├── Employee.cs ├── ExtensionFunctional.cs ├── LINQTut08.Shared.csproj └── Repository.cs ├── LINQTut08.sln └── LINQTut08 ├── LINQTut08.csproj └── Program.cs /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # Tye 66 | .tye/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.vspscc 97 | *.vssscc 98 | .builds 99 | *.pidb 100 | *.svclog 101 | *.scc 102 | 103 | # Chutzpah Test files 104 | _Chutzpah* 105 | 106 | # Visual C++ cache files 107 | ipch/ 108 | *.aps 109 | *.ncb 110 | *.opendb 111 | *.opensdf 112 | *.sdf 113 | *.cachefile 114 | *.VC.db 115 | *.VC.VC.opendb 116 | 117 | # Visual Studio profiler 118 | *.psess 119 | *.vsp 120 | *.vspx 121 | *.sap 122 | 123 | # Visual Studio Trace Files 124 | *.e2e 125 | 126 | # TFS 2012 Local Workspace 127 | $tf/ 128 | 129 | # Guidance Automation Toolkit 130 | *.gpState 131 | 132 | # ReSharper is a .NET coding add-in 133 | _ReSharper*/ 134 | *.[Rr]e[Ss]harper 135 | *.DotSettings.user 136 | 137 | # TeamCity is a build add-in 138 | _TeamCity* 139 | 140 | # DotCover is a Code Coverage Tool 141 | *.dotCover 142 | 143 | # AxoCover is a Code Coverage Tool 144 | .axoCover/* 145 | !.axoCover/settings.json 146 | 147 | # Coverlet is a free, cross platform Code Coverage Tool 148 | coverage*.json 149 | coverage*.xml 150 | coverage*.info 151 | 152 | # Visual Studio code coverage results 153 | *.coverage 154 | *.coveragexml 155 | 156 | # NCrunch 157 | _NCrunch_* 158 | .*crunch*.local.xml 159 | nCrunchTemp_* 160 | 161 | # MightyMoose 162 | *.mm.* 163 | AutoTest.Net/ 164 | 165 | # Web workbench (sass) 166 | .sass-cache/ 167 | 168 | # Installshield output folder 169 | [Ee]xpress/ 170 | 171 | # DocProject is a documentation generator add-in 172 | DocProject/buildhelp/ 173 | DocProject/Help/*.HxT 174 | DocProject/Help/*.HxC 175 | DocProject/Help/*.hhc 176 | DocProject/Help/*.hhk 177 | DocProject/Help/*.hhp 178 | DocProject/Help/Html2 179 | DocProject/Help/html 180 | 181 | # Click-Once directory 182 | publish/ 183 | 184 | # Publish Web Output 185 | *.[Pp]ublish.xml 186 | *.azurePubxml 187 | # Note: Comment the next line if you want to checkin your web deploy settings, 188 | # but database connection strings (with potential passwords) will be unencrypted 189 | *.pubxml 190 | *.publishproj 191 | 192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 193 | # checkin your Azure Web App publish settings, but sensitive information contained 194 | # in these scripts will be unencrypted 195 | PublishScripts/ 196 | 197 | # NuGet Packages 198 | *.nupkg 199 | # NuGet Symbol Packages 200 | *.snupkg 201 | # The packages folder can be ignored because of Package Restore 202 | **/[Pp]ackages/* 203 | # except build/, which is used as an MSBuild target. 204 | !**/[Pp]ackages/build/ 205 | # Uncomment if necessary however generally it will be regenerated when needed 206 | #!**/[Pp]ackages/repositories.config 207 | # NuGet v3's project.json files produces more ignorable files 208 | *.nuget.props 209 | *.nuget.targets 210 | 211 | # Microsoft Azure Build Output 212 | csx/ 213 | *.build.csdef 214 | 215 | # Microsoft Azure Emulator 216 | ecf/ 217 | rcf/ 218 | 219 | # Windows Store app package directories and files 220 | AppPackages/ 221 | BundleArtifacts/ 222 | Package.StoreAssociation.xml 223 | _pkginfo.txt 224 | *.appx 225 | *.appxbundle 226 | *.appxupload 227 | 228 | # Visual Studio cache files 229 | # files ending in .cache can be ignored 230 | *.[Cc]ache 231 | # but keep track of directories ending in .cache 232 | !?*.[Cc]ache/ 233 | 234 | # Others 235 | ClientBin/ 236 | ~$* 237 | *~ 238 | *.dbmdl 239 | *.dbproj.schemaview 240 | *.jfm 241 | *.pfx 242 | *.publishsettings 243 | orleans.codegen.cs 244 | 245 | # Including strong name files can present a security risk 246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 247 | #*.snk 248 | 249 | # Since there are multiple workflows, uncomment next line to ignore bower_components 250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 251 | #bower_components/ 252 | 253 | # RIA/Silverlight projects 254 | Generated_Code/ 255 | 256 | # Backup & report files from converting an old project file 257 | # to a newer Visual Studio version. Backup files are not needed, 258 | # because we have git ;-) 259 | _UpgradeReport_Files/ 260 | Backup*/ 261 | UpgradeLog*.XML 262 | UpgradeLog*.htm 263 | ServiceFabricBackup/ 264 | *.rptproj.bak 265 | 266 | # SQL Server files 267 | *.mdf 268 | *.ldf 269 | *.ndf 270 | 271 | # Business Intelligence projects 272 | *.rdl.data 273 | *.bim.layout 274 | *.bim_*.settings 275 | *.rptproj.rsuser 276 | *- [Bb]ackup.rdl 277 | *- [Bb]ackup ([0-9]).rdl 278 | *- [Bb]ackup ([0-9][0-9]).rdl 279 | 280 | # Microsoft Fakes 281 | FakesAssemblies/ 282 | 283 | # GhostDoc plugin setting file 284 | *.GhostDoc.xml 285 | 286 | # Node.js Tools for Visual Studio 287 | .ntvs_analysis.dat 288 | node_modules/ 289 | 290 | # Visual Studio 6 build log 291 | *.plg 292 | 293 | # Visual Studio 6 workspace options file 294 | *.opt 295 | 296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 297 | *.vbw 298 | 299 | # Visual Studio LightSwitch build output 300 | **/*.HTMLClient/GeneratedArtifacts 301 | **/*.DesktopClient/GeneratedArtifacts 302 | **/*.DesktopClient/ModelManifest.xml 303 | **/*.Server/GeneratedArtifacts 304 | **/*.Server/ModelManifest.xml 305 | _Pvt_Extensions 306 | 307 | # Paket dependency manager 308 | .paket/paket.exe 309 | paket-files/ 310 | 311 | # FAKE - F# Make 312 | .fake/ 313 | 314 | # CodeRush personal settings 315 | .cr/personal 316 | 317 | # Python Tools for Visual Studio (PTVS) 318 | __pycache__/ 319 | *.pyc 320 | 321 | # Cake - Uncomment if you are using it 322 | # tools/** 323 | # !tools/packages.config 324 | 325 | # Tabs Studio 326 | *.tss 327 | 328 | # Telerik's JustMock configuration file 329 | *.jmconfig 330 | 331 | # BizTalk build output 332 | *.btp.cs 333 | *.btm.cs 334 | *.odx.cs 335 | *.xsd.cs 336 | 337 | # OpenCover UI analysis results 338 | OpenCover/ 339 | 340 | # Azure Stream Analytics local run output 341 | ASALocalRun/ 342 | 343 | # MSBuild Binary and Structured Log 344 | *.binlog 345 | 346 | # NVidia Nsight GPU debugger configuration file 347 | *.nvuser 348 | 349 | # MFractors (Xamarin productivity tool) working folder 350 | .mfractor/ 351 | 352 | # Local History for Visual Studio 353 | .localhistory/ 354 | 355 | # BeatPulse healthcheck temp database 356 | healthchecksdb 357 | 358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 359 | MigrationBackup/ 360 | 361 | # Ionide (cross platform F# VS Code tools) working folder 362 | .ionide/ 363 | 364 | # Fody - auto-generated XML schema 365 | FodyWeavers.xsd 366 | 367 | ## 368 | ## Visual studio for Mac 369 | ## 370 | 371 | 372 | # globs 373 | Makefile.in 374 | *.userprefs 375 | *.usertasks 376 | config.make 377 | config.status 378 | aclocal.m4 379 | install-sh 380 | autom4te.cache/ 381 | *.tar.gz 382 | tarballs/ 383 | test-results/ 384 | 385 | # Mac bundle stuff 386 | *.dmg 387 | *.app 388 | 389 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore 390 | # General 391 | .DS_Store 392 | .AppleDouble 393 | .LSOverride 394 | 395 | # Icon must end with two \r 396 | Icon 397 | 398 | 399 | # Thumbnails 400 | ._* 401 | 402 | # Files that might appear in the root of a volume 403 | .DocumentRevisions-V100 404 | .fseventsd 405 | .Spotlight-V100 406 | .TemporaryItems 407 | .Trashes 408 | .VolumeIcon.icns 409 | .com.apple.timemachine.donotpresent 410 | 411 | # Directories potentially created on remote AFP share 412 | .AppleDB 413 | .AppleDesktop 414 | Network Trash Folder 415 | Temporary Items 416 | .apdisk 417 | 418 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore 419 | # Windows thumbnail cache files 420 | Thumbs.db 421 | ehthumbs.db 422 | ehthumbs_vista.db 423 | 424 | # Dump file 425 | *.stackdump 426 | 427 | # Folder config file 428 | [Dd]esktop.ini 429 | 430 | # Recycle Bin used on file shares 431 | $RECYCLE.BIN/ 432 | 433 | # Windows Installer files 434 | *.cab 435 | *.msi 436 | *.msix 437 | *.msm 438 | *.msp 439 | 440 | # Windows shortcuts 441 | *.lnk 442 | 443 | # JetBrains Rider 444 | .idea/ 445 | *.sln.iml 446 | 447 | ## 448 | ## Visual Studio Code 449 | ## 450 | .vscode/* 451 | !.vscode/settings.json 452 | !.vscode/tasks.json 453 | !.vscode/launch.json 454 | !.vscode/extensions.json 455 | -------------------------------------------------------------------------------- /LINQTut08.Shared/Employee.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | 4 | namespace LINQTut08.Shared 5 | { 6 | public class Employee 7 | { 8 | public Employee() { } 9 | public int Id { get; set; } 10 | 11 | public string FirstName { get; set; } 12 | 13 | public string LastName { get; set; } 14 | 15 | public DateTime HireDate { get; set; } 16 | 17 | public string Gender { get; set; } 18 | 19 | public string Department { get; set; } 20 | 21 | public bool HasHealthInsurance { get; set; } 22 | 23 | public bool HasPensionPlan { get; set; } 24 | 25 | public decimal Salary { get; set; } 26 | 27 | public override string ToString() 28 | { 29 | return 30 | string.Format($"" + 31 | $"{Id}\t" + 32 | $" {String.Concat(LastName, ", ", FirstName).PadRight(15, ' ')}\t" + 33 | $"{HireDate.Date.ToShortDateString()}\t" + 34 | $"{Gender.PadRight(10, ' ')}\t" + 35 | $"{Department.PadRight(10, ' ')}\t" + 36 | $"{HasHealthInsurance}\t" + 37 | $"{HasPensionPlan}\t" + 38 | $"${Salary.ToString("0.00")}"); 39 | } 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /LINQTut08.Shared/ExtensionFunctional.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace LINQTut08.Shared 6 | { 7 | public static class ExtensionFunctional 8 | { 9 | 10 | public static IEnumerable Filter 11 | (this IEnumerable source, Func predicate) 12 | { 13 | 14 | foreach (var employee in source) 15 | { 16 | if (predicate(employee)) 17 | { 18 | yield return employee; 19 | } 20 | } 21 | } 22 | 23 | public static void Print(this IEnumerable source, string title) 24 | { 25 | if (source == null) 26 | return; 27 | Console.WriteLine(); 28 | Console.WriteLine("┌───────────────────────────────────────────────────────┐"); 29 | Console.WriteLine($"│ {title.PadRight(52, ' ')}│"); 30 | Console.WriteLine("└───────────────────────────────────────────────────────┘"); 31 | Console.WriteLine(); 32 | foreach (var item in source) 33 | { 34 | if (typeof(T).IsValueType) 35 | Console.Write($" {item} "); // 1, 2, 3 36 | else 37 | Console.WriteLine(item); 38 | } 39 | 40 | 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /LINQTut08.Shared/LINQTut08.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LINQTut08.Shared/Repository.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace LINQTut08.Shared 6 | { 7 | public static class Repository 8 | { 9 | public static IEnumerable LoadEmployees() 10 | { 11 | return new List 12 | { 13 | new Employee 14 | { 15 | Id = 1001, 16 | FirstName = "Cochran", 17 | LastName = "Cole", 18 | HireDate = new DateTime(2017, 11, 2), 19 | Gender = "male", 20 | Department = "FINANCE", 21 | HasHealthInsurance = false, 22 | HasPensionPlan = true, 23 | Salary = 103200m 24 | }, 25 | new Employee 26 | { 27 | Id = 1002, 28 | FirstName = "Jaclyn", 29 | LastName = "Wolfe", 30 | HireDate = new DateTime(2018, 4, 14), 31 | Gender = "female", 32 | Department = "FINANCE", 33 | HasHealthInsurance = true, 34 | HasPensionPlan = false, 35 | Salary = 192400m 36 | }, 37 | new Employee 38 | { 39 | Id = 1003, 40 | FirstName = "Warner", 41 | LastName = "Jones", 42 | HireDate = new DateTime(2016, 12, 13), 43 | Gender = "male", 44 | Department = "IT", 45 | HasHealthInsurance = false, 46 | HasPensionPlan = false, 47 | Salary = 172800m 48 | }, 49 | new Employee 50 | { 51 | Id = 1004, 52 | FirstName = "Hester", 53 | LastName = "Evans", 54 | HireDate = new DateTime(2016, 8, 17), 55 | Gender = "male", 56 | Department = "FINANCE", 57 | HasHealthInsurance = true, 58 | HasPensionPlan = true, 59 | Salary = 155500m 60 | }, 61 | new Employee 62 | { 63 | Id = 1005, 64 | FirstName = "Wallace", 65 | LastName = "Buck", 66 | HireDate = new DateTime(2014, 5, 12), 67 | Gender = "male", 68 | Department = "IT", 69 | HasHealthInsurance = true, 70 | HasPensionPlan = false, 71 | Salary = 315800m 72 | }, 73 | new Employee 74 | { 75 | Id = 1006, 76 | FirstName = "Acevedo", 77 | LastName = "Wall", 78 | HireDate = new DateTime(2020, 10, 30), 79 | Gender = "male", 80 | Department = "IT", 81 | HasHealthInsurance = true, 82 | HasPensionPlan = false, 83 | Salary = 343700m 84 | }, 85 | new Employee 86 | { 87 | Id = 1007, 88 | FirstName = "Jacqueline", 89 | LastName = "Pickett", 90 | HireDate = new DateTime(2021, 2, 17), 91 | Gender = "female", 92 | Department = "IT", 93 | HasHealthInsurance = false, 94 | HasPensionPlan = false, 95 | Salary = 370000m 96 | }, 97 | new Employee 98 | { 99 | Id = 1008, 100 | FirstName = "Oconnor", 101 | LastName = "Espinoza", 102 | HireDate = new DateTime(2017, 3, 12), 103 | Gender = "male", 104 | Department = "HR", 105 | HasHealthInsurance = true, 106 | HasPensionPlan = false, 107 | Salary = 155600m 108 | }, 109 | new Employee 110 | { 111 | Id = 1009, 112 | FirstName = "Allie", 113 | LastName = "Elliott", 114 | HireDate = new DateTime(2020, 4, 20), 115 | Gender = "female", 116 | Department = "Accounting", 117 | HasHealthInsurance = false, 118 | HasPensionPlan = true, 119 | Salary = 315400m 120 | }, 121 | new Employee 122 | { 123 | Id = 1010, 124 | FirstName = "Elva", 125 | LastName = "Decker", 126 | HireDate = new DateTime(2016, 9, 6), 127 | Gender = "female", 128 | Department = "HR", 129 | HasHealthInsurance = true, 130 | HasPensionPlan = true, 131 | Salary = 345900m 132 | }, 133 | new Employee 134 | { 135 | Id = 1011, 136 | FirstName = "Hayes", 137 | LastName = "Beasley", 138 | HireDate = new DateTime(2020, 4, 25), 139 | Gender = "male", 140 | Department = "HR", 141 | HasHealthInsurance = false, 142 | HasPensionPlan = true, 143 | Salary = 372700m 144 | }, 145 | new Employee 146 | { 147 | Id = 1012, 148 | FirstName = "Florine", 149 | LastName = "Cervantes", 150 | HireDate = new DateTime(2015, 3, 25), 151 | Gender = "female", 152 | Department = "FINANCE", 153 | HasHealthInsurance = false, 154 | HasPensionPlan = true, 155 | Salary = 338700m 156 | }, 157 | new Employee 158 | { 159 | Id = 1013, 160 | FirstName = "Bullock", 161 | LastName = "Carney", 162 | HireDate = new DateTime(2017, 1, 3), 163 | Gender = "male", 164 | Department = "Accounting", 165 | HasHealthInsurance = false, 166 | HasPensionPlan = true, 167 | Salary = 214400m 168 | }, 169 | new Employee 170 | { 171 | Id = 1014, 172 | FirstName = "Carroll", 173 | LastName = "Cantu", 174 | HireDate = new DateTime(2021, 5, 26), 175 | Gender = "male", 176 | Department = "FINANCE", 177 | HasHealthInsurance = true, 178 | HasPensionPlan = false, 179 | Salary = 343200m 180 | }, 181 | new Employee 182 | { 183 | Id = 1015, 184 | FirstName = "Debra", 185 | LastName = "Hogan", 186 | HireDate = new DateTime(2019, 10, 4), 187 | Gender = "female", 188 | Department = "IT", 189 | HasHealthInsurance = false, 190 | HasPensionPlan = true, 191 | Salary = 249100m 192 | }, 193 | new Employee 194 | { 195 | Id = 1016, 196 | FirstName = "Winnie", 197 | LastName = "Mccall", 198 | HireDate = new DateTime(2019, 7, 17), 199 | Gender = "female", 200 | Department = "IT", 201 | HasHealthInsurance = true, 202 | HasPensionPlan = false, 203 | Salary = 287300m 204 | }, 205 | new Employee 206 | { 207 | Id = 1017, 208 | FirstName = "Manuela", 209 | LastName = "Berger", 210 | HireDate = new DateTime(2015, 12, 11), 211 | Gender = "female", 212 | Department = "IT", 213 | HasHealthInsurance = false, 214 | HasPensionPlan = true, 215 | Salary = 172500m 216 | }, 217 | new Employee 218 | { 219 | Id = 1018, 220 | FirstName = "Lakeisha", 221 | LastName = "Lowe", 222 | HireDate = new DateTime(2017, 1, 18), 223 | Gender = "female", 224 | Department = "IT", 225 | HasHealthInsurance = false, 226 | HasPensionPlan = true, 227 | Salary = 314300m 228 | }, 229 | new Employee 230 | { 231 | Id = 1019, 232 | FirstName = "Stewart", 233 | LastName = "Lott", 234 | HireDate = new DateTime(2016, 12, 12), 235 | Gender = "male", 236 | Department = "FINANCE", 237 | HasHealthInsurance = true, 238 | HasPensionPlan = true, 239 | Salary = 146600m 240 | }, 241 | new Employee 242 | { 243 | Id = 1020, 244 | FirstName = "Stafford", 245 | LastName = "Peck", 246 | HireDate = new DateTime(2014, 9, 25), 247 | Gender = "male", 248 | Department = "IT", 249 | HasHealthInsurance = true, 250 | HasPensionPlan = false, 251 | Salary = 320700m 252 | }, 253 | new Employee 254 | { 255 | Id = 1021, 256 | FirstName = "Barron", 257 | LastName = "Bird", 258 | HireDate = new DateTime(2020, 5, 18), 259 | Gender = "male", 260 | Department = "HR", 261 | HasHealthInsurance = false, 262 | HasPensionPlan = true, 263 | Salary = 151200m 264 | }, 265 | new Employee 266 | { 267 | Id = 1022, 268 | FirstName = "Nona", 269 | LastName = "Brooks", 270 | HireDate = new DateTime(2015, 12, 4), 271 | Gender = "female", 272 | Department = "IT", 273 | HasHealthInsurance = false, 274 | HasPensionPlan = true, 275 | Salary = 136500m 276 | }, 277 | new Employee 278 | { 279 | Id = 1023, 280 | FirstName = "Clara", 281 | LastName = "Reeves", 282 | HireDate = new DateTime(2014, 12, 6), 283 | Gender = "female", 284 | Department = "IT", 285 | HasHealthInsurance = true, 286 | HasPensionPlan = true, 287 | Salary = 245800m 288 | }, 289 | new Employee 290 | { 291 | Id = 1024, 292 | FirstName = "Karin", 293 | LastName = "Blanchard", 294 | HireDate = new DateTime(2018, 1, 20), 295 | Gender = "female", 296 | Department = "IT", 297 | HasHealthInsurance = false, 298 | HasPensionPlan = true, 299 | Salary = 341200m 300 | }, 301 | new Employee 302 | { 303 | Id = 1025, 304 | FirstName = "Burris", 305 | LastName = "Morgan", 306 | HireDate = new DateTime(2019, 7, 6), 307 | Gender = "male", 308 | Department = "Accounting", 309 | HasHealthInsurance = false, 310 | HasPensionPlan = false, 311 | Salary = 360300m 312 | }, 313 | new Employee 314 | { 315 | Id = 1026, 316 | FirstName = "Owen", 317 | LastName = "Cortez", 318 | HireDate = new DateTime(2021, 12, 9), 319 | Gender = "male", 320 | Department = "IT", 321 | HasHealthInsurance = false, 322 | HasPensionPlan = true, 323 | Salary = 193700m 324 | }, 325 | new Employee 326 | { 327 | Id = 1027, 328 | FirstName = "Letha", 329 | LastName = "Finch", 330 | HireDate = new DateTime(2016, 12, 18), 331 | Gender = "female", 332 | Department = "Accounting", 333 | HasHealthInsurance = true, 334 | HasPensionPlan = true, 335 | Salary = 357200m 336 | }, 337 | new Employee 338 | { 339 | Id = 1028, 340 | FirstName = "Sondra", 341 | LastName = "Rojas", 342 | HireDate = new DateTime(2016, 4, 22), 343 | Gender = "female", 344 | Department = "Accounting", 345 | HasHealthInsurance = true, 346 | HasPensionPlan = false, 347 | Salary = 309700m 348 | }, 349 | new Employee 350 | { 351 | Id = 1029, 352 | FirstName = "Hoover", 353 | LastName = "Cook", 354 | HireDate = new DateTime(2020, 12, 17), 355 | Gender = "male", 356 | Department = "HR", 357 | HasHealthInsurance = true, 358 | HasPensionPlan = true, 359 | Salary = 282200m 360 | }, 361 | new Employee 362 | { 363 | Id = 1030, 364 | FirstName = "Wanda", 365 | LastName = "Bender", 366 | HireDate = new DateTime(2021, 6, 17), 367 | Gender = "female", 368 | Department = "Accounting", 369 | HasHealthInsurance = true, 370 | HasPensionPlan = true, 371 | Salary = 294200m 372 | }, 373 | new Employee 374 | { 375 | Id = 1031, 376 | FirstName = "Sanford", 377 | LastName = "Craig", 378 | HireDate = new DateTime(2020, 2, 27), 379 | Gender = "male", 380 | Department = "Accounting", 381 | HasHealthInsurance = true, 382 | HasPensionPlan = true, 383 | Salary = 278200m 384 | }, 385 | new Employee 386 | { 387 | Id = 1032, 388 | FirstName = "Christy", 389 | LastName = "Middleton", 390 | HireDate = new DateTime(2021, 4, 2), 391 | Gender = "female", 392 | Department = "FINANCE", 393 | HasHealthInsurance = false, 394 | HasPensionPlan = false, 395 | Salary = 377400m 396 | }, 397 | new Employee 398 | { 399 | Id = 1033, 400 | FirstName = "Day", 401 | LastName = "Brady", 402 | HireDate = new DateTime(2019, 1, 23), 403 | Gender = "male", 404 | Department = "HR", 405 | HasHealthInsurance = true, 406 | HasPensionPlan = true, 407 | Salary = 142600m 408 | }, 409 | new Employee 410 | { 411 | Id = 1034, 412 | FirstName = "Powers", 413 | LastName = "Beard", 414 | HireDate = new DateTime(2014, 4, 25), 415 | Gender = "male", 416 | Department = "FINANCE", 417 | HasHealthInsurance = false, 418 | HasPensionPlan = true, 419 | Salary = 224000m 420 | }, 421 | new Employee 422 | { 423 | Id = 1035, 424 | FirstName = "Arline", 425 | LastName = "Pratt", 426 | HireDate = new DateTime(2017, 8, 12), 427 | Gender = "female", 428 | Department = "FINANCE", 429 | HasHealthInsurance = false, 430 | HasPensionPlan = true, 431 | Salary = 360300m 432 | }, 433 | new Employee 434 | { 435 | Id = 1036, 436 | FirstName = "Sharpe", 437 | LastName = "Cardenas", 438 | HireDate = new DateTime(2017, 11, 28), 439 | Gender = "male", 440 | Department = "Accounting", 441 | HasHealthInsurance = false, 442 | HasPensionPlan = true, 443 | Salary = 266100m 444 | }, 445 | new Employee 446 | { 447 | Id = 1037, 448 | FirstName = "Madeleine", 449 | LastName = "Stanton", 450 | HireDate = new DateTime(2020, 7, 17), 451 | Gender = "female", 452 | Department = "Accounting", 453 | HasHealthInsurance = true, 454 | HasPensionPlan = true, 455 | Salary = 198300m 456 | }, 457 | new Employee 458 | { 459 | Id = 1038, 460 | FirstName = "Spears", 461 | LastName = "Noble", 462 | HireDate = new DateTime(2014, 10, 6), 463 | Gender = "male", 464 | Department = "FINANCE", 465 | HasHealthInsurance = true, 466 | HasPensionPlan = false, 467 | Salary = 176300m 468 | }, 469 | new Employee 470 | { 471 | Id = 1039, 472 | FirstName = "Gonzalez", 473 | LastName = "Gilliam", 474 | HireDate = new DateTime(2021, 4, 29), 475 | Gender = "male", 476 | Department = "IT", 477 | HasHealthInsurance = false, 478 | HasPensionPlan = false, 479 | Salary = 394300m 480 | }, 481 | new Employee 482 | { 483 | Id = 1040, 484 | FirstName = "Abigail", 485 | LastName = "Bradford", 486 | HireDate = new DateTime(2018, 4, 2), 487 | Gender = "female", 488 | Department = "FINANCE", 489 | HasHealthInsurance = true, 490 | HasPensionPlan = false, 491 | Salary = 296100m 492 | }, 493 | new Employee 494 | { 495 | Id = 1041, 496 | FirstName = "Ashlee", 497 | LastName = "Farmer", 498 | HireDate = new DateTime(2020, 9, 24), 499 | Gender = "female", 500 | Department = "IT", 501 | HasHealthInsurance = false, 502 | HasPensionPlan = true, 503 | Salary = 125300m 504 | }, 505 | new Employee 506 | { 507 | Id = 1042, 508 | FirstName = "Glover", 509 | LastName = "Lloyd", 510 | HireDate = new DateTime(2014, 2, 15), 511 | Gender = "male", 512 | Department = "IT", 513 | HasHealthInsurance = true, 514 | HasPensionPlan = false, 515 | Salary = 123000m 516 | }, 517 | new Employee 518 | { 519 | Id = 1043, 520 | FirstName = "Cleo", 521 | LastName = "Mays", 522 | HireDate = new DateTime(2018, 4, 24), 523 | Gender = "female", 524 | Department = "IT", 525 | HasHealthInsurance = false, 526 | HasPensionPlan = false, 527 | Salary = 214900m 528 | }, 529 | new Employee 530 | { 531 | Id = 1044, 532 | FirstName = "Patrice", 533 | LastName = "House", 534 | HireDate = new DateTime(2021, 10, 16), 535 | Gender = "female", 536 | Department = "IT", 537 | HasHealthInsurance = false, 538 | HasPensionPlan = true, 539 | Salary = 124500m 540 | }, 541 | new Employee 542 | { 543 | Id = 1045, 544 | FirstName = "Atkins", 545 | LastName = "Shannon", 546 | HireDate = new DateTime(2015, 9, 26), 547 | Gender = "male", 548 | Department = "Accounting", 549 | HasHealthInsurance = true, 550 | HasPensionPlan = false, 551 | Salary = 136600m 552 | }, 553 | new Employee 554 | { 555 | Id = 1046, 556 | FirstName = "Luisa", 557 | LastName = "Hopkins", 558 | HireDate = new DateTime(2016, 8, 1), 559 | Gender = "female", 560 | Department = "Accounting", 561 | HasHealthInsurance = true, 562 | HasPensionPlan = true, 563 | Salary = 192900m 564 | }, 565 | new Employee 566 | { 567 | Id = 1047, 568 | FirstName = "Kaufman", 569 | LastName = "Gross", 570 | HireDate = new DateTime(2016, 7, 24), 571 | Gender = "male", 572 | Department = "IT", 573 | HasHealthInsurance = false, 574 | HasPensionPlan = true, 575 | Salary = 223600m 576 | }, 577 | new Employee 578 | { 579 | Id = 1048, 580 | FirstName = "William", 581 | LastName = "Clay", 582 | HireDate = new DateTime(2014, 8, 24), 583 | Gender = "male", 584 | Department = "HR", 585 | HasHealthInsurance = false, 586 | HasPensionPlan = true, 587 | Salary = 237500m 588 | }, 589 | new Employee 590 | { 591 | Id = 1049, 592 | FirstName = "Alison", 593 | LastName = "Kirby", 594 | HireDate = new DateTime(2014, 7, 14), 595 | Gender = "female", 596 | Department = "IT", 597 | HasHealthInsurance = false, 598 | HasPensionPlan = false, 599 | Salary = 354800m 600 | }, 601 | new Employee 602 | { 603 | Id = 1050, 604 | FirstName = "Morrow", 605 | LastName = "Lynch", 606 | HireDate = new DateTime(2014, 6, 4), 607 | Gender = "male", 608 | Department = "Accounting", 609 | HasHealthInsurance = false, 610 | HasPensionPlan = false, 611 | Salary = 281400m 612 | }, 613 | new Employee 614 | { 615 | Id = 1051, 616 | FirstName = "Roach", 617 | LastName = "Bright", 618 | HireDate = new DateTime(2019, 9, 14), 619 | Gender = "male", 620 | Department = "IT", 621 | HasHealthInsurance = true, 622 | HasPensionPlan = true, 623 | Salary = 326700m 624 | }, 625 | new Employee 626 | { 627 | Id = 1052, 628 | FirstName = "Carolyn", 629 | LastName = "Justice", 630 | HireDate = new DateTime(2019, 8, 29), 631 | Gender = "female", 632 | Department = "FINANCE", 633 | HasHealthInsurance = false, 634 | HasPensionPlan = false, 635 | Salary = 143100m 636 | }, 637 | new Employee 638 | { 639 | Id = 1053, 640 | FirstName = "Cathryn", 641 | LastName = "Mathews", 642 | HireDate = new DateTime(2016, 5, 31), 643 | Gender = "female", 644 | Department = "FINANCE", 645 | HasHealthInsurance = false, 646 | HasPensionPlan = true, 647 | Salary = 366000m 648 | }, 649 | new Employee 650 | { 651 | Id = 1054, 652 | FirstName = "Lindsay", 653 | LastName = "Pruitt", 654 | HireDate = new DateTime(2016, 6, 9), 655 | Gender = "female", 656 | Department = "Accounting", 657 | HasHealthInsurance = true, 658 | HasPensionPlan = false, 659 | Salary = 107300m 660 | }, 661 | new Employee 662 | { 663 | Id = 1055, 664 | FirstName = "Cummings", 665 | LastName = "Webster", 666 | HireDate = new DateTime(2016, 1, 24), 667 | Gender = "male", 668 | Department = "Accounting", 669 | HasHealthInsurance = true, 670 | HasPensionPlan = false, 671 | Salary = 222700m 672 | }, 673 | new Employee 674 | { 675 | Id = 1056, 676 | FirstName = "Cannon", 677 | LastName = "Pace", 678 | HireDate = new DateTime(2017, 7, 29), 679 | Gender = "male", 680 | Department = "Accounting", 681 | HasHealthInsurance = false, 682 | HasPensionPlan = true, 683 | Salary = 345000m 684 | }, 685 | new Employee 686 | { 687 | Id = 1057, 688 | FirstName = "Barber", 689 | LastName = "Singleton", 690 | HireDate = new DateTime(2017, 5, 8), 691 | Gender = "male", 692 | Department = "Accounting", 693 | HasHealthInsurance = false, 694 | HasPensionPlan = true, 695 | Salary = 192400m 696 | }, 697 | new Employee 698 | { 699 | Id = 1058, 700 | FirstName = "Aileen", 701 | LastName = "Sweet", 702 | HireDate = new DateTime(2018, 7, 4), 703 | Gender = "female", 704 | Department = "Accounting", 705 | HasHealthInsurance = false, 706 | HasPensionPlan = false, 707 | Salary = 262400m 708 | }, 709 | new Employee 710 | { 711 | Id = 1059, 712 | FirstName = "Lindsey", 713 | LastName = "Hughes", 714 | HireDate = new DateTime(2014, 4, 26), 715 | Gender = "male", 716 | Department = "FINANCE", 717 | HasHealthInsurance = true, 718 | HasPensionPlan = false, 719 | Salary = 370000m 720 | }, 721 | new Employee 722 | { 723 | Id = 1060, 724 | FirstName = "Stout", 725 | LastName = "Phillips", 726 | HireDate = new DateTime(2019, 6, 19), 727 | Gender = "male", 728 | Department = "FINANCE", 729 | HasHealthInsurance = true, 730 | HasPensionPlan = false, 731 | Salary = 151000m 732 | }, 733 | new Employee 734 | { 735 | Id = 1061, 736 | FirstName = "Benjamin", 737 | LastName = "Stephens", 738 | HireDate = new DateTime(2021, 5, 7), 739 | Gender = "male", 740 | Department = "Accounting", 741 | HasHealthInsurance = false, 742 | HasPensionPlan = true, 743 | Salary = 399600m 744 | }, 745 | new Employee 746 | { 747 | Id = 1062, 748 | FirstName = "Mandy", 749 | LastName = "Odom", 750 | HireDate = new DateTime(2018, 10, 28), 751 | Gender = "female", 752 | Department = "Accounting", 753 | HasHealthInsurance = true, 754 | HasPensionPlan = false, 755 | Salary = 226400m 756 | }, 757 | new Employee 758 | { 759 | Id = 1063, 760 | FirstName = "Hays", 761 | LastName = "Austin", 762 | HireDate = new DateTime(2017, 5, 28), 763 | Gender = "male", 764 | Department = "Accounting", 765 | HasHealthInsurance = true, 766 | HasPensionPlan = false, 767 | Salary = 292000m 768 | }, 769 | new Employee 770 | { 771 | Id = 1064, 772 | FirstName = "Jean", 773 | LastName = "Salas", 774 | HireDate = new DateTime(2020, 10, 27), 775 | Gender = "female", 776 | Department = "HR", 777 | HasHealthInsurance = false, 778 | HasPensionPlan = false, 779 | Salary = 211600m 780 | }, 781 | new Employee 782 | { 783 | Id = 1065, 784 | FirstName = "Luann", 785 | LastName = "Hubbard", 786 | HireDate = new DateTime(2021, 7, 17), 787 | Gender = "female", 788 | Department = "HR", 789 | HasHealthInsurance = true, 790 | HasPensionPlan = true, 791 | Salary = 301600m 792 | }, 793 | new Employee 794 | { 795 | Id = 1066, 796 | FirstName = "Eaton", 797 | LastName = "Lyons", 798 | HireDate = new DateTime(2021, 7, 3), 799 | Gender = "male", 800 | Department = "IT", 801 | HasHealthInsurance = false, 802 | HasPensionPlan = false, 803 | Salary = 237600m 804 | }, 805 | new Employee 806 | { 807 | Id = 1067, 808 | FirstName = "Beck", 809 | LastName = "Ortiz", 810 | HireDate = new DateTime(2015, 5, 13), 811 | Gender = "male", 812 | Department = "HR", 813 | HasHealthInsurance = true, 814 | HasPensionPlan = false, 815 | Salary = 192900m 816 | }, 817 | new Employee 818 | { 819 | Id = 1068, 820 | FirstName = "Patty", 821 | LastName = "Knight", 822 | HireDate = new DateTime(2017, 8, 22), 823 | Gender = "female", 824 | Department = "IT", 825 | HasHealthInsurance = false, 826 | HasPensionPlan = false, 827 | Salary = 173100m 828 | }, 829 | new Employee 830 | { 831 | Id = 1069, 832 | FirstName = "Bowman", 833 | LastName = "Hampton", 834 | HireDate = new DateTime(2017, 10, 10), 835 | Gender = "male", 836 | Department = "IT", 837 | HasHealthInsurance = true, 838 | HasPensionPlan = true, 839 | Salary = 145200m 840 | }, 841 | new Employee 842 | { 843 | Id = 1070, 844 | FirstName = "Pace", 845 | LastName = "Bryant", 846 | HireDate = new DateTime(2019, 3, 1), 847 | Gender = "male", 848 | Department = "HR", 849 | HasHealthInsurance = false, 850 | HasPensionPlan = true, 851 | Salary = 160100m 852 | }, 853 | new Employee 854 | { 855 | Id = 1071, 856 | FirstName = "Watts", 857 | LastName = "Green", 858 | HireDate = new DateTime(2016, 10, 17), 859 | Gender = "male", 860 | Department = "FINANCE", 861 | HasHealthInsurance = true, 862 | HasPensionPlan = true, 863 | Salary = 330300m 864 | }, 865 | new Employee 866 | { 867 | Id = 1072, 868 | FirstName = "Sonia", 869 | LastName = "Clarke", 870 | HireDate = new DateTime(2014, 9, 15), 871 | Gender = "female", 872 | Department = "Accounting", 873 | HasHealthInsurance = true, 874 | HasPensionPlan = true, 875 | Salary = 201800m 876 | }, 877 | new Employee 878 | { 879 | Id = 1073, 880 | FirstName = "Donovan", 881 | LastName = "Brennan", 882 | HireDate = new DateTime(2018, 5, 18), 883 | Gender = "male", 884 | Department = "FINANCE", 885 | HasHealthInsurance = false, 886 | HasPensionPlan = false, 887 | Salary = 243600m 888 | }, 889 | new Employee 890 | { 891 | Id = 1074, 892 | FirstName = "Rutledge", 893 | LastName = "Harris", 894 | HireDate = new DateTime(2016, 7, 10), 895 | Gender = "male", 896 | Department = "IT", 897 | HasHealthInsurance = true, 898 | HasPensionPlan = false, 899 | Salary = 153300m 900 | }, 901 | new Employee 902 | { 903 | Id = 1075, 904 | FirstName = "Buckley", 905 | LastName = "Meyers", 906 | HireDate = new DateTime(2021, 10, 16), 907 | Gender = "male", 908 | Department = "FINANCE", 909 | HasHealthInsurance = true, 910 | HasPensionPlan = false, 911 | Salary = 342000m 912 | }, 913 | new Employee 914 | { 915 | Id = 1076, 916 | FirstName = "Reynolds", 917 | LastName = "Hammond", 918 | HireDate = new DateTime(2019, 10, 9), 919 | Gender = "male", 920 | Department = "Accounting", 921 | HasHealthInsurance = true, 922 | HasPensionPlan = true, 923 | Salary = 232600m 924 | }, 925 | new Employee 926 | { 927 | Id = 1077, 928 | FirstName = "Butler", 929 | LastName = "Bowen", 930 | HireDate = new DateTime(2019, 8, 13), 931 | Gender = "male", 932 | Department = "HR", 933 | HasHealthInsurance = false, 934 | HasPensionPlan = false, 935 | Salary = 239100m 936 | }, 937 | new Employee 938 | { 939 | Id = 1078, 940 | FirstName = "Karina", 941 | LastName = "Miles", 942 | HireDate = new DateTime(2018, 11, 20), 943 | Gender = "female", 944 | Department = "IT", 945 | HasHealthInsurance = false, 946 | HasPensionPlan = true, 947 | Salary = 185500m 948 | }, 949 | new Employee 950 | { 951 | Id = 1079, 952 | FirstName = "Fulton", 953 | LastName = "Conner", 954 | HireDate = new DateTime(2018, 7, 12), 955 | Gender = "male", 956 | Department = "Accounting", 957 | HasHealthInsurance = false, 958 | HasPensionPlan = false, 959 | Salary = 198100m 960 | }, 961 | new Employee 962 | { 963 | Id = 1080, 964 | FirstName = "Jewell", 965 | LastName = "Tran", 966 | HireDate = new DateTime(2019, 6, 22), 967 | Gender = "female", 968 | Department = "HR", 969 | HasHealthInsurance = true, 970 | HasPensionPlan = false, 971 | Salary = 264800m 972 | }, 973 | new Employee 974 | { 975 | Id = 1081, 976 | FirstName = "Avis", 977 | LastName = "Herrera", 978 | HireDate = new DateTime(2017, 11, 17), 979 | Gender = "female", 980 | Department = "Accounting", 981 | HasHealthInsurance = false, 982 | HasPensionPlan = true, 983 | Salary = 298800m 984 | }, 985 | new Employee 986 | { 987 | Id = 1082, 988 | FirstName = "Nora", 989 | LastName = "Dale", 990 | HireDate = new DateTime(2021, 7, 26), 991 | Gender = "female", 992 | Department = "IT", 993 | HasHealthInsurance = false, 994 | HasPensionPlan = false, 995 | Salary = 368900m 996 | }, 997 | new Employee 998 | { 999 | Id = 1083, 1000 | FirstName = "Hillary", 1001 | LastName = "Duran", 1002 | HireDate = new DateTime(2017, 2, 19), 1003 | Gender = "female", 1004 | Department = "Accounting", 1005 | HasHealthInsurance = false, 1006 | HasPensionPlan = false, 1007 | Salary = 282200m 1008 | }, 1009 | new Employee 1010 | { 1011 | Id = 1084, 1012 | FirstName = "Hamilton", 1013 | LastName = "Macias", 1014 | HireDate = new DateTime(2017, 10, 21), 1015 | Gender = "male", 1016 | Department = "HR", 1017 | HasHealthInsurance = false, 1018 | HasPensionPlan = true, 1019 | Salary = 237300m 1020 | }, 1021 | new Employee 1022 | { 1023 | Id = 1085, 1024 | FirstName = "Kent", 1025 | LastName = "Parsons", 1026 | HireDate = new DateTime(2018, 3, 30), 1027 | Gender = "male", 1028 | Department = "HR", 1029 | HasHealthInsurance = true, 1030 | HasPensionPlan = false, 1031 | Salary = 176400m 1032 | }, 1033 | new Employee 1034 | { 1035 | Id = 1086, 1036 | FirstName = "Dunn", 1037 | LastName = "Oliver", 1038 | HireDate = new DateTime(2018, 9, 3), 1039 | Gender = "male", 1040 | Department = "Accounting", 1041 | HasHealthInsurance = false, 1042 | HasPensionPlan = false, 1043 | Salary = 244400m 1044 | }, 1045 | new Employee 1046 | { 1047 | Id = 1087, 1048 | FirstName = "Betsy", 1049 | LastName = "Dean", 1050 | HireDate = new DateTime(2018, 11, 23), 1051 | Gender = "female", 1052 | Department = "IT", 1053 | HasHealthInsurance = false, 1054 | HasPensionPlan = false, 1055 | Salary = 196900m 1056 | }, 1057 | new Employee 1058 | { 1059 | Id = 1088, 1060 | FirstName = "Kay", 1061 | LastName = "May", 1062 | HireDate = new DateTime(2020, 9, 8), 1063 | Gender = "female", 1064 | Department = "Accounting", 1065 | HasHealthInsurance = false, 1066 | HasPensionPlan = true, 1067 | Salary = 224000m 1068 | }, 1069 | new Employee 1070 | { 1071 | Id = 1089, 1072 | FirstName = "Farley", 1073 | LastName = "Bartlett", 1074 | HireDate = new DateTime(2014, 7, 3), 1075 | Gender = "male", 1076 | Department = "IT", 1077 | HasHealthInsurance = true, 1078 | HasPensionPlan = false, 1079 | Salary = 369600m 1080 | }, 1081 | new Employee 1082 | { 1083 | Id = 1090, 1084 | FirstName = "Agnes", 1085 | LastName = "Riggs", 1086 | HireDate = new DateTime(2016, 11, 20), 1087 | Gender = "female", 1088 | Department = "Sales", 1089 | HasHealthInsurance = true, 1090 | HasPensionPlan = true, 1091 | Salary = 106800m 1092 | }, 1093 | new Employee 1094 | { 1095 | Id = 1091, 1096 | FirstName = "White", 1097 | LastName = "Figueroa", 1098 | HireDate = new DateTime(2014, 6, 30), 1099 | Gender = "male", 1100 | Department = "HR", 1101 | HasHealthInsurance = false, 1102 | HasPensionPlan = true, 1103 | Salary = 226400m 1104 | }, 1105 | new Employee 1106 | { 1107 | Id = 1092, 1108 | FirstName = "Estes", 1109 | LastName = "Stone", 1110 | HireDate = new DateTime(2016, 7, 10), 1111 | Gender = "male", 1112 | Department = "Sales", 1113 | HasHealthInsurance = false, 1114 | HasPensionPlan = false, 1115 | Salary = 293800m 1116 | }, 1117 | new Employee 1118 | { 1119 | Id = 1093, 1120 | FirstName = "Julia", 1121 | LastName = "Contreras", 1122 | HireDate = new DateTime(2017, 7, 1), 1123 | Gender = "female", 1124 | Department = "FINANCE", 1125 | HasHealthInsurance = false, 1126 | HasPensionPlan = false, 1127 | Salary = 203800m 1128 | }, 1129 | new Employee 1130 | { 1131 | Id = 1094, 1132 | FirstName = "Cecilia", 1133 | LastName = "Cooper", 1134 | HireDate = new DateTime(2017, 3, 31), 1135 | Gender = "female", 1136 | Department = "FINANCE", 1137 | HasHealthInsurance = false, 1138 | HasPensionPlan = true, 1139 | Salary = 329400m 1140 | }, 1141 | new Employee 1142 | { 1143 | Id = 1095, 1144 | FirstName = "Zelma", 1145 | LastName = "Frank", 1146 | HireDate = new DateTime(2015, 11, 29), 1147 | Gender = "female", 1148 | Department = "Accounting", 1149 | HasHealthInsurance = false, 1150 | HasPensionPlan = false, 1151 | Salary = 311100m 1152 | }, 1153 | new Employee 1154 | { 1155 | Id = 1096, 1156 | FirstName = "Peters", 1157 | LastName = "Morales", 1158 | HireDate = new DateTime(2021, 5, 19), 1159 | Gender = "male", 1160 | Department = "FINANCE", 1161 | HasHealthInsurance = true, 1162 | HasPensionPlan = true, 1163 | Salary = 120300m 1164 | }, 1165 | new Employee 1166 | { 1167 | Id = 1097, 1168 | FirstName = "Leigh", 1169 | LastName = "Moss", 1170 | HireDate = new DateTime(2016, 8, 2), 1171 | Gender = "female", 1172 | Department = "FINANCE", 1173 | HasHealthInsurance = false, 1174 | HasPensionPlan = true, 1175 | Salary = 167100m 1176 | }, 1177 | new Employee 1178 | { 1179 | Id = 1098, 1180 | FirstName = "Megan", 1181 | LastName = "Bailey", 1182 | HireDate = new DateTime(2014, 3, 4), 1183 | Gender = "female", 1184 | Department = "FINANCE", 1185 | HasHealthInsurance = true, 1186 | HasPensionPlan = false, 1187 | Salary = 232500m 1188 | }, 1189 | new Employee 1190 | { 1191 | Id = 1099, 1192 | FirstName = "Juliana", 1193 | LastName = "Pope", 1194 | HireDate = new DateTime(2020, 7, 3), 1195 | Gender = "female", 1196 | Department = "FINANCE", 1197 | HasHealthInsurance = false, 1198 | HasPensionPlan = false, 1199 | Salary = 305300m 1200 | }, 1201 | new Employee 1202 | { 1203 | Id = 1100, 1204 | FirstName = "Cervantes", 1205 | LastName = "Wong", 1206 | HireDate = new DateTime(2019, 11, 8), 1207 | Gender = "male", 1208 | Department = "IT", 1209 | HasHealthInsurance = false, 1210 | HasPensionPlan = false, 1211 | Salary = 235100m 1212 | } 1213 | }; 1214 | } 1215 | } 1216 | } 1217 | -------------------------------------------------------------------------------- /LINQTut08.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.32014.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINQTut08", "LINQTut08\LINQTut08.csproj", "{5DED50F1-E633-4B69-94C1-E06538581A1D}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINQTut08.Shared", "LINQTut08.Shared\LINQTut08.Shared.csproj", "{155679CC-B753-48F5-8B00-BD7E7F42F986}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {5DED50F1-E633-4B69-94C1-E06538581A1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {5DED50F1-E633-4B69-94C1-E06538581A1D}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {5DED50F1-E633-4B69-94C1-E06538581A1D}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {5DED50F1-E633-4B69-94C1-E06538581A1D}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {155679CC-B753-48F5-8B00-BD7E7F42F986}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {155679CC-B753-48F5-8B00-BD7E7F42F986}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {155679CC-B753-48F5-8B00-BD7E7F42F986}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {155679CC-B753-48F5-8B00-BD7E7F42F986}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {3F2B2BF5-43A4-44B5-9515-47A2426432D1} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /LINQTut08/LINQTut08.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /LINQTut08/Program.cs: -------------------------------------------------------------------------------- 1 | using LINQTut08.Shared; 2 | using System; 3 | using System.Linq; 4 | 5 | namespace LINQTut08 6 | { 7 | internal class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | RunGroupByExample(); 12 | RunLookupExample(); 13 | RunGroupByWithQuerySyntax(); 14 | Console.ReadKey(); 15 | } 16 | 17 | private static void RunGroupByExample() 18 | { 19 | Console.WriteLine(); 20 | Console.WriteLine("+++++++++++++++++++++++"); 21 | Console.WriteLine("GroupBy (Method Syntax"); 22 | Console.WriteLine("+++++++++++++++++++++++"); 23 | Console.WriteLine(); 24 | 25 | var employees = Repository.LoadEmployees(); 26 | var result = employees.GroupBy(x => x.Department); 27 | foreach (var item in result) 28 | { 29 | item.Print($"Employee in '{item.Key}' Department"); 30 | } 31 | } 32 | 33 | private static void RunLookupExample() 34 | { 35 | Console.WriteLine(); 36 | Console.WriteLine("+++++++++++++++++++++++"); 37 | Console.WriteLine("ToLookup (Method Syntax"); 38 | Console.WriteLine("+++++++++++++++++++++++"); 39 | Console.WriteLine(); 40 | 41 | var employees = Repository.LoadEmployees(); 42 | var result = employees.ToLookup(x => x.Department); 43 | foreach (var item in result) 44 | { 45 | item.Print($"Employee in '{item.Key}' Department"); 46 | } 47 | } 48 | 49 | private static void RunGroupByWithQuerySyntax() 50 | { 51 | Console.WriteLine(); 52 | Console.WriteLine("+++++++++++++++++++++++"); 53 | Console.WriteLine("GroupBy (Query Syntax"); 54 | Console.WriteLine("+++++++++++++++++++++++"); 55 | Console.WriteLine(); 56 | 57 | var employees = Repository.LoadEmployees(); 58 | var result = from emp in employees 59 | group emp by emp.Department; 60 | 61 | foreach (var item in result) 62 | { 63 | item.Print($"Employee in '{item.Key}' Department"); 64 | } 65 | } 66 | } 67 | } 68 | --------------------------------------------------------------------------------