2023-02-26 09:40:04 -08:00
|
|
|
using System.Net.NetworkInformation;
|
2023-06-23 23:01:40 -07:00
|
|
|
using Newsbot.Collector.Domain.Entities;
|
2023-02-26 09:40:04 -08:00
|
|
|
using Newsbot.Collector.Domain.Models;
|
|
|
|
|
|
|
|
namespace Newsbot.Collector.Domain.Dto;
|
|
|
|
|
|
|
|
public class SourceDto
|
|
|
|
{
|
|
|
|
public Guid ID { get; set; }
|
|
|
|
public string? Site { get; set; }
|
|
|
|
public string? Name { get; set; }
|
|
|
|
public string? Source { get; set; }
|
|
|
|
public string? Type { get; set; }
|
|
|
|
public string? Value { get; set; }
|
|
|
|
public bool Enabled { get; set; }
|
|
|
|
public string? Url { get; set; }
|
|
|
|
public string[]? Tags { get; set; }
|
|
|
|
public bool Deleted { get; set; }
|
|
|
|
|
2023-06-23 23:01:40 -07:00
|
|
|
public static SourceDto Convert(SourceEntity model) {
|
2023-02-26 09:40:04 -08:00
|
|
|
return new SourceDto
|
|
|
|
{
|
2023-06-23 23:01:40 -07:00
|
|
|
ID = model.Id,
|
2023-02-26 09:40:04 -08:00
|
|
|
Site = model.Site,
|
|
|
|
Name = model.Name,
|
|
|
|
Source = model.Source,
|
|
|
|
Type = model.Type,
|
|
|
|
Value = model.Value,
|
|
|
|
Enabled = model.Enabled,
|
|
|
|
Url = model.Url,
|
|
|
|
Tags = model.Tags.Split(','),
|
|
|
|
Deleted = model.Deleted
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|