using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using BL.DTOs; using BL.Factories; using BL.Interfaces; using DAL.Domain; using DAL.Interfaces; namespace BL.Services { public class FoorumService : IFoorumService { private readonly IFoorumRepository _foorumRepository; private readonly FoorumFactory _factory; public FoorumService(IFoorumRepository foorumRepository) { _foorumRepository = foorumRepository; _factory = new FoorumFactory(); } public FoorumDTO Add(FoorumDTO foorum) { var foorumDomain = _factory.Create(foorum); foorumDomain.CreationTime = DateTime.Now; var f = _foorumRepository.Add(foorumDomain); return _factory.Create(f); } public void AddPost(int id, PostDTO post) { throw new NotImplementedException(); } public void Delete(int id) { throw new NotImplementedException(); } public FoorumDTO Get(int id) { throw new NotImplementedException(); } public IEnumerable GetAll() { foreach (var f in _foorumRepository.GetAll()) { yield return _factory.Create(f); } } public void Hide(int id) { throw new NotImplementedException(); } public IEnumerable SearchFoorumAuthor(string query) { throw new NotImplementedException(); } public IEnumerable SearchFoorumTitle(string query) { throw new NotImplementedException(); } public IEnumerable SearchPostAuthor(string query) { throw new NotImplementedException(); } public void Update(FoorumDTO foorum) { throw new NotImplementedException(); } } }