Skip to content

Commit 2c7d2d2

Browse files
committed
[Guru] Use List to improve performance & Minor changes
1 parent 868a80a commit 2c7d2d2

14 files changed

Lines changed: 21 additions & 13 deletions

src/GuruPR.Application/Interfaces/Application/IAgentService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace GuruPR.Application.Interfaces.Application;
55

66
public interface IAgentService
77
{
8-
Task<IEnumerable<Agent>> GetAllAgentsAsync(string? userId = null);
8+
Task<List<Agent>> GetAllAgentsAsync(string? userId = null);
99

1010
Task<Agent> GetAgentByIdAsync(string agentId);
1111

src/GuruPR.Application/Interfaces/Application/IConversationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace GuruPR.Application.Interfaces.Application;
66

77
public interface IConversationService
88
{
9-
Task<IEnumerable<Conversation>> GetAllConversationsByUserIdAsync(string userId);
9+
Task<List<Conversation>> GetAllConversationsByUserIdAsync(string userId);
1010

1111
Task<Conversation> GetConversationByIdAsync(string conversationId, string userId);
1212

src/GuruPR.Application/Interfaces/Application/IProviderConnectionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace GuruPR.Application.Interfaces.Application;
66

77
public interface IProviderConnectionService
88
{
9-
Task<IEnumerable<ProviderConnection>> GetConnectionsByProviderIdAsync(string providerId);
9+
Task<List<ProviderConnection>> GetConnectionsByProviderIdAsync(string providerId);
1010

1111
Task<ProviderConnection> GetProviderConnectionByIdAsync(string providerId, string providerConnectionId);
1212

src/GuruPR.Application/Interfaces/Application/IProviderService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public interface IProviderService
88
{
99
Task<Provider> CreateProviderAsync(CreateProviderRequest createProviderRequest);
1010

11-
Task<IEnumerable<Provider>> GetAllProvidersAsync();
11+
Task<List<Provider>> GetAllProvidersAsync();
1212

1313
Task<Provider> GetProviderByIdAsync(string providerId);
1414

src/GuruPR.Application/Interfaces/Persistence/IAgentRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ namespace GuruPR.Application.Interfaces.Persistence;
44

55
public interface IAgentRepository : IGenericRepository<Agent>
66
{
7-
7+
Task<List<Agent>> GetAllAgentsAsync(string userId);
88
}

src/GuruPR.Application/Interfaces/Persistence/IConversationRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ namespace GuruPR.Application.Interfaces.Persistence;
44

55
public interface IConversationRepository : IGenericRepository<Conversation>
66
{
7-
Task<IEnumerable<Conversation>> GetAllByUserIdAsync(string userId);
7+
Task<List<Conversation>> GetAllByUserIdAsync(string userId);
88
}

src/GuruPR.Application/Interfaces/Persistence/IGenericRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public interface IGenericRepository<T> where T : class
44
{
55
Task<T?> GetByIdAsync(string id);
66

7-
Task<IEnumerable<T>> GetAllAsync();
7+
Task<List<T>> GetAllAsync();
88

99
Task<T> AddAsync(T entity);
1010

src/GuruPR.Application/Services/AgentService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public AgentService(ILogger<AgentService> logger,
3434

3535
#region Public Methods
3636

37-
public async Task<IEnumerable<Agent>> GetAllAgentsAsync(string? userId = null)
37+
public async Task<List<Agent>> GetAllAgentsAsync(string? userId = null)
3838
{
3939
if (string.IsNullOrEmpty(userId))
4040
{

src/GuruPR.Application/Services/ConversationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public ConversationService(ILogger<ConversationService> logger,
3636

3737
#region Public Methods
3838

39-
public async Task<IEnumerable<Conversation>> GetAllConversationsByUserIdAsync(string userId)
39+
public async Task<List<Conversation>> GetAllConversationsByUserIdAsync(string userId)
4040
{
4141
var conversations = await _unitOfWork.Conversations.GetAllByUserIdAsync(userId);
4242

src/GuruPR.Application/Services/OAuth/ProviderConnectionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ProviderConnectionService(IMapper mapper, IUnitOfWork unitOfWork)
2222

2323
#region Public Methods
2424

25-
public async Task<IEnumerable<ProviderConnection>> GetConnectionsByProviderIdAsync(string providerId)
25+
public async Task<List<ProviderConnection>> GetConnectionsByProviderIdAsync(string providerId)
2626
{
2727
var provider = await GetProviderByIdOrThrowExceptionAsync(providerId);
2828

0 commit comments

Comments
 (0)