Esempio n. 1
0
        public dynamic InsertProductCategories(ProductCategoriesInsertInputModel 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].[ProductCategoriesInsertProcedure]",
                        param: dbParams,
                        commandType: CommandType.StoredProcedure);

                    return(reader);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    con.Close();
                }
            }
        }
Esempio n. 2
0
 public dynamic InsertProductCategoriesService(ProductCategoriesInsertInputModel data)
 {
     return(_ProductRepository.InsertProductCategories(data));
 }
 public IActionResult InsertProductCategories(ProductCategoriesInsertInputModel data)
 {
     return(Ok(_productService.InsertProductCategoriesService(data)));
 }