Skip to content

Commit 9ac3320

Browse files
authored
Return IReadOnlyCollection instead of IEnumerable in Catalogs (#175)
1 parent e3d85a9 commit 9ac3320

File tree

40 files changed

+174
-116
lines changed

40 files changed

+174
-116
lines changed

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/AIToolSourceType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CrestApps.OrchardCore.AI;
1+
namespace CrestApps.OrchardCore.AI;
22

33
public enum AIToolSourceType
44
{

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/IAIDataSourceStore.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public interface IAIDataSourceStore : IReadCatalog<AIDataSource>
4646
/// </summary>
4747
/// <param name="providerName"></param>
4848
/// <returns></returns>
49-
ValueTask<IEnumerable<AIDataSource>> GetAsync(string providerName);
49+
ValueTask<IReadOnlyCollection<AIDataSource>> GetAsync(string providerName);
5050

5151
/// <summary>
5252
/// Asynchronously finds data sources by the given provider-name and type.
5353
/// </summary>
5454
/// <param name="providerName"></param>
5555
/// <param name="type"></param>
5656
/// <returns></returns>
57-
ValueTask<IEnumerable<AIDataSource>> GetAsync(string providerName, string type);
57+
ValueTask<IReadOnlyCollection<AIDataSource>> GetAsync(string providerName, string type);
5858
}

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/Models/AIChatProfileSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CrestApps.OrchardCore.AI.Models;
1+
namespace CrestApps.OrchardCore.AI.Models;
22

33
public class AIChatProfileSettings
44
{

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/Models/AIDataSource.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System.Text.Json.Nodes;
22
using CrestApps.OrchardCore.Models;
3+
using CrestApps.OrchardCore.Services;
34

45
namespace CrestApps.OrchardCore.AI.Models;
56

6-
public sealed class AIDataSource : CatalogEntry, IDisplayTextAwareModel
7+
public sealed class AIDataSource : CatalogEntry, IDisplayTextAwareModel, ICloneable<AIDataSource>
78
{
89
public string ProfileSource { get; set; }
910

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/Models/AIDeployment.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using System.Text.Json.Nodes;
22
using System.Text.Json.Serialization;
33
using CrestApps.OrchardCore.Models;
4+
using CrestApps.OrchardCore.Services;
45

56
namespace CrestApps.OrchardCore.AI.Models;
67

7-
public class AIDeployment : SourceCatalogEntry, INameAwareModel, ISourceAwareModel
8+
public class AIDeployment : SourceCatalogEntry, INameAwareModel, ISourceAwareModel, ICloneable<AIDeployment>
89
{
910
[JsonIgnore]
1011
public string ProviderName

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/Models/AIProfile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System.Text.Json.Nodes;
22
using CrestApps.OrchardCore.Models;
3+
using CrestApps.OrchardCore.Services;
34

45
namespace CrestApps.OrchardCore.AI.Models;
56

6-
public sealed class AIProfile : SourceCatalogEntry, INameAwareModel, IDisplayTextAwareModel
7+
public sealed class AIProfile : SourceCatalogEntry, INameAwareModel, IDisplayTextAwareModel, ICloneable<AIProfile>
78
{
89
/// <summary>
910
/// Gets or sets the technical name of the profile.

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/Models/AIProviderConnection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using System.Text.Json.Nodes;
22
using System.Text.Json.Serialization;
33
using CrestApps.OrchardCore.Models;
4+
using CrestApps.OrchardCore.Services;
45

56
namespace CrestApps.OrchardCore.AI.Models;
67

7-
public sealed class AIProviderConnection : SourceCatalogEntry, INameAwareModel, IDisplayTextAwareModel
8+
public sealed class AIProviderConnection : SourceCatalogEntry, INameAwareModel, IDisplayTextAwareModel, ICloneable<AIProviderConnection>
89
{
910
public string Name { get; set; }
1011

src/Abstractions/CrestApps.OrchardCore.AI.Abstractions/Models/AIToolInstance.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using CrestApps.OrchardCore.Models;
2+
using CrestApps.OrchardCore.Services;
23

34
namespace CrestApps.OrchardCore.AI.Models;
45

5-
public sealed class AIToolInstance : SourceCatalogEntry, IDisplayTextAwareModel
6+
public sealed class AIToolInstance : SourceCatalogEntry, IDisplayTextAwareModel, ICloneable<AIToolInstance>
67
{
78
public string DisplayText { get; set; }
89

src/Abstractions/CrestApps.OrchardCore.Abstractions/ISourceAwareModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CrestApps.OrchardCore;
1+
namespace CrestApps.OrchardCore;
22

33
public interface ISourceAwareModel
44
{

src/Abstractions/CrestApps.OrchardCore.Abstractions/Models/PageResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ public class PageResult<T>
44
{
55
public int Count { get; set; }
66

7-
public IEnumerable<T> Entries { get; set; }
7+
public IReadOnlyCollection<T> Entries { get; set; }
88
}

0 commit comments

Comments
 (0)