Giter Site home page Giter Site logo

thisismck / linq-example Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 257 KB

This project demonstrates the use of Language Integrated Query (LINQ) in C# to perform various operations on collections of data. It includes examples of filtering, joining, and aggregating data using LINQ queries.

C# 100.00%

linq-example's Introduction

LINQ Example Project

This project demonstrates the use of Language Integrated Query (LINQ) in C# to perform various operations on collections of data. It includes examples of filtering, joining, and aggregating data using LINQ queries.

Getting Started

To get started with this project, clone the repository to your local machine.

Prerequisites

  • .NET Core 3.1 or later
  • Basic understanding of C# and LINQ

Running the Program

Navigate to the project directory and run the program using the .NET CLI:

Features

This example includes the following LINQ operations:

  • Filtering: Demonstrates filtering a list of employees to find employees with an annual salary less than a certain threshold.
  • Joining: Shows how to perform inner joins between two collections (employees and departments) to display detailed employee information.
  • Aggregation: Calculates and displays the average, highest, and lowest annual salaries from a list of employees.

Code Explanation

  • Data.GetEmployees() and Data.GetDepartments() methods simulate fetching data from a data source, returning lists of Employee and Department objects, respectively.
  • The main functionality is demonstrated in the Main method, where LINQ queries are used to filter, join, and aggregate data.
  • First, an inner join is performed between the employee list and the department list to display detailed information about each employee.
  • Then, average, highest, and lowest annual salaries are calculated using aggregation functions provided by LINQ.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any improvements or fixes.

License

This project is not licensed.

Acknowledgments

  • This project uses fictional data for demonstration purposes.
  • Thanks to the .NET community for providing extensive documentation and resources on LINQ.

linq-example's People

Contributors

thisismck avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.