Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 2
0
 public dynamic InsertProductTypeService(ProductTypeInsertInputModel data)
 {
     return(_ProductRepository.InsertProductType(data));
 }
Ejemplo n.º 3
0
 public IActionResult InsertProductType(ProductTypeInsertInputModel data)
 {
     return(Ok(_productService.InsertProductTypeService(data)));
 }