Here is my code
@model WIMMPortalServer.Presentation.ViewModels.UserProfile
<div class="section text-center">
<h5 class="text-left">RECENTLY UPLOADED</h5>
<div class="row">
@foreach (var data in Model.FilmDetailDTO)
{
<div class="col-12 col-md-6 col-xl-3">
<div class="film">
<div class="image">
<img src="~/Content/images/films/5.png" alt="">
</div>
<div class="text">
<h5>@data.FilmTitle</h5>
<p>
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt.
</p>
<span class="icon">
@*<img src="~/Content/icons/heart.svg" alt="">*@
<button class="btn-link glyphicon glyphicon-heart-empty" onclick="Fav(@data.ID)"></button>
</span>
</div>
<a class="btn btn-gray" href="/Home/FilmDetails">EXPLORE</a>
</div>
</div>
}
</div>
</div>
<a class="show" href="#">Show More</a>
</div>
public class FilmDetailDTO : FilmDetail
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long ID { get; set; }
public string FilmTitle { get; set; }
public long? TitleLanguageID { get; set; }
public string SYNOPSIS { get; set; }
public string Tags { get; set; }
public string TranslatedTitle { get; set; }
public bool? IsDub { get; set; }
public bool? IsSubTitle { get; set; }
public long? OfficialLanguageID { get; set; }
public long? SafetyLevelID { get; set; }
public string DirectorInfo { get; set; }
public string ProducerInfo { get; set; }
public DateTime? ReleaseFrom { get; set; }
public DateTime? ReleaseTo { get; set; }
public long? CountryID { get; set; }
public long? BudgetID { get; set; }
public string FestivalCode { get; set; }
public long? PosterID { get; set; }
public long? ScreenerID { get; set; }
}
Above is my model class and my code. Now there is an image source with static favourite button I want to make it dynamic and want to save details in database if user will click on favourite button and also delete detais from database if user want to un favourite it