Newsbot.Collector/Newsbot.Collector.Domain/Dto/SourceDto.cs

35 lines
1007 B
C#

using System.Net.NetworkInformation;
using Newsbot.Collector.Domain.Entities;
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; }
public static SourceDto Convert(SourceEntity model) {
return new SourceDto
{
ID = model.Id,
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
};
}
}