Working forum post
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
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.Interfaces;
|
||||
using DAL.Domain;
|
||||
using DAL.Interfaces;
|
||||
|
||||
namespace BL.Services
|
||||
@@ -16,9 +18,27 @@ namespace BL.Services
|
||||
{
|
||||
_foorumRepository = foorumRepository;
|
||||
}
|
||||
public void Add(FoorumDTO foorum)
|
||||
public FoorumDTO Add(FoorumDTO foorum)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var foorumDomain = new Foorum()
|
||||
{
|
||||
Author = foorum.Author,
|
||||
Body = foorum.Body,
|
||||
CreationTime = DateTime.Now,
|
||||
Description = foorum.Description,
|
||||
Title = foorum.Title
|
||||
};
|
||||
var f = _foorumRepository.Add(foorumDomain);
|
||||
return new FoorumDTO()
|
||||
{
|
||||
FoorumId = f.FoorumId,
|
||||
Title = f.Title,
|
||||
Author = f.Author,
|
||||
Body = f.Body,
|
||||
CreationTime = f.CreationTime,
|
||||
Description = f.Description,
|
||||
Visible = f.Visible
|
||||
};
|
||||
}
|
||||
|
||||
public void AddPost(int id, PostDTO post)
|
||||
@@ -43,7 +63,12 @@ namespace BL.Services
|
||||
yield return new FoorumDTO()
|
||||
{
|
||||
FoorumId = f.FoorumId,
|
||||
Title = f.Title
|
||||
Title = f.Title,
|
||||
Author = f.Author,
|
||||
Body = f.Body,
|
||||
CreationTime = f.CreationTime,
|
||||
Description = f.Description,
|
||||
Visible = f.Visible
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user