reactredux/webapi/WeatherForecast/Models/L10n/PostItemL10nModel.cs

38 lines
1006 B
C#

using Core.Abstractions;
using Core.Abstractions.Models;
using Core.DomainObjects.L10n;
using Core.Enumerations;
namespace WeatherForecast.Models.L10n {
public class PostItemL10nModel : RequestModelBase<PostItemL10n> {
public string Locale { get; set; }
public string Slug { get; set; }
public string Description { get; set; }
public string Title { get; set; }
public string ShortText { get; set; }
public string Text { get; set; }
public string ContentType { get; set; }
public List<string> Badges { get; set; }
public override PostItemL10n ToDomainObject() => new PostItemL10n {
Locale = Enumeration.FromDisplayName<Locales>(Locale),
Slug = Slug,
Description = Description,
Title = Title,
Text = Text,
ShortText = ShortText,
// TODO: create plain text creation logic
PlainText = "TODO",
ContentType = Enumeration.FromDisplayName<ContentTypes>(ContentType),
Badges = Badges
};
}
}