Advertisement
Danny_Berova

ToHtml

Jun 23rd, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. namespace MeTube.App.Helpers
  2. {
  3.     using Models;
  4.     using Services;
  5.  
  6.     public static class HtmlHelpers
  7.     {
  8.         public static string ToHtml(this TubeViewModel tube)
  9.             => $@"
  10.                <div class=""card col-3 thumbnail text-center"">
  11.                    <a href=""/tubes/details?id={tube.Id}"" target=""_blank"">
  12.                    <img class=""card-image-top img-fluid img-thumbnail width=""450""
  13.                    onerror=""this.src='https://i.ytimg.com/vi/{tube.VideoId}/maxresdefault.jpg';"" src = ""{tube.VideoId}"" border=""0"" />
  14.                    </a>
  15.                  
  16.                    <div class=""card-body"">
  17.                        <h4 class=""card-title text-center"">{tube.Title}</h4>
  18.                        <p class=""card-text text-center""><strong>Author</strong> - {tube.Author}</p>
  19.                    </div>
  20.                        <a class=""card-button btn btn-outline-primary"" name=""info"" href=""/tubes/details?id={tube.Id}"">Info</a>
  21.                  
  22.                </div>";
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement