コード例 #1
0
ファイル: BlogManager.cs プロジェクト: anilcrk/BlogDemoLast
 public string Delete(Blog blog)
 {
     try
     {
         _blogDal.Delete(blog);
         return(Messages.DeleteMessage);
     }
     catch (Exception ex) {
         return(string.Format("{0} {1}", Messages.DeleteMessageError, ex.Message));
     }
 }
コード例 #2
0
 public bool Delete(Blog model)
 {
     try
     {
         return(blogDal.Delete(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
        public IActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(BadRequest());
            }

            var blog = _blogDal.Get(x => x.Id == id);

            _blogDal.Delete(blog);
            return(Json("Blog Id :" + blog.Id));
        }
コード例 #4
0
 public EntityResult Delete(Blog model)
 {
     try
     {
         if (_blogDal.Delete(model))
         {
             return(new EntityResult("Silme başarılı", ResultState.Success));
         }
         return(new EntityResult("Hata Oluştu", ResultState.Warning));
     }
     catch (Exception ex)
     {
         return(new EntityResult("Database Hatası " + ex.ToInnestException().Message, ResultState.Error));
     }
 }
コード例 #5
0
        public DataResponse Delete(Blog entity)
        {
            var blog = _blogDal.Delete(entity);

            if (blog == null)
            {
                return new DataResponse
                       {
                           Mesaj      = "Aradiginiz Blog Bulunamadi",
                           Tamamlandi = false
                       }
            }
            ;
            return(new DataResponse
            {
                Data = blog,
                Mesaj = "Blog Silindi",
                Tamamlandi = true
            });
        }
    }
コード例 #6
0
 public void Delete(int blogId)
 {
     _blogDal.Delete(new Blog {
         id = blogId
     });
 }
コード例 #7
0
 public void Delete(Blog blog)
 {
     _blogDal.Delete(blog);
 }
コード例 #8
0
 public void Delete(Blog entity)
 {
     _blogDal.Delete(entity);
 }
コード例 #9
0
        public void Delete(int id)
        {
            var value = _blogDal.Get(x => x.Id == id);

            _blogDal.Delete(value);
        }
コード例 #10
0
        public void Delete(int id)
        {
            var blog = _blogDal.Get(p => p.Id == id);

            _blogDal.Delete(blog);
        }
コード例 #11
0
 public IResult Delete(Blog entity)
 {
     _blogDal.Delete(entity);
     return(new SuccessResult());
 }