public class Result
{
public bool error {get;set;}
public string error_text {get;set;}
public List<Users> content {get;set;}
public List<Personal> personals {get;set;}
public List<Employee> employes{get;set;}
public List<NewsMaterial> materials{get;set;}
}
public IActionResult Index()
{
_logger.LogInformation("Переход на главную");
var model = myService.Hello(); //обращаемся к функции сервиса, сервис возвращает данные
_logger.LogDebug(model); //если есть ошибки то пишем
return View(model); // передаем пользователю
}
public async Task<int> AttendanceDetailsDelete(long ID)
{
return await WithConnection(async conn => {
await conn.ExecuteAsync(@"DELETE FROM provider.attendances_detail WHERE id=@id", new { id = ID });
return (await conn.QueryAsync<int>(@"SELECT COUNT(*) FROM provider.attendances_detail WHERE id=@id", new { id = ID })).FirstOrDefault();
});
}
<input type="text" class="form-control form-control-sm m-b-xs" id="org-filter" placeholder="@Localizer["Search"]" oninput="orgSearch();" onfocus="this.removeAttribute('readonly')" readonly>
//--------------
string[] fio2 = x.name.Split();
model.iin = iin;
model.fam = fio2[0];
model.im = fio2[1];
string otc = "";
try
{
otc = fio2[2];
}
catch {}
model.otc = otc;
//----------------
public async Task ThemeDelete(long id)
{
using(IDbConnection dbConnection = Connection)
{
await dbConnection.ExecuteAsync(@"DELETE FROM journal.journal_themes WHERE id=@id", new { id = id });
}
}
public class ReposExams : IExamsRepository<Exam>,IDisposible
public async Task ThemeDelete(long id)
{
using(IDbConnection dbConnection = Connection)
{
await dbConnection.ExecuteAsync(@"DELETE FROM journal.journal_themes WHERE id=@id", new { id = id });
}
}
public async Task ThemeDelete(long id)
{
using(IDbConnection dbConnection = Connection)
{
await dbConnection.ExecuteAsync(@"DELETE FROM journal.journal_themes WHERE id=@id", new { id = id });
dbConnection .Dispose();
}
}
PS и создавать подключение в репозитории, не айс, зачем DI придумали люди.