public Embed(Model model) { Url = model.Url; Type = model.Type; Title = model.Title; Description = model.Description; if (model.Provider.IsSpecified) { Provider = new EmbedProvider(model.Provider.Value); } if (model.Thumbnail.IsSpecified) { Thumbnail = new EmbedThumbnail(model.Thumbnail.Value); } }
public Embed(Model model) { Url = model.Url; Type = model.Type; Title = model.Title; Description = model.Description; Color = model.Color.Value; Timestamp = model.Timestamp.Value; if (model.Provider.IsSpecified) { Provider = new EmbedProvider(model.Provider.Value); } if (model.Provider.IsSpecified) { Provider = new EmbedProvider(model.Provider.Value); } if (model.Thumbnail.IsSpecified) { Thumbnail = new EmbedThumbnail(model.Thumbnail.Value); } if (model.Author.IsSpecified) { Author = new EmbedAuthor(model.Author.Value); } if (model.Image.IsSpecified) { Image = EmbedImage.Create(model.Image.Value); } if (model.Video.IsSpecified) { Video = EmbedVideo.Create(model.Video.Value); } if (model.Footer.IsSpecified) { Footer = new EmbedFooter(model.Footer.Value); } if (model.Fields.IsSpecified) { Fields = model.Fields.Value.Select(EmbedField.Create).ToImmutableArray(); } else { Fields = ImmutableArray.Create <EmbedField>(); } }
public static API.EmbedProvider ToModel(this EmbedProvider entity) { return(new API.EmbedProvider { Name = entity.Name, Url = entity.Url }); }