features/cutover-to-ef #9

Merged
jtom38 merged 27 commits from features/cutover-to-ef into main 2023-06-25 21:15:58 -07:00
Showing only changes of commit d286c4fd9a - Show all commits

View File

@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Newsbot.Collector.Database.Repositories; using Newsbot.Collector.Database.Repositories;
using Newsbot.Collector.Domain.Dto; using Newsbot.Collector.Domain.Dto;
using Newsbot.Collector.Domain.Entities;
using Newsbot.Collector.Domain.Interfaces; using Newsbot.Collector.Domain.Interfaces;
using Newsbot.Collector.Domain.Models; using Newsbot.Collector.Domain.Models;
@ -68,7 +69,7 @@ public class SubscriptionsController : ControllerBase
public IEnumerable<SubscriptionDto> GetBySourceId(Guid id) public IEnumerable<SubscriptionDto> GetBySourceId(Guid id)
{ {
var res = new List<SubscriptionDto>(); var res = new List<SubscriptionDto>();
var items = _subscription.ListBySourceID(id); var items = _subscription.ListBySourceId(id);
foreach (var item in items) res.Add(SubscriptionDto.Convert(item)); foreach (var item in items) res.Add(SubscriptionDto.Convert(item));
return res; return res;
} }
@ -88,7 +89,7 @@ public class SubscriptionsController : ControllerBase
var source = _sources.GetById(sourceId); var source = _sources.GetById(sourceId);
if (source.Id == Guid.Empty) return new BadRequestResult(); if (source.Id == Guid.Empty) return new BadRequestResult();
var item = _subscription.New(new SubscriptionModel var item = _subscription.New(new SubscriptionEntity
{ {
Id = Guid.NewGuid(), Id = Guid.NewGuid(),
SourceId = sourceId, SourceId = sourceId,
@ -116,7 +117,7 @@ public class SubscriptionsController : ControllerBase
var source = _sources.GetById(sourceId); var source = _sources.GetById(sourceId);
if (source.Id == Guid.Empty) return new BadRequestResult(); if (source.Id == Guid.Empty) return new BadRequestResult();
var sub = _subscription.New(new SubscriptionModel var sub = _subscription.New(new SubscriptionEntity
{ {
DiscordWebHookId = discordId, DiscordWebHookId = discordId,
SourceId = sourceId, SourceId = sourceId,