-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCommentService.cs
More file actions
49 lines (42 loc) · 1.24 KB
/
CommentService.cs
File metadata and controls
49 lines (42 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using CodeTalk.Domain.Contracts.Services;
using CodeTalk.DataSource;
using CodeTalk.DataSource.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeTalk.Domain.Models;
using CodeTalk.Domain.Contracts.Repositories;
namespace CodeTalk.ServiceLayer
{
public class CommentService:ICommentService
{
private ICommentRepository commentRepository;
//public CommentService(ICommentRepository commentRepository)
public CommentService()
{
this.commentRepository = new CommentRepository();
}
public IList<Comment> GetComments()
{
return commentRepository.GetComments().ToList();
}
public bool AddComment(Comment comment)
{
return commentRepository.AddComment(comment);
}
public Comment GetCommentById(int id)
{
return commentRepository.GetCommentById(id);
}
public void EditComment(Comment comment)
{
commentRepository.EditComment(comment);
}
public void DeleteTalk(Comment comment)
{
commentRepository.DeleteComment(comment);
}
}
}