Exemple #1
0
        public dynamic InsertProductType(ProductTypeInsertInputModel data)
        {
            using (var con = new SqlConnection(configuration.GetValue <string>("ConnectionString:SQLConnection")))
            {
                try
                {
                    var dbParams = new DynamicParameters();
                    con.Open();
                    dbParams.Add("@item", Newtonsoft.Json.JsonConvert.SerializeObject(data));
                    var reader = con.Query <dynamic>(
                        sql: "[dbo].[ProductTypeInsertProcedure]",
                        param: dbParams,
                        commandType: CommandType.StoredProcedure);

                    return(reader);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    con.Close();
                }
            }
        }
 public dynamic InsertProductTypeService(ProductTypeInsertInputModel data)
 {
     return(_ProductRepository.InsertProductType(data));
 }
 public IActionResult InsertProductType(ProductTypeInsertInputModel data)
 {
     return(Ok(_productService.InsertProductTypeService(data)));
 }