Exemplo n.º 1
0
        public async Task <WrapperSimpleTypesDTO> AumentarContadorClickDeUnAnuncio(Anuncios anuncioParaAumentar)
        {
            using (SportsGoEntities context = new SportsGoEntities(false))
            {
                AnunciantesRepository anuncianteRepo = new AnunciantesRepository(context);
                Anuncios anuncioExistente            = await anuncianteRepo.AumentarContadorClickDeUnAnuncio(anuncioParaAumentar);

                WrapperSimpleTypesDTO wrapperAumentarContadorClickDeUnAnuncio = new WrapperSimpleTypesDTO();

                wrapperAumentarContadorClickDeUnAnuncio.NumeroRegistrosAfectados += await context.SaveChangesAsync();

                if (wrapperAumentarContadorClickDeUnAnuncio.NumeroRegistrosAfectados > 0)
                {
                    wrapperAumentarContadorClickDeUnAnuncio.Exitoso = true;
                }

                return(wrapperAumentarContadorClickDeUnAnuncio);
            }
        }