Refactoring: Added interfaces, custom exceptions, UserManager unit tests, dependency injection/inversion; Regex match search by date, keywords

This commit is contained in:
Dimitar Byalkov
2023-06-06 17:52:36 +02:00
parent 180b261d37
commit 53c42a35d8
43 changed files with 668 additions and 211 deletions

View File

@@ -0,0 +1,19 @@
using System.ComponentModel.Design;
using System.Data.SqlClient;
using Models;
namespace Logic;
public interface ICommentRepository
{
public List<Comment> GetAllCommentsOnAnnouncement(int announcementId);
public List<Comment> GetAllCommentResponses(int commentId);
public Comment GetCommentById(int id);
public void UpdateComment(int id, string description);
public Comment CreateComment(User author, string description, string title, DateTime publishDate);
public void CreateCommentOnAnnouncement(User author, string description, string title, DateTime publishDate, int announcementId);
public void CreateResponseOnComment(User author, string description, string title, DateTime publishDate, int commentId);
public void DeleteComment(int id);
public void DeleteCommentOnAnnouncement(int commentId, int announcementId);
public void DeleteResponseOnComment(int responseId, int commentId);
}