Skip to content

Commit

Permalink
Merge with update
Browse files Browse the repository at this point in the history
  • Loading branch information
ValDekh committed Dec 18, 2023
2 parents 008e979 + 4d8ed34 commit feb7f9e
Show file tree
Hide file tree
Showing 38 changed files with 1,965 additions and 157 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using AutoMapper;
using FluentResults;
using MediatR;
using Microsoft.Extensions.Localization;
using Streetcode.BLL.DTO.Streetcode;
using Streetcode.BLL.Interfaces.Logging;
using Streetcode.BLL.MediatR.Streetcode.Streetcode.GetAllShort;
using Streetcode.BLL.SharedResource;
using Streetcode.DAL.Entities.Streetcode;
using Streetcode.DAL.Enums;
using Streetcode.DAL.Repositories.Interfaces.Base;

namespace Streetcode.BLL.MediatR.Streetcode.Streetcode.GetCount
Expand All @@ -31,7 +26,17 @@ public GetStreetcodesCountHander(IRepositoryWrapper repositoryWrapper, IMapper m

public async Task<Result<int>> Handle(GetStreetcodesCountQuery request, CancellationToken cancellationToken)
{
var streetcodes = await _repositoryWrapper.StreetcodeRepository.GetAllAsync();
IEnumerable<StreetcodeContent> streetcodes;

if (request.onlyPublished)
{
streetcodes = await _repositoryWrapper.StreetcodeRepository
.GetAllAsync(s => s.Status == StreetcodeStatus.Published);
}
else
{
streetcodes = await _repositoryWrapper.StreetcodeRepository.GetAllAsync();
}

if (streetcodes != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

namespace Streetcode.BLL.MediatR.Streetcode.Streetcode.GetCount
{
public record GetStreetcodesCountQuery : IRequest<Result<int>>;
public record GetStreetcodesCountQuery(bool onlyPublished) : IRequest<Result<int>>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class StreetcodeContent
public string? Teaser { get; set; }

[Required]
[MaxLength(50)]
[MaxLength(100)]
public string? DateString { get; set; }

[MaxLength(50)]
Expand Down
Loading

0 comments on commit feb7f9e

Please sign in to comment.