Что то типо мейн контроллер

This commit is contained in:
Artyom_Yashin 2024-04-28 22:15:34 +04:00
parent ee8b4dda04
commit a0d6210f7e

View File

@ -142,6 +142,7 @@ namespace BankRestApi.Controllers
throw;
}
}
[HttpPost]
public void CreateClient(ClientBindingModel model)
{
@ -194,6 +195,7 @@ namespace BankRestApi.Controllers
throw;
}
}
[HttpPut]
public void UpdateClient(ClientBindingModel model)
{
@ -246,5 +248,58 @@ namespace BankRestApi.Controllers
throw;
}
}
[HttpDelete]
public void DeleteClient(ClientBindingModel model)
{
try
{
_client.Delete(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка удаления клиента");
throw;
}
}
[HttpDelete]
public void DeleteCard(CardBindingModel model)
{
try
{
_card.Delete(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка удаления карты");
throw;
}
}
[HttpDelete]
public void DeleteOperation(OperationBindingModel model)
{
try
{
_operation.Delete(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка удаления операции");
throw;
}
}
[HttpDelete]
public void DeleteRequest(RequestBindingModel model)
{
try
{
_request.Delete(model);
}
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка удаления запроса");
throw;
}
}
}
}