{"id":28470726,"url":"https://github.com/atymri/linqsimulator","last_synced_at":"2025-10-23T21:56:02.391Z","repository":{"id":297318754,"uuid":"996403066","full_name":"atymri/LINQSimulator","owner":"atymri","description":"LINQ Simulator is an interactive C# console application designed to let you experiment with LINQ queries in real time. ","archived":false,"fork":false,"pushed_at":"2025-06-04T22:55:12.000Z","size":133,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-05T03:36:44.224Z","etag":null,"topics":["console","csharp","data","data-analysis","linq","query","sql"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atymri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-04T22:46:30.000Z","updated_at":"2025-06-05T00:03:43.000Z","dependencies_parsed_at":"2025-06-05T03:49:25.725Z","dependency_job_id":"0c34c48d-899b-4a84-b7b0-bb37a456aa57","html_url":"https://github.com/atymri/LINQSimulator","commit_stats":null,"previous_names":["atymri/linqsimulator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atymri/LINQSimulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymri%2FLINQSimulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymri%2FLINQSimulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymri%2FLINQSimulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymri%2FLINQSimulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atymri","download_url":"https://codeload.github.com/atymri/LINQSimulator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atymri%2FLINQSimulator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263033073,"owners_count":23403088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["console","csharp","data","data-analysis","linq","query","sql"],"created_at":"2025-06-07T10:06:13.363Z","updated_at":"2025-10-23T21:56:02.331Z","avatar_url":"https://github.com/atymri.png","language":"C#","readme":"# LINQ Simulator\n\nLINQ Simulator is an interactive C# console application designed to let you experiment with LINQ queries in real time. Instead of writing a full project and recompiling every time you want to tweak a query, this tool uses Roslyn scripting under the hood to dynamically compile and execute your lambda expressions against an in-memory collection of values.\n\n![LINQ Simulator Demo 1](https://github.com/atymri/LINQSimulator/blob/master/screenshot1.png)\n![LINQ Simulator Demo 2](https://github.com/atymri/LINQSimulator/blob/master/screenshot2.png)\n![LINQ Simulator Demo 3](https://github.com/atymri/LINQSimulator/blob/master/screenshot3.png)\n\n\n\n## How It Works\n\nBehind the scenes, the program:\n\n- Parses a comma-separated list of inputs (integers, doubles, or strings) and stores them as object values\n- Maintains an active \"current result\" collection, which can be transformed by executing commands like `filter`, `select`, `orderby`, `groupby`, `take`, `skip`, `distinct`, `any`, and `all`\n- Supports chaining multiple commands in sequence—every new operation pushes the previous state onto an undo stack, so you can type `undo`/`redo` to move backward or forward through your query history\n- Allows grouping with aggregates (e.g. `count`, `sum`, `avg`, `min`, `max`), and pretty-prints anonymous types or grouped results in the console\n- Exports the current result set as CSV or JSON files via a simple `export csv` or `export json` command\n\n## Dynamic Lambda Compilation\n\nBecause it uses `Microsoft.CodeAnalysis.CSharp.Scripting`, you can write lambdas like:\n\n```csharp\nfilter x =\u003e (int)x \u003e 10\nselect x =\u003e new { Value = x, Square = ((int)x) * ((int)x) }\ngroupby x =\u003e ((int)x) % 2 count\n```\n\nand see immediate results—no additional compilation steps required.\n\n## Project Structure\n\nOn the project page, you'll find:\n\n- A single Visual Studio solution with a console-app (`Program.cs`) that wires up the REPL loop and command parser\n- A `ScriptOptions` setup that pre-loads `System.Linq`, so all standard LINQ operators (`Where`, `Select`, `OrderBy`, etc.) are available at runtime\n- Helper methods for robust error handling (compilation errors are caught and reported, with hints about quoting string literals), plus logic to convert between int/double and string inputs automatically\n\n## How to Run\n\n1. Clone the repo and open it in Visual Studio (or any IDE that supports .NET Core)\n2. Add the following NuGet packages:\n   - `Microsoft.CodeAnalysis.CSharp.Scripting` (for dynamic lambda compilation)\n   - `Newtonsoft.Json` (for JSON export)\n3. Build and launch the console app. You'll be prompted to paste a list of comma-separated values\n4. After that, type `help` to see all available commands\n\n## Use Cases\n\nWhether you're learning LINQ for the first time or you simply want a convenient \"playground\" to prototype queries without writing full data models or setting up a database, LINQ Simulator makes it easy to explore filtering, projection, grouping, sorting, pagination, and more—all in one lightweight console tool.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatymri%2Flinqsimulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatymri%2Flinqsimulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatymri%2Flinqsimulator/lists"}