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

34 lines
965 B
C#
Raw Normal View History

using System.Net.NetworkInformation;
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(SourceModel 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
};
}
}