Esempio n. 1
0
        public IActionResult UpdateCategory([FromBody] APIUsers.Library.Models.Category value)
        {
            Boolean status;

            using (ICategory Category = Factorizador.CrearConexionServicioCategory(APIUsers.Library.Models.ConnectionType.MSSQL, ConnectionStringLocal)){
                status = Category.UpdateCategory(value);
            }
            return(Ok(status));
        }
Esempio n. 2
0
        public int InsertCategory([FromBody] APIUsers.Library.Models.Category value)
        {
            int id = 0;

            using (ICategory Category = Factorizador.CrearConexionServicioCategory(APIUsers.Library.Models.ConnectionType.MSSQL, ConnectionStringLocal))
            {
                id = Category.InsertCategory(value);
            }
            return(id);
        }
Esempio n. 3
0
        public IActionResult GetCategory(int id)
        {
            APIUsers.Library.Models.Category category = new APIUsers.Library.Models.Category();
            var ConnectionStringLocal = _configuration.GetValue <string>("ServidorAzure");

            using (ICategory Category = Factorizador.CrearConexionServicioCategory(APIUsers.Library.Models.ConnectionType.MSSQL, ConnectionStringLocal))
            {
                category = Category.GetCategory(id);
            }
            return(Ok(new { category }));
        }