Added a route to get a summary of all currencies
This commit is contained in:
@ -3,6 +3,7 @@ using IO.Swagger.Models.dto;
|
||||
using IO.Swagger.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -17,6 +18,11 @@ namespace IO.Swagger.Repositories
|
||||
this.context = context ?? throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
public async Task<List<Currency>> GetAllCurrencies()
|
||||
{
|
||||
return await context.Currencies.Include(c => c.User).Include(c=>c.Transactions).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> CreateCurrency(CurrencyCreateBody request, int userId)
|
||||
{
|
||||
request.Symbol = request.Symbol.Trim();
|
||||
|
||||
Reference in New Issue
Block a user