{"id":22324602,"url":"https://github.com/bariscantanriverdi/bctsp","last_synced_at":"2025-09-10T08:06:12.150Z","repository":{"id":167626788,"uuid":"643246604","full_name":"adessoTurkey-dotNET/BctSP","owner":"adessoTurkey-dotNET","description":"This project has been developed with the .NET Standard 2.1. It allows you to call stored procedures and functions from the database by simply creating only the interface and methods signature without needing any concrete class to call any stored procedure and function.","archived":false,"fork":false,"pushed_at":"2023-08-16T07:58:41.000Z","size":64,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-27T06:04:41.027Z","etag":null,"topics":["nuget","oracle-database","orm","postgresql","sql-server","stored-procedures"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adessoTurkey-dotNET.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-05-20T14:58:44.000Z","updated_at":"2023-09-12T22:02:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf4d03a4-a114-406d-9767-5a133eecb92b","html_url":"https://github.com/adessoTurkey-dotNET/BctSP","commit_stats":null,"previous_names":["bariscantanriverdi/bctsp"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoTurkey-dotNET%2FBctSP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoTurkey-dotNET%2FBctSP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoTurkey-dotNET%2FBctSP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adessoTurkey-dotNET%2FBctSP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adessoTurkey-dotNET","download_url":"https://codeload.github.com/adessoTurkey-dotNET/BctSP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228030086,"owners_count":17858432,"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":["nuget","oracle-database","orm","postgresql","sql-server","stored-procedures"],"created_at":"2024-12-04T02:07:57.532Z","updated_at":"2024-12-04T02:07:59.593Z","avatar_url":"https://github.com/adessoTurkey-dotNET.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BctSP\n\nThis project has been developed with the .NET Standard 2.1.\nIt allows you to call stored procedures and functions from the database by simply creating only the interface and methods signature without needing any concrete class to call any stored procedure and function.\n**It can work async and sync. It provides stored procedure and function support for MsSQL, MySQL, PostgreSQL and OracleSQL**\n\n# Installation\n\nBctSP is now available on NuGet. \nIf interested, you can easily install it using the NuGet Package Manager. It can be accessed through the link https://www.nuget.org/packages/BctSP.\n\n# Usage\n\n_To utilize the BctSP NuGet package, you can follow these phases:_\n\n- Add BctSP service to your application builder in Program.cs and set BctSpConnectionStringOrConfigurationPath and DatabaseType for database connection, which can be MsSQL, MySQL, PostgreSQL, OracleSQL.\n\n```cs\nbuilder.Services.AddBctSp((x) =\u003e\n{\n    // x.BctSpConnectionStringOrConfigurationPath = \"Server=...\";\n    x.BctSpConnectionStringOrConfigurationPath = \"Databases:ConnectionString\";\n    x.DatabaseType = BctSpDatabaseType.PostgreSql;\n});\n```\n\n- Create a request that inherits from the BctSpBaseRequest. The generic argument of the BctSpBaseRequest should be the response type of the request that inherits BctSpBaseResponse.\n- The request should have a class attributes whichs arguments should be sp/function name and command type.\n\n```cs\n    [BctSpAttribute(\"GetProductsByPrice\", BctSP.Enums.BctSpCommandType.StoredProcedure)]\n    public class GetProductsByPriceRequest : BctSpBaseRequest\u003cGetProductsByPriceResponse\u003e\n    {\n        public decimal ProductPrice { get; set; }\n    }\n```\n\n_Customized Usage_  \nThe database configuration can be overridden and customized for each request if needed.\n\n```cs\n    [BctSpAttribute(\"GetProductsByPrice\", BctSP.Enums.BctSpCommandType.StoredProcedure,\"CustomDatabases:ConnectionString\",BctSP.Enums.BctSpDatabaseType.MsSql))]\n    public class GetProductsByPriceRequest : BctSpBaseRequest\u003cGetProductsByPriceResponse\u003e\n    {\n        public decimal ProductPrice { get; set; }\n    }\n\n    //[BctSpAttribute(\"GetProductsByPrice\", BctSP.Enums.BctSpCommandType.StoredProcedure,\"Server=...\",,BctSP.Enums.BctSpDatabaseType.MsSql))]\n    //public class GetProductsByPriceRequest : BctSpBaseRequest\u003cGetProductsByPriceResponse\u003e\n    //{\n    //    public decimal ProductPrice { get; set; }\n    //}\n\n```\n\n- Create a response that inherits from the BctSpBaseResponse.\n\n```cs\n\tpublic class GetProductsByPriceResponse : BctSpBaseResponse\n\t{\n\n\t\tpublic string ProductName { get; set; }\n\n\t\tpublic decimal ProductPrice { get; set; }\n\n\t\tpublic string ProductDescription { get; set; }\n\t}\n```\n\n- Create an interface that implements IBctSp and has method signatures.\n\n```cs\n\tpublic interface ISampleSP : IBctSp\n\t{\n\t \n\t\tList\u003cGetProductsByPriceResponse\u003e GetProductsByPrice(GetProductsByPriceRequest request);\n\t \n\t\tTask\u003cList\u003cGetProductsByPriceResponse\u003e\u003e GetProductsByPriceAsync(GetProductsByPriceRequest request);\n\n\t}\n```\n\n\n- Get the interface with the Dependency Injection pattern.\n\n\n```cs    \npublic class WeatherForecastController\n{\n    private readonly ISampleSP _sampleSp;\n\n    public WeatherForecastController(ISampleSP sampleSp)\n    {\n        _sampleSp = sampleSp;\n    }\n```\n\n_Sample Usage_\n\n```cs\n        public List\u003cGetProductsByPriceResponse\u003e GetProductsByPrice()\n        {\n            var response = _sampleSp.GetProductsByPrice(new GetProductsByPriceRequest{ ProductPrice = 100 });\n\n            return response;\n        }\n\n        public async Task\u003cList\u003cGetProductsByPriceResponse\u003e\u003e GetProductsByPriceAsync()\n        {\n            var response = await _sampleSp.GetProductsByPriceAsync(new GetProductsByPriceRequest{ ProductPrice = 100 });\n\n            return response;\n        }\n```\n\n------------\n\n***Contributors***\n\n\u003ca href=\"https://github.com/adessoTurkey-dotNET/Bctsp/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=adessoTurkey-dotNET/Bctsp\" /\u003e\n\u003c/a\u003e\n\n------------\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbariscantanriverdi%2Fbctsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbariscantanriverdi%2Fbctsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbariscantanriverdi%2Fbctsp/lists"}