{"id":1548,"date":"2023-10-29T23:55:50","date_gmt":"2023-10-29T21:55:50","guid":{"rendered":"https:\/\/epicmarketing.co.il\/notebook\/?p=1548"},"modified":"2023-10-30T10:39:28","modified_gmt":"2023-10-30T08:39:28","slug":"asp-net-web-api-crud-operation-using-sql-server-stored-procedures","status":"publish","type":"post","link":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/","title":{"rendered":"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u05d4\u05e8\u05d0\u05d4 \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1-Stored Procedures \u05d1\u05ea\u05d5\u05da C# API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05d9\u05e6\u05d5\u05e8 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05de\u05e0\u05ea \u05e9\u05e0\u05d5\u05db\u05dc \u05dc\u05e2\u05d1\u05d5\u05d3 \u05e2\u05dc\u05d9\u05d4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u05d9\u05e6\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05d7\u05d3\u05e9\u05d4<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"263\" src=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-1024x263.png\" alt=\"\" class=\"wp-image-1549\" srcset=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-1024x263.png 1024w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-300x77.png 300w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-768x198.png 768w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-1536x395.png 1536w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table.png 1916w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE TABLE TestEmployee(ID int Identity(1,1) Primary Key, \n    Name varchar(100), Age int, Active int)\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05d4\u05e8\u05e6\u05ea \u05d4-query \u05e2\u05dc \u05d9\u05d3\u05d9 F5.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05e0\u05e1\u05d4 \u05dc\u05d4\u05d1\u05d9\u05d0 \u05d0\u05ea \u05d4\u05de\u05d9\u05d3\u05e2 \u05de\u05d4\u05d8\u05d1\u05dc\u05d4, \u05db\u05de\u05d5\u05d1\u05df \u05e9\u05d4\u05d5\u05d0 \u05d9\u05d2\u05d9\u05e2 \u05e8\u05d9\u05e7, \u05db\u05d9 \u05e2\u05db\u05e9\u05d9\u05d5 \u05d9\u05e6\u05e8\u05e0\u05d5 \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT * FROM TestEmployee\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u05d9\u05e6\u05d9\u05e8\u05ea \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 VS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05e2\u05d1\u05d5\u05e8 \u05dc-Visual Studio \u05d5\u05e0\u05d9\u05e6\u05d5\u05e8 \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 \u05d7\u05d3\u05e9.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"304\" src=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-dotnet-project-1024x304.png\" alt=\"\" class=\"wp-image-1550\" srcset=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-dotnet-project-1024x304.png 1024w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-dotnet-project-300x89.png 300w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-dotnet-project-768x228.png 768w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-dotnet-project.png 1236w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e0\u05d1\u05e6\u05e2 5 \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4-API. \u05d1\u05d7\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05e9\u05dc\u05de\u05d4, \u05d1\u05d7\u05d9\u05e8\u05ea \u05e8\u05e9\u05d5\u05de\u05d4 \u05e2\u05dc \u05e4\u05d9 ID, \u05d9\u05e6\u05d9\u05e8\u05ea \u05e8\u05e9\u05d5\u05de\u05d4 \u05d7\u05d3\u05e9\u05d4, \u05e2\u05d3\u05db\u05d5\u05df \u05e8\u05e9\u05d5\u05de\u05d4 \u05e7\u05d9\u05d9\u05de\u05ea, \u05d1\u05d9\u05d8\u05d5\u05dc \u05e8\u05e9\u05d5\u05de\u05d4 \u05e7\u05d9\u05d9\u05de\u05ea.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05db\u05d3\u05d9 \u05dc\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d4\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d4\u05d0\u05dc\u05d4, \u05d4\u05d5\u05e1\u05e4\u05ea\u05d9 controller \u05e2\u05dd \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d1\u05e1\u05d9\u05e1\u05d9\u05d5\u05ea.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"641\" src=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-1024x641.png\" alt=\"\" class=\"wp-image-1551\" srcset=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-1024x641.png 1024w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-300x188.png 300w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-768x481.png 768w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller.png 1075w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"302\" src=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-actions1-1024x302.png\" alt=\"\" class=\"wp-image-1554\" srcset=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-actions1-1024x302.png 1024w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-actions1-300x88.png 300w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-actions1-768x226.png 768w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-controller-actions1.png 1177w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">\u05d1\u05e0\u05d9\u05d9\u05ea \u05d4-API<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05d5\u05e1\u05d9\u05e3 class \u05e9\u05dc Employee. \u05d4\u05de\u05d1\u05e0\u05d4 \u05e9\u05dc \u05d4-class \u05d9\u05d4\u05d9\u05d4 \u05ea\u05d5\u05d0\u05dd \u05dc\u05de\u05d1\u05e0\u05d4 \u05d4\u05d8\u05d1\u05dc\u05d4 \u05e9\u05de\u05de\u05e0\u05d4 \u05d0\u05e0\u05d7\u05e0\u05d5 \u05e9\u05d5\u05d0\u05d1\u05d9\u05dd \u05d0\u05ea \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nnamespace SPWebAPI.Models;\n\npublic class Employee\n{\n    public int Id { get; set; }\n    public string Name { get; set; }\n    public int Age { get; set; }\n    public int Active { get; set; }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05e2\u05d1\u05d5\u05e8 \u05dc-controller \u05d5\u05e0\u05e7\u05d1\u05dc \u05d0\u05ea \u05d4-configuration \u05e2\u05dc \u05de\u05e0\u05ea \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1-connection string.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\npublic class HomeController : ControllerBase\n{\n    private readonly IConfiguration _configuration;\n    private readonly string? _connectionString;\n\n    public HomeController(IConfiguration configuration) {\n        _configuration = configuration;\n    _connectionString = _configuration.GetValue&lt;string&gt;\n        (&quot;ConnectionStrings:webapi_conn&quot;);\n    }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05db\u05d3\u05d9 \u05dc\u05d7\u05d1\u05e8 \u05d0\u05ea \u05d4-DB \u05e0\u05d1\u05e0\u05d4 connection string \u05d1\u05e7\u05d5\u05d1\u05e5 appsettings<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05dc\u05e7\u05d5\u05d1\u05e5 \u05d4\u05d6\u05d4 \u05e0\u05d5\u05e1\u05d9\u05e3 \u05d0\u05ea \u05d4-connection string. \u05db\u05d3\u05d9 \u05dc\u05de\u05e6\u05d5\u05d0 \u05d0\u05ea \u05e9\u05dd \u05d4-server \u05e0\u05d7\u05d6\u05d5\u05e8 \u05dc\u05de\u05e0\u05d4\u05dc \u05d4-SQL \u05d5\u05e0\u05dc\u05d7\u05e5 \u05e2\u05dc connect->Database Engine.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"180\" src=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-db-engine-1024x180.png\" alt=\"\" class=\"wp-image-1559\" srcset=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-db-engine-1024x180.png 1024w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-db-engine-300x53.png 300w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-db-engine-768x135.png 768w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-db-engine-1536x270.png 1536w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-db-engine.png 1887w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; highlight: [8,9,10,11]; title: ; notranslate\" title=\"\">\n{\n  &quot;Logging&quot;: {\n    &quot;LogLevel&quot;: {\n      &quot;Default&quot;: &quot;Information&quot;,\n      &quot;Microsoft.AspNetCore&quot;: &quot;Warning&quot;\n    }\n  },\n  &quot;ConnectionStrings&quot;: {\n    &quot;webapi_conn&quot;: &quot;server=DESKTOP-PDVBMCF\\\\SQLEXPRESS; \n        database=master; Integrated Security=true; TrustServerCertificate=True&quot;\n  },\n  &quot;AllowedHosts&quot;: &quot;*&quot;\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05db\u05d3\u05d9 \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1-SQL \u05e0\u05ea\u05e7\u05d9\u05df Nuget \u05e9\u05dc Sql Client, \u05d5\u05d0\u05ea Microsoft.Extensions.Configuration. \u05e0\u05d5\u05e1\u05d9\u05e3 \u05dc-controller \u05e9\u05dc\u05d5\u05e9\u05d4 using.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nusing System.Data;\nusing System.Data.SqlClient;\nusing System.Configuration;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05de\u05db\u05d9\u05d5\u05d5\u05df \u05e9\u05d0\u05d9\u05df \u05dc\u05e0\u05d5 \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05e2\u05d3\u05d9\u05d9\u05df, \u05e0\u05ea\u05d7\u05d9\u05dc \u05de\u05e4\u05e2\u05d5\u05dc\u05ea post.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">POST<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05d9\u05e6\u05d5\u05e8 \u05d0\u05ea \u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05e9\u05de\u05d9\u05d9\u05e6\u05e8\u05ea employee \u05d7\u05d3\u05e9.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE PROC sp_AddEmployee(@Name VARCHAR(100), @Age INT, @Active INT)\nAS\nBEGIN\n\tINSERT INTO TestEmployee(Name, Age, Active)\n\tVALUES (@Name, @Age, @Active)\nEND;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05e2\u05d1\u05d5\u05e8 \u05dc-controller \u05e9\u05de\u05ea\u05d7\u05d1\u05e8 \u05dc\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nnamespace SPWebAPI.Controllers;\n\n&#x5B;Route(&quot;api\/&#x5B;controller]&quot;)]\n&#x5B;ApiController]\npublic class HomeController : ControllerBase\n{\n    private readonly IConfiguration _configuration;\n    private readonly string? _connectionString;\n\n    public HomeController(IConfiguration configuration) {\n        _configuration = configuration;\n    _connectionString = _configuration.GetValue&lt;string&gt;\n        (&quot;ConnectionStrings:webapi_conn&quot;);\n    }\n\n    &#x5B;HttpPost]\n    &#x5B;ProducesResponseType(201, Type = typeof(Employee))]\n    public async Task&lt;ActionResult&lt;Employee&gt;&gt; CreateEmployee(Employee employee) {\n        try {\n            SqlConnection con = new SqlConnection(_connectionString);\n\n            if (employee != null) {\n                SqlCommand cmd = new SqlCommand(&quot;sp_AddEmployee&quot;, con);\n                cmd.CommandType = CommandType.StoredProcedure;\n                cmd.Parameters.AddWithValue(&quot;@Name&quot;, employee.Name);\n                cmd.Parameters.AddWithValue(&quot;@Age&quot;, employee.Age);\n                cmd.Parameters.AddWithValue(&quot;@Active&quot;, employee.Active);\n\n                con.Open();\n                int i = cmd.ExecuteNonQuery();\n                con.Close();\n\n                if (i &gt; 0) {\n                    return Ok(&quot;Data was created&quot;);\n                }\n            }\n        }\n        catch {\n            return NotFound(&quot;Data was not created&quot;);\n        }        \n    }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05d0\u05e0\u05d7\u05e0\u05d5 \u05de\u05d9\u05d9\u05e6\u05e8\u05d9\u05dd SqlConnection \u05e2\u05dd \u05d4-connection string \u05e9\u05d9\u05e6\u05e8\u05e0\u05d5.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05de\u05d9\u05d9\u05e6\u05e8\u05d9\u05dd SqlCommand \u05e9\u05de\u05e7\u05d1\u05dc \u05d0\u05ea \u05e9\u05dd \u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05d5\u05d0\u05ea \u05d4\u05d7\u05d9\u05d1\u05d5\u05e8 \u05d5\u05de\u05d2\u05d3\u05d9\u05e8\u05d9\u05dd \u05d0\u05ea \u05e1\u05d5\u05d2 \u05d4\u05e4\u05e7\u05d5\u05d3\u05d4 \u05db\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05de\u05d7\u05d1\u05e8\u05d9\u05dd \u05d0\u05ea \u05d4\u05e4\u05e8\u05de\u05d8\u05e8\u05d9\u05dd \u05dc\u05e4\u05e7\u05d5\u05d3\u05d4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e4\u05d5\u05ea\u05d7\u05d9\u05dd \u05d7\u05d9\u05d1\u05d5\u05e8, \u05e9\u05d5\u05dc\u05d7\u05d9\u05dd \u05d0\u05ea \u05d4\u05e4\u05e7\u05d5\u05d3\u05d4 \u05d5\u05e1\u05d5\u05d2\u05e8\u05d9\u05dd \u05d7\u05d9\u05d1\u05d5\u05e8.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u05d0\u05dd \u05d4\u05d7\u05d9\u05d1\u05d5\u05e8 \u05dc\u05d0 \u05e2\u05d5\u05d1\u05d3 \u05d0\u05e4\u05e9\u05e8 \u05dc\u05e0\u05e1\u05d5\u05ea \u05dc\u05d4\u05db\u05e0\u05e1 \u05dc\u05d4\u05d2\u05d3\u05e8\u05d5\u05ea \u05e9\u05dc \u05d4\u05d7\u05d9\u05d1\u05d5\u05e8 \u05d5\u05dc\u05e1\u05de\u05df \u05d0\u05ea Trust Server.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"646\" src=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-trust-connection.png\" alt=\"\" class=\"wp-image-1555\" srcset=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-trust-connection.png 647w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-trust-connection-300x300.png 300w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-trust-connection-150x150.png 150w, https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-sql-trust-connection-600x600.png 600w\" sizes=\"(max-width: 647px) 100vw, 647px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">GET ALL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05db\u05e9\u05d9\u05e9 \u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05d1\u05ea\u05d5\u05da \u05d4-DB \u05d0\u05e4\u05e9\u05e8 \u05dc\u05d1\u05e6\u05e2 \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea select. \u05e0\u05d9\u05e6\u05d5\u05e8 \u05d0\u05ea \u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05d4\u05de\u05ea\u05d0\u05d9\u05de\u05d4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE PROC sp_GetAllEmployees\nAS\nBEGIN\n\tSELECT * FROM TestEmployee\nEND;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05d7\u05d6\u05d5\u05e8 \u05dc-controller \u05db\u05d3\u05d9 \u05dc\u05d1\u05e0\u05d5\u05ea \u05d0\u05ea \u05d4\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05e9\u05de\u05d5\u05d1\u05d9\u05dc\u05d4 \u05dc\u05d4\u05d1\u05d0\u05ea \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&#x5B;HttpGet]\npublic List&lt;Employee&gt; GetAllEmployees() {\n    List&lt;Employee&gt; lstEmployees = new List&lt;Employee&gt;();\n\n    try {\n        SqlConnection con = new SqlConnection(_connectionString);\n        SqlDataAdapter da = new SqlDataAdapter(&quot;sp_GetAllEmployees&quot;, con);\n        DataTable dt = new DataTable();\n\n        da.Fill(dt);\n\n        if (dt.Rows.Count &gt; 0) {\n            for(int i = 0; i &lt; dt.Rows.Count; i++) {\n                Employee emp = new Employee();\n\n                emp.Id = Convert.ToInt32(dt.Rows&#x5B;i]&#x5B;&quot;Id&quot;]);\n                emp.Name = dt.Rows&#x5B;i]&#x5B;&quot;Name&quot;].ToString();\n                emp.Age = Convert.ToInt32(dt.Rows&#x5B;i]&#x5B;&quot;Age&quot;]);\n                emp.Active = Convert.ToInt32(dt.Rows&#x5B;i]&#x5B;&quot;Active&quot;]);\n\n                lstEmployees.Add(emp);\n            }              \n        }\n\n        if (lstEmployees.Count &gt; 0) {\n            return lstEmployees;\n        }\n        return null;\n    }\n    catch {\n        return null;\n    }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05d1\u05e6\u05d5\u05e8\u05d4 \u05d3\u05d5\u05de\u05d4 \u05e0\u05d1\u05d9\u05d0 \u05de\u05d9\u05d3\u05e2 \u05dc\u05d2\u05d1\u05d9 \u05e2\u05d5\u05d1\u05d3 \u05d0\u05d7\u05d3.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GET BY ID<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05db\u05ea\u05d5\u05d1 \u05d0\u05ea \u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05d4\u05de\u05ea\u05d0\u05d9\u05de\u05d4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE PROC sp_GetEmployeeById(@Id INT)\nAS\nBEGIN\n\tSELECT * FROM TestEmployee WHERE Id = @Id\nEND;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05e0\u05e4\u05e2\u05d9\u05dc \u05d0\u05ea \u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05db\u05d3\u05d9 \u05e9\u05ea\u05d9\u05e9\u05de\u05e8 \u05d5\u05e0\u05d1\u05e0\u05d4 \u05d0\u05ea \u05d4\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05d4\u05de\u05ea\u05d0\u05d9\u05de\u05d4 \u05d1-API.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&#x5B;HttpGet(&quot;{id}&quot;)]\npublic Employee GetEmployeeById(int id) {\n    Employee emp = new Employee();\n\n    try {\n        SqlConnection con = new SqlConnection(_connectionString);\n        SqlDataAdapter da = new SqlDataAdapter(&quot;sp_GetEmployeeById&quot;, con);\n        da.SelectCommand.CommandType = CommandType.StoredProcedure;\n        da.SelectCommand.Parameters.AddWithValue(&quot;@Id&quot;, id);\n\n        DataTable dt = new DataTable();\n\n        da.Fill(dt);\n\n        if (dt.Rows.Count &gt; 0) {\n\n            emp.Id = Convert.ToInt32(dt.Rows&#x5B;0]&#x5B;&quot;Id&quot;]);\n            emp.Name = dt.Rows&#x5B;0]&#x5B;&quot;Name&quot;].ToString();\n            emp.Age = Convert.ToInt32(dt.Rows&#x5B;0]&#x5B;&quot;Age&quot;]);\n            emp.Active = Convert.ToInt32(dt.Rows&#x5B;0]&#x5B;&quot;Active&quot;]);\n        }\n\n        if (emp != null) {\n            return emp;\n        }\n        return null;\n    }\n    catch {\n        return null;\n    }\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">UPDATE<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05e2\u05d3\u05db\u05d5\u05df \u05e8\u05e9\u05d5\u05de\u05d4 \u05e2\u05dc \u05e4\u05d9 Id.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE PROC sp_UpdateEmployee(@Id INT, @Name VARCHAR(100), @Age INT, @Active INT)\nAS\nBEGIN\n\tUPDATE TestEmployee SET Name = @Name, Age = @Age, Active = @Active\n\tWHERE Id = @Id\nEND;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05d5\u05d4\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05d4\u05de\u05ea\u05d0\u05d9\u05de\u05d4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&#x5B;HttpPut(&quot;{id}&quot;)]\npublic async Task&lt;ActionResult&lt;Employee&gt;&gt; UpdateEmployeeById(int id, Employee employee) {\n    try {\n        SqlConnection con = new SqlConnection(_connectionString);\n\n        if (employee != null) {\n            SqlCommand cmd = new SqlCommand(&quot;sp_UpdateEmployee&quot;, con);\n            cmd.CommandType = CommandType.StoredProcedure;\n            cmd.Parameters.AddWithValue(&quot;@Id&quot;, id);\n            cmd.Parameters.AddWithValue(&quot;@Name&quot;, employee.Name);\n            cmd.Parameters.AddWithValue(&quot;@Age&quot;, employee.Age);\n            cmd.Parameters.AddWithValue(&quot;@Active&quot;, employee.Active);\n\n            con.Open();\n            int i = cmd.ExecuteNonQuery();\n            con.Close();\n\n            if (i &gt; 0) {\n                return Ok(&quot;Data was updated&quot;);\n            }\n        }\n        return Created(&quot;api\/products\/{product.id}&quot;, employee);\n    }\n    catch {\n        return NotFound(&quot;Data was not updated&quot;);\n    }\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">DELETE<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nCREATE PROC sp_DeleteEmployee(@Id INT)\nAS\nBEGIN\n\tDELETE FROM TestEmployee WHERE Id = @Id\nEND;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05d5\u05d4\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n&#x5B;HttpDelete(&quot;{id}&quot;)]\npublic string DeleteEmployeeById(int id, Employee employee) {\n    try {\n        SqlConnection con = new SqlConnection(_connectionString);\n\n        SqlCommand cmd = new SqlCommand(&quot;sp_DeleteEmployee&quot;, con);\n        cmd.CommandType = CommandType.StoredProcedure;\n        cmd.Parameters.AddWithValue(&quot;@Id&quot;, id);\n\n        con.Open();\n        int i = cmd.ExecuteNonQuery();\n        con.Close();\n\n        if (i &gt; 0) {\n            return (&quot;Data was deleted&quot;);\n        }\n\n        return (&quot;Data was not deleted&quot;);\n    }\n    catch {\n        return (&quot;Data was not deleted&quot;);\n    }\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u05d4\u05e7\u05d5\u05d3 \u05e4\u05d4 \u05dc\u05d0 \u05de\u05d5\u05e9\u05dc\u05dd, \u05d5\u05d9\u05e9 \u05de\u05d4 \u05dc\u05e2\u05d1\u05d5\u05d3 \u05e2\u05dc \u05d4\u05d5\u05d3\u05e2\u05d5\u05ea \u05d4\u05e9\u05d2\u05d9\u05d0\u05d4, \u05d0\u05d1\u05dc \u05d1\u05d2\u05d3\u05d5\u05dc \u05d9\u05e9 \u05e4\u05d4 \u05d0\u05ea \u05db\u05dc \u05d4\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05e9\u05dc \u05e2\u05d1\u05d5\u05d3\u05d4 \u05de\u05d5\u05dc \u05d4-DB \u05e2\u05dd \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d5\u05ea.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u05d4\u05e8\u05d0\u05d4 \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1-Stored Procedures \u05d1\u05ea\u05d5\u05da C# API. \u05e0\u05d9\u05e6\u05d5\u05e8 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05de\u05e0\u05ea \u05e9\u05e0\u05d5\u05db\u05dc \u05dc\u05e2\u05d1\u05d5\u05d3 \u05e2\u05dc\u05d9\u05d4. \u05d9\u05e6\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05d7\u05d3\u05e9\u05d4 \u05d4\u05e8\u05e6\u05ea \u05d4-query \u05e2\u05dc \u05d9\u05d3\u05d9 F5. \u05e0\u05e0\u05e1\u05d4 \u05dc\u05d4\u05d1\u05d9\u05d0 \u05d0\u05ea \u05d4\u05de\u05d9\u05d3\u05e2 \u05de\u05d4\u05d8\u05d1\u05dc\u05d4, \u05db\u05de\u05d5\u05d1\u05df \u05e9\u05d4\u05d5\u05d0 \u05d9\u05d2\u05d9\u05e2 \u05e8\u05d9\u05e7, \u05db\u05d9 \u05e2\u05db\u05e9\u05d9\u05d5 \u05d9\u05e6\u05e8\u05e0\u05d5 \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4. \u05d9\u05e6\u05d9\u05e8\u05ea \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 VS \u05e0\u05e2\u05d1\u05d5\u05e8 \u05dc-Visual Studio \u05d5\u05e0\u05d9\u05e6\u05d5\u05e8 \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 \u05d7\u05d3\u05e9. \u05d0\u05e0\u05d7\u05e0\u05d5 \u05e0\u05d1\u05e6\u05e2 5 \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4-API. \u05d1\u05d7\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05e9\u05dc\u05de\u05d4, \u05d1\u05d7\u05d9\u05e8\u05ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[25],"tags":[],"class_list":["post-1548","post","type-post","status-publish","format-standard","hentry","category-sql","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures - Code Notebook<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/\" \/>\n<meta property=\"og:locale\" content=\"he_IL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures - Code Notebook\" \/>\n<meta property=\"og:description\" content=\"\u05d4\u05e8\u05d0\u05d4 \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1-Stored Procedures \u05d1\u05ea\u05d5\u05da C# API. \u05e0\u05d9\u05e6\u05d5\u05e8 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05de\u05e0\u05ea \u05e9\u05e0\u05d5\u05db\u05dc \u05dc\u05e2\u05d1\u05d5\u05d3 \u05e2\u05dc\u05d9\u05d4. \u05d9\u05e6\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05d7\u05d3\u05e9\u05d4 \u05d4\u05e8\u05e6\u05ea \u05d4-query \u05e2\u05dc \u05d9\u05d3\u05d9 F5. \u05e0\u05e0\u05e1\u05d4 \u05dc\u05d4\u05d1\u05d9\u05d0 \u05d0\u05ea \u05d4\u05de\u05d9\u05d3\u05e2 \u05de\u05d4\u05d8\u05d1\u05dc\u05d4, \u05db\u05de\u05d5\u05d1\u05df \u05e9\u05d4\u05d5\u05d0 \u05d9\u05d2\u05d9\u05e2 \u05e8\u05d9\u05e7, \u05db\u05d9 \u05e2\u05db\u05e9\u05d9\u05d5 \u05d9\u05e6\u05e8\u05e0\u05d5 \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4. \u05d9\u05e6\u05d9\u05e8\u05ea \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 VS \u05e0\u05e2\u05d1\u05d5\u05e8 \u05dc-Visual Studio \u05d5\u05e0\u05d9\u05e6\u05d5\u05e8 \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 \u05d7\u05d3\u05e9. \u05d0\u05e0\u05d7\u05e0\u05d5 \u05e0\u05d1\u05e6\u05e2 5 \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4-API. \u05d1\u05d7\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05e9\u05dc\u05de\u05d4, \u05d1\u05d7\u05d9\u05e8\u05ea [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Notebook\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-29T21:55:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-30T08:39:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-1024x263.png\" \/>\n<meta name=\"author\" content=\"kerendanino\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3\" \/>\n\t<meta name=\"twitter:data1\" content=\"kerendanino\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u05d3\u05e7\u05d5\u05ea\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/\"},\"author\":{\"name\":\"kerendanino\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/person\\\/195dfc625818eadda7903d456890e24c\"},\"headline\":\"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures\",\"datePublished\":\"2023-10-29T21:55:50+00:00\",\"dateModified\":\"2023-10-30T08:39:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/\"},\"wordCount\":74,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/sp-create-table-1024x263.png\",\"articleSection\":[\"SQL\"],\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/\",\"name\":\"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures - Code Notebook\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/sp-create-table-1024x263.png\",\"datePublished\":\"2023-10-29T21:55:50+00:00\",\"dateModified\":\"2023-10-30T08:39:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#breadcrumb\"},\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#primaryimage\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/sp-create-table.png\",\"contentUrl\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/sp-create-table.png\",\"width\":1916,\"height\":493},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#website\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/\",\"name\":\"Code Notebook\",\"description\":\"Easy coding\",\"publisher\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"he-IL\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#organization\",\"name\":\"Code Notebook\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-epic-marketing-05.png\",\"contentUrl\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-epic-marketing-05.png\",\"width\":3626,\"height\":1942,\"caption\":\"Code Notebook\"},\"image\":{\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/#\\\/schema\\\/person\\\/195dfc625818eadda7903d456890e24c\",\"name\":\"kerendanino\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g\",\"caption\":\"kerendanino\"},\"url\":\"https:\\\/\\\/epicmarketing.co.il\\\/notebook\\\/author\\\/kerendanino\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures - Code Notebook","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/","og_locale":"he_IL","og_type":"article","og_title":"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures - Code Notebook","og_description":"\u05d4\u05e8\u05d0\u05d4 \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1-Stored Procedures \u05d1\u05ea\u05d5\u05da C# API. \u05e0\u05d9\u05e6\u05d5\u05e8 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05de\u05e0\u05ea \u05e9\u05e0\u05d5\u05db\u05dc \u05dc\u05e2\u05d1\u05d5\u05d3 \u05e2\u05dc\u05d9\u05d4. \u05d9\u05e6\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05d7\u05d3\u05e9\u05d4 \u05d4\u05e8\u05e6\u05ea \u05d4-query \u05e2\u05dc \u05d9\u05d3\u05d9 F5. \u05e0\u05e0\u05e1\u05d4 \u05dc\u05d4\u05d1\u05d9\u05d0 \u05d0\u05ea \u05d4\u05de\u05d9\u05d3\u05e2 \u05de\u05d4\u05d8\u05d1\u05dc\u05d4, \u05db\u05de\u05d5\u05d1\u05df \u05e9\u05d4\u05d5\u05d0 \u05d9\u05d2\u05d9\u05e2 \u05e8\u05d9\u05e7, \u05db\u05d9 \u05e2\u05db\u05e9\u05d9\u05d5 \u05d9\u05e6\u05e8\u05e0\u05d5 \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4. \u05d9\u05e6\u05d9\u05e8\u05ea \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 VS \u05e0\u05e2\u05d1\u05d5\u05e8 \u05dc-Visual Studio \u05d5\u05e0\u05d9\u05e6\u05d5\u05e8 \u05e4\u05e8\u05d5\u05d9\u05d9\u05e7\u05d8 \u05d7\u05d3\u05e9. \u05d0\u05e0\u05d7\u05e0\u05d5 \u05e0\u05d1\u05e6\u05e2 5 \u05e4\u05e2\u05d5\u05dc\u05d5\u05ea \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea \u05d4-API. \u05d1\u05d7\u05d9\u05e8\u05ea \u05d8\u05d1\u05dc\u05d4 \u05e9\u05dc\u05de\u05d4, \u05d1\u05d7\u05d9\u05e8\u05ea [&hellip;]","og_url":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/","og_site_name":"Code Notebook","article_published_time":"2023-10-29T21:55:50+00:00","article_modified_time":"2023-10-30T08:39:28+00:00","og_image":[{"url":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-1024x263.png","type":"","width":"","height":""}],"author":"kerendanino","twitter_card":"summary_large_image","twitter_misc":{"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3":"kerendanino","\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da":"3 \u05d3\u05e7\u05d5\u05ea"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#article","isPartOf":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/"},"author":{"name":"kerendanino","@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/person\/195dfc625818eadda7903d456890e24c"},"headline":"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures","datePublished":"2023-10-29T21:55:50+00:00","dateModified":"2023-10-30T08:39:28+00:00","mainEntityOfPage":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/"},"wordCount":74,"commentCount":0,"publisher":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#organization"},"image":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#primaryimage"},"thumbnailUrl":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-1024x263.png","articleSection":["SQL"],"inLanguage":"he-IL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/","url":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/","name":"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures - Code Notebook","isPartOf":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#website"},"primaryImageOfPage":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#primaryimage"},"image":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#primaryimage"},"thumbnailUrl":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table-1024x263.png","datePublished":"2023-10-29T21:55:50+00:00","dateModified":"2023-10-30T08:39:28+00:00","breadcrumb":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#breadcrumb"},"inLanguage":"he-IL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/"]}]},{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#primaryimage","url":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table.png","contentUrl":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/10\/sp-create-table.png","width":1916,"height":493},{"@type":"BreadcrumbList","@id":"https:\/\/epicmarketing.co.il\/notebook\/asp-net-web-api-crud-operation-using-sql-server-stored-procedures\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/epicmarketing.co.il\/notebook\/"},{"@type":"ListItem","position":2,"name":"ASP.NET Web API CRUD Operation Using SQL Server Stored Procedures"}]},{"@type":"WebSite","@id":"https:\/\/epicmarketing.co.il\/notebook\/#website","url":"https:\/\/epicmarketing.co.il\/notebook\/","name":"Code Notebook","description":"Easy coding","publisher":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/epicmarketing.co.il\/notebook\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"he-IL"},{"@type":"Organization","@id":"https:\/\/epicmarketing.co.il\/notebook\/#organization","name":"Code Notebook","url":"https:\/\/epicmarketing.co.il\/notebook\/","logo":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/logo\/image\/","url":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/07\/logo-epic-marketing-05.png","contentUrl":"https:\/\/epicmarketing.co.il\/notebook\/wp-content\/uploads\/2023\/07\/logo-epic-marketing-05.png","width":3626,"height":1942,"caption":"Code Notebook"},"image":{"@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/epicmarketing.co.il\/notebook\/#\/schema\/person\/195dfc625818eadda7903d456890e24c","name":"kerendanino","image":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/secure.gravatar.com\/avatar\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/285cc9389c66aa46da1e26a474b1e90e9efaf3fa21f1b928cbd63ce5f0e89c63?s=96&d=mm&r=g","caption":"kerendanino"},"url":"https:\/\/epicmarketing.co.il\/notebook\/author\/kerendanino\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts\/1548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/comments?post=1548"}],"version-history":[{"count":9,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts\/1548\/revisions"}],"predecessor-version":[{"id":1566,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/posts\/1548\/revisions\/1566"}],"wp:attachment":[{"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/media?parent=1548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/categories?post=1548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/epicmarketing.co.il\/notebook\/wp-json\/wp\/v2\/tags?post=1548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}