diff --git a/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Core/Entities/Organization.cs b/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Core/Entities/Organization.cs index 97f74fa47..05ff15b83 100644 --- a/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Core/Entities/Organization.cs +++ b/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Core/Entities/Organization.cs @@ -20,13 +20,13 @@ public IEnumerable SubOrganizations private set => _subOrganizations = new HashSet(value); } - public Organization(Guid id, string name, IEnumerable organizers = null, - IEnumerable subOrganizations = null) + public Organization(Guid id, string name, IEnumerable organizationOrganizers = null, + IEnumerable organizations = null) { Id = id; Name = name; - Organizers = organizers ?? Enumerable.Empty(); - SubOrganizations = subOrganizations ?? Enumerable.Empty(); + Organizers = organizationOrganizers ?? Enumerable.Empty(); + SubOrganizations = organizations ?? Enumerable.Empty(); } public void AddOrganizer(Guid organizerId) diff --git a/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/Extensions.cs b/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/Extensions.cs index e76f3bb24..343da89eb 100644 --- a/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/Extensions.cs +++ b/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/Extensions.cs @@ -6,7 +6,7 @@ namespace MiniSpace.Services.Organizations.Infrastructure.Mongo.Documents public static class Extensions { public static Organization AsEntity(this OrganizationDocument document) - => new Organization(document.Id, document.Name, document.Organizers, document.SubOrganizations); + => new Organization(document.Id, document.Name, document.Organizers, document.SubOrganizations.Select(o => o.AsEntity())); public static OrganizationDocument AsDocument(this Organization entity) => new OrganizationDocument() @@ -14,7 +14,7 @@ public static OrganizationDocument AsDocument(this Organization entity) Id = entity.Id, Name = entity.Name, Organizers = entity.Organizers, - SubOrganizations = entity.SubOrganizations + SubOrganizations = entity.SubOrganizations.Select(o => o.AsDocument()) }; public static OrganizationDto AsDto(this OrganizationDocument document) diff --git a/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/OrganizationDocument.cs b/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/OrganizationDocument.cs index d021944d3..5e7a31dcb 100644 --- a/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/OrganizationDocument.cs +++ b/MiniSpace.Services.Organizations/src/MiniSpace.Services.Organizations.Infrastructure/Mongo/Documents/OrganizationDocument.cs @@ -8,6 +8,6 @@ public class OrganizationDocument: IIdentifiable public Guid Id { get; set; } public string Name { get; set; } public IEnumerable Organizers { get; set; } - public IEnumerable SubOrganizations { get; set; } + public IEnumerable SubOrganizations { get; set; } } } \ No newline at end of file