دوستان بنده تونستم عمل ذخیره انجام بیدم ولی من API نویسی کردم و داخل یک Dll تمام دستورات دیتابیس به صورت Datatable نوشتم ولی مشکل سر این هستش که لین دستورات بنده هستش ولی نمیتوانم اطلاعات از دیتابیس لود کنم و نمایش بیدم.
Tbl_City city = new Tbl_City();
private readonly Tbl_City _context;
public ShowModel(Tbl_City context)
{
_context = context;
}
public Tbl_City Instructor { get; set; }
public int InstructorID { get; set; }
public void OnGet()
{
}
[Display(Name = "شناسه")]
public string C_ID { get; set; }
[Display(Name = "شناسه استان")]
public string C_P_ID { get; set; }
[Display(Name = "نام شهرستان")]
public string C_Title { get; set; }
[Display(Name = "عرض جغرافیایی")]
public string C_latitude { get; set; }
[Display(Name = "طول جغرافیایی")]
public string C_longitude { get; set; }
[Display(Name = "عرض")]
public string C_φ { get; set; }
[Display(Name = "طول")]
public string C_λ { get; set; }
[Display(Name = "تاریخ ثبت")]
public string C_Insert_Date { get; set; }
[Display(Name = "زمان ثبت")]
public string C_Insert_Time { get; set; }
[Display(Name = "تاریخ ویرایش")]
public string C_Update_Date { get; set; }
[Display(Name = "زمان ویرایش")]
public string C_Update_Time { get; set; }
[Display(Name = "تعداد دفعات ویرایش")]
public string C_Update_Count { get; set; }
دستورات Html
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.C_ID[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_P_ID[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_Title[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_latitude[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_longitude[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_φ[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_λ[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_Insert_Date[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_Insert_Time[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_Update_Date[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_Update_Time[0].ToString())
</th>
<th>
@Html.DisplayNameFor(model => model.C_Update_Count[0].ToString())
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Instructor.Select().Rows.ToString())
{
<tr >
<td>
@Html.DisplayFor(modelItem => item.ToString())
</td>
<td>
@Html.DisplayFor(modelItem => item.ToString())
</td>
<td>
@Html.DisplayFor(modelItem => item.ToString())
</td>
</tr>
}
</tbody>
</table>
ممنون میشم مقدور هستش بگید چطوری در Asp page core اطلاعات نمایش بدم.
با تشکر