{"id":31727456,"url":"https://github.com/mikasjp/calculator","last_synced_at":"2026-04-17T13:32:57.207Z","repository":{"id":194735316,"uuid":"238548711","full_name":"mikasjp/Calculator","owner":"mikasjp","description":null,"archived":false,"fork":false,"pushed_at":"2020-02-06T20:53:14.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T06:24:58.338Z","etag":null,"topics":["csharp","dependency-injection","dotnet-core","example","logging","serilog"],"latest_commit_sha":null,"homepage":null,"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/mikasjp.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}},"created_at":"2020-02-05T21:06:16.000Z","updated_at":"2020-02-14T11:28:56.000Z","dependencies_parsed_at":"2023-09-14T23:26:46.005Z","dependency_job_id":null,"html_url":"https://github.com/mikasjp/Calculator","commit_stats":null,"previous_names":["mikasjp/calculator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikasjp/Calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikasjp%2FCalculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikasjp%2FCalculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikasjp%2FCalculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikasjp%2FCalculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikasjp","download_url":"https://codeload.github.com/mikasjp/Calculator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikasjp%2FCalculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31931434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["csharp","dependency-injection","dotnet-core","example","logging","serilog"],"created_at":"2025-10-09T06:23:39.060Z","updated_at":"2026-04-17T13:32:57.202Z","avatar_url":"https://github.com/mikasjp.png","language":"C#","readme":"# Calculator application\n\n## 1. Requirements\n\n* .NET Core 3.1\n\n## 2. Usage\n\nIn repository root type:\n\n```\ndotnet run --project Calculator.App/Calculator.App.csproj equation1 equation2 equationx\n```\n\nwhere equation1, equation2, equationx are equations to be calculated. For example:\n\n```\ndotnet run --project Calculator.App/Calculator.App.csproj 4+5*2 4+5/2 4+5/2-1\n```\n\nTo calculate more equations just pass more parameters.\n\nAlternatively, You can build the entire solution and use the compiled application.\n\n```\ndotnet build -c release -o Release\n```\n\n# 3. Configuration\n\nApplication configuration is stored in [`appSettings.json`](Calculator.App/appSettings.json) file.\n\n# 3.1 Application settings\n\nApplication settings are stored in `Calculator` section.\n\nThere are three calculator types supported. You can switch between them by changing `CalculatorTypeName` value in `Calculator` section. Supported values:\n\n* `Calculator.Logic.Implementations.Calculators.SimpleCalculator` - pure, native calculator build on top of few Linq expressions.\n* `Calculator.Logic.Implementations.Calculators.RoslynCalculator` - calculator based on [`Microsoft.CodeAnalysis.CSharp.Scripting`](https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp.Scripting/) package features. Equations are evaluated as C# code.\n\n* `Calculator.Logic.Implementations.Calculators.ExternalLibraryCalculator` - calculator based on [`MathParser.org-mXparser`](https://www.nuget.org/packages/MathParser.org-mXparser/) package.\n\n# 3.2 Logging settings\n\nLogger settings are stored in `Serilog` section.\n\nAs You may expect, application logging engine is based on [`Serilog`](https://www.nuget.org/packages/Serilog/2.9.1-dev-01154) package. You can configure it as it is referenced in [Serilog documentation](https://github.com/serilog/serilog-settings-configuration).\n\nI especially encourage you to change the default value `MinimumLevel` to `Debug` to see what is happening unther the hood.\n\n# 4. A little bit of the technical details\n\nThe application was developed to be modular and configurable. The application has been divided into two layers:\n\n* Logic Layer - the lowest layer which implements whole application logic.\n* Application Layer - The highest layer, which uses the functionality implemented in the logical layer.\n\nThis division enables the logic layer to be used in other applications.\n\nTo achieve modularity of the application, the dependency injection pattern was used. This enables easy extension of the application with additional types of calculators and equation validators.\n\nTests have been written for all key components of the logical layer. To create the tests, the XUnit framework and the Moq library were used.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikasjp%2Fcalculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikasjp%2Fcalculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikasjp%2Fcalculator/lists"}