Hi,
I am using .NET Core. I created image folder. and added database. But I want show image in table.
Controller
TProjects proje = new TProjects();
if (resimyolu != null)
{
proje.CatId = catid;
proje.Baslik = baslik;
proje.İcerik = icerik;
var path = Path.Combine(
Directory.GetCurrentDirectory(), "wwwroot/resimler", resimyolu.FileName);
var stream = new FileStream(path, FileMode.Create);
proje.ResimYolu = resimyolu.FileName;
}
port.TProjects.Add(proje);
port.SaveChanges();
Index.cshtml
@foreach (var item in Model)
{
<tbody>
<tr class="odd gradeX">
<td>@item.Id</td>
<td>@item.Baslik</td>
<td>@item.İcerik</td>
<td><img src="~/resimler/@item.ResimYolu" width="150" height="150" /></td>
<td>
<button class="btn btn-primary" data-toggle="modal" data-target=".@item.Id">
Düzenle
</button>
</td>
</tr>
</tbody>
}