Working delete and hide of the post

This commit is contained in:
2017-06-12 16:15:34 +03:00
parent b1dcf5f72d
commit 41991a68dd
4 changed files with 45 additions and 13 deletions

View File

@@ -32,7 +32,9 @@ namespace BL.Services
public void Delete(int id)
{
throw new NotImplementedException();
var f = _foorumRepository.GetById(id);
_foorumRepository.Delete(f);
_foorumRepository.SaveChanges();
}
public FoorumDTO Get(int id)
@@ -50,9 +52,12 @@ namespace BL.Services
}
public void Hide(int id)
public void Hide(int id, bool hide=true)
{
throw new NotImplementedException();
var f = _foorumRepository.GetById(id);
f.Visible = !hide;
_foorumRepository.Update(f);
_foorumRepository.SaveChanges();
}
public IEnumerable<FoorumDTO> SearchFoorumAuthor(string query)