Ejemplo n.º 1
0
 public void Delete(News news)
 {
     try
     {
         _newsDal.Delete(news);
     }
     catch
     {
         throw new Exception("Silme Gerçekleşmedi");
     }
 }
Ejemplo n.º 2
0
        public async Task <NewsForReturnDto> Delete(int Id)
        {
            var getByIdFromRepo = await newsDal.GetAsync(x => x.Id == Id);

            if (getByIdFromRepo == null)
            {
                throw new RestException(HttpStatusCode.BadRequest, new { NotFound = Messages.NotFound });
            }

            await newsDal.Delete(getByIdFromRepo);

            return(mapper.Map <News, NewsForReturnDto>(getByIdFromRepo));
        }
Ejemplo n.º 3
0
 public void Delete(News entity)
 {
     _newsDal.Delete(entity);
 }
 public void Delete(int id)
 {
     _context.Delete(new News {
         Id = id
     });
 }
Ejemplo n.º 5
0
 public void Delete(int Id)
 {
     _newsDal.Delete(Id);
 }