Beispiel #1
0
        public async Task <BaseServiceResponse <bool> > ActivarAnuncioAsync(int id, bool esActivo)
        {
            BaseServiceResponse <bool> response = new BaseServiceResponse <bool>();
            var anuncioResult = await _anuncioRepository.ConsultarAsync(id);

            if (anuncioResult == null)
            {
                response.Message = "No existe el anuncio.";
                return(response);
            }
            var success = await _anuncioRepository.ActivarAnuncioAsync(id, esActivo);

            response.Success = success;
            response.Message = "Se pudo actualizar exitosamente.";
            response.Data    = esActivo;
            return(response);
        }