-
Notifications
You must be signed in to change notification settings - Fork 8
IModelManager implementation with other technologies
Ushakov Michael edited this page Sep 22, 2025
·
4 revisions
This page describes how to extend the default behavior and add to specific controllers additional methods. One-line controllers can't have additional methods (at the present moment).
To add new methods to controller you should do the following:
- Derive required basic controller and add custom method, i.e. code from an our
CBS(Core Banking Solution) project:
namespace Wissance.Ubs.WebApi.Controllers
{
public class LoanController: BasicCrudController<LoanDto, LoanEntity, Guid, EmptyAdditionalFilter>
{
public LoanController(EdgeDBClient edgeDbClient, ILoggerFactory loggerFactory, IHttpContextAccessor httpContextAccessor)
{
_manager = new LoanManager(edgeDbClient, LoanFactory.Create, LoanFactory.Create, CrudMasks.ReadUpdate,
loggerFactory, httpContextAccessor);
Manager = _manager;
}
[HttpGet]
[Route("api/[controller]/{loanId}/history")]
public async Task<LoanHistoryItemDto[]> GetLoanHistoryAsync([FromRoute]Guid loanId)
{
OperationResultDto<LoanHistoryItemDto[]> result = await _manager.GetLoanHistoryAsync(loanId);
if (result != null)
{
Response.StatusCode = result.Status;
if (result.Success)
return result.Data;
}
Response.StatusCode = (int)StatusCodes.Status500InternalServerError;
return null;
}
private readonly LoanManager _manager;
}