Skip to content

Commit

Permalink
Add element count
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Feb 5, 2024
1 parent 70c14b4 commit 640c42c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public MappingProfile()
{
CreateMap<DialogEntity, SearchDialogDto>()
.ForMember(dest => dest.LatestActivities, opt => opt.Ignore())
.ForMember(dest => dest.ElementCount, opt =>
opt.MapFrom(src => src.Elements.Count == 0 ? (int?)null : src.Elements.Count))
.ForMember(dest => dest.Content, opt => opt.MapFrom(src => src.Content.Where(x => x.Type.OutputInList)))
.ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.StatusId));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public sealed class SearchDialogDto
public string ServiceResource { get; set; } = null!;
public string Party { get; set; } = null!;
public int? Progress { get; set; }
public int? ElementCount { get; set; }
public string? ExtendedStatus { get; set; }
public DateTimeOffset CreatedAt { get; set; }
public DateTimeOffset UpdatedAt { get; set; }
Expand All @@ -21,7 +22,6 @@ public sealed class SearchDialogDto

public List<SearchDialogContentDto> Content { get; set; } = [];
public List<SearchDialogDialogActivityDto> LatestActivities { get; set; } = [];

}

public sealed class SearchDialogContentDto
Expand Down

0 comments on commit 640c42c

Please sign in to comment.