title: CRUD operation in asp.net core MVC using kendo grid and stored procedures and dapper with the Repository pattern
body: <p>I am trying to do CRUD operation in asp.net core MVC,
  When I try to insert data into the grid(Create Function), VS turns me with an error that can not nut be null!
  I think the problem is UI does not send my inputs to the SQL or other things that I don't know! </p>
  
  <p>This is part of my controller with Create operator! </p>
  
  <pre><code>public ActionResult AddRegistry([DataSourceRequest]DataSourceRequest request,Registry registry)
          {
              var parameter = new DynamicParameters();
  
              parameter.Add("@Reg_Name",registry.Reg_Name);
              parameter.Add("@Country", registry.Country);
              parameter.Add("@Reg_Date", registry.Reg_Date);
  
              parameter.Add("@Reg_Disc", registry.Reg_Disc);
  
              _unitOfWork.SP_Call.Execute(SD.usp_AddRegistry, parameter);
              _unitOfWork.Save();
              return (Json(request));
  
          }
  </code></pre>
  
  <p>This is my view!</p>
  
  <pre><code>@(Html.Kendo().Grid&lt;MSDACE.Models.DbDesign.Registry&gt;()
      .Name("Grid")
      .Columns(columns =&gt;
      {
          columns.Bound(p =&gt; p.Reg_ID).Width(50);;
          columns.Bound(p =&gt; p.Reg_Name).Width(180);
          columns.Bound(p =&gt; p.Reg_Date).Width(180);
          columns.Bound(p =&gt; p.Country).Width(180);
          columns.Bound(p =&gt; p.Reg_Disc).Width(120);
  
          columns.Command(command =&gt; command.Destroy()).Width(90);
      })
      .ToolBar(toolbar =&gt;
      {
          toolbar.Create();
           toolbar.Save();
  
      })
      .Editable(editable =&gt; editable.Mode(GridEditMode.InLine))
      .Pageable()
      .Navigatable()
      .Sortable()
      .Groupable()
      .Filterable()
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .Batch(true)
          .PageSize(20)
          .ServerOperation(false)
          .Events(events =&gt; events.Error("error_handler"))
          .Model(model =&gt;
          {
              model.Id(p =&gt; p.Reg_ID);
              model.Field(p =&gt; p.Reg_ID).Editable(false);
  
          })
          .Create("AddRegistry", "Test")
          .Read("GetAllRegistry", "Test")
  
      )
       .Resizable(resize =&gt; resize.Columns(true))  
  )
  </code></pre>
  
  <p>also the SP is</p>
  
  <pre><code>
  ALTER Procedure [dbo].[usp_AddRegistry]
  --@Reg_ID int,
  @Reg_Name nvarchar(max),
  @Country nvarchar(max),
  --@Reg_Date datetime2(7),
  @Reg_Disc nvarchar(max)
  
  as
  
  begin
  
  insert into dbo.Registry (
  --Reg_ID,
  Reg_Name,
  Country,
  Reg_Date,
  Reg_Disc)
  
  values (
  --@Reg_ID,
  @Reg_Name,
  @Country,
  GETDATE(),
  @Reg_Disc)
  
  end
  </code></pre>