Compare commits
	
		
			No commits in common. "8e5003028de562ad787c74423242eeee12bef00c" and "2e8501190e1ccdf3cc899fc14ea2af361c20e36e" have entirely different histories. 
		
	
	
		
			8e5003028d
			...
			2e8501190e
		
	
		| 
						 | 
					@ -1,8 +1,6 @@
 | 
				
			||||||
using Microsoft.Extensions.Options;
 | 
					using Microsoft.Extensions.Options;
 | 
				
			||||||
using Netina.Api.Services;
 | 
					 | 
				
			||||||
using Netina.Domain.Entities.Blogs;
 | 
					using Netina.Domain.Entities.Blogs;
 | 
				
			||||||
using System.Web;
 | 
					using System.Web;
 | 
				
			||||||
using Netina.Repository.Abstracts;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Netina.Api.Controllers;
 | 
					namespace Netina.Api.Controllers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -79,13 +77,9 @@ public class BlogController : ICarterModule
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // POST:Create Entity
 | 
					    // POST:Create Entity
 | 
				
			||||||
    public async Task<IResult> Post([FromBody] BlogLDto dto, IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService, CancellationToken cancellationToken)
 | 
					    public async Task<IResult> Post([FromBody] BlogLDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (currentUserService.UserId == null)
 | 
					        var ent = Blog.Create(dto.Title, dto.Content, dto.Tags, dto.ReadingTime, dto.Summery, dto.IsSuggested,dto.CategoryId);
 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
        if (!Guid.TryParse(currentUserService.UserId, out Guid userId))
 | 
					 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
        var ent = Blog.Create(dto.Title, dto.Content, dto.Tags, dto.ReadingTime, dto.Summery, dto.IsSuggested,dto.CategoryId, userId);
 | 
					 | 
				
			||||||
        foreach (var file in dto.Files)
 | 
					        foreach (var file in dto.Files)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            ent.AddFile(file.Name, file.FileLocation, file.FileName, file.IsHeader, file.IsPrimary, file.FileType);
 | 
					            ent.AddFile(file.Name, file.FileLocation, file.FileName, file.IsHeader, file.IsPrimary, file.FileType);
 | 
				
			||||||
| 
						 | 
					@ -97,17 +91,13 @@ public class BlogController : ICarterModule
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // PUT:Update Entity
 | 
					    // PUT:Update Entity
 | 
				
			||||||
    public async Task<IResult> Put([FromBody] BlogLDto dto, IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService, CancellationToken cancellationToken)
 | 
					    public async Task<IResult> Put([FromBody] BlogLDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var ent = await repositoryWrapper.SetRepository<Blog>().TableNoTracking
 | 
					        var ent = await repositoryWrapper.SetRepository<Blog>().TableNoTracking
 | 
				
			||||||
            .FirstOrDefaultAsync(b => b.Id == dto.Id, cancellationToken);
 | 
					            .FirstOrDefaultAsync(b => b.Id == dto.Id, cancellationToken);
 | 
				
			||||||
        if (ent == null)
 | 
					        if (ent == null)
 | 
				
			||||||
            throw new AppException("Blog not found");
 | 
					            throw new AppException("Blog not found");
 | 
				
			||||||
        if (currentUserService.UserId == null)
 | 
					        var newEnt = Blog.Create(dto.Title, dto.Content, dto.Tags, dto.ReadingTime, dto.Summery, dto.IsSuggested, dto.CategoryId);
 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
        if (!Guid.TryParse(currentUserService.UserId, out Guid userId))
 | 
					 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
        var newEnt = Blog.Create(dto.Title, dto.Content, dto.Tags, dto.ReadingTime, dto.Summery, dto.IsSuggested, dto.CategoryId, userId);
 | 
					 | 
				
			||||||
        newEnt.Id = ent.Id;
 | 
					        newEnt.Id = ent.Id;
 | 
				
			||||||
        newEnt.CreatedAt = ent.CreatedAt;
 | 
					        newEnt.CreatedAt = ent.CreatedAt;
 | 
				
			||||||
        newEnt.CreatedBy = ent.CreatedBy;
 | 
					        newEnt.CreatedBy = ent.CreatedBy;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,19 +38,12 @@ public class ProductController : ICarterModule
 | 
				
			||||||
            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageProducts))
 | 
					            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageProducts))
 | 
				
			||||||
            .HasApiVersion(1.0);
 | 
					            .HasApiVersion(1.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        group.MapGet("{productId}/review",GetProductReviewsAsync)
 | 
					 | 
				
			||||||
            .WithDisplayName("Get Product Reviews")
 | 
					 | 
				
			||||||
            .HasApiVersion(1.0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        group.MapDelete("{id}", Delete)
 | 
					        group.MapDelete("{id}", Delete)
 | 
				
			||||||
            .WithDisplayName("Delete Product")
 | 
					            .WithDisplayName("Delete Product")
 | 
				
			||||||
            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageProducts))
 | 
					            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageProducts))
 | 
				
			||||||
            .HasApiVersion(1.0);
 | 
					            .HasApiVersion(1.0);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private async Task<IResult> GetProductReviewsAsync([FromQuery] int page, [FromRoute] Guid productId, IMediator mediator, CancellationToken cancellationToken)
 | 
					 | 
				
			||||||
        => TypedResults.Ok(await mediator.Send(new GetReviewsQuery(page, productId), cancellationToken));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // GET:Get All Entity
 | 
					    // GET:Get All Entity
 | 
				
			||||||
    public async Task<IResult> GetAllAsync([FromQuery] int page,
 | 
					    public async Task<IResult> GetAllAsync([FromQuery] int page,
 | 
				
			||||||
        [FromQuery] string? productName,
 | 
					        [FromQuery] string? productName,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,13 +13,13 @@ public class ProductReviewController : ICarterModule
 | 
				
			||||||
            .HasApiVersion(1.0);
 | 
					            .HasApiVersion(1.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        group.MapGet("", GetAllAsync)
 | 
					        group.MapGet("", GetAllAsync)
 | 
				
			||||||
            .WithDisplayName("Get Product Reviews")
 | 
					            .WithDisplayName("Get ProductReview")
 | 
				
			||||||
            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ViewAllReviews, ApplicationPermission.ManageReview))
 | 
					            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ViewAllReviews, ApplicationPermission.ManageReview))
 | 
				
			||||||
            .HasApiVersion(1.0);
 | 
					            .HasApiVersion(1.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        group.MapPost("", PostAsync)
 | 
					        group.MapPost("", PostAsync)
 | 
				
			||||||
            .WithDisplayName("Create ProductReview")
 | 
					            .WithDisplayName("Create ProductReview")
 | 
				
			||||||
            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser())
 | 
					            .RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageReview, ApplicationPermission.AddReview))
 | 
				
			||||||
            .HasApiVersion(1.0);
 | 
					            .HasApiVersion(1.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        group.MapPut("confirm/{id}", ConfirmAsync)
 | 
					        group.MapPut("confirm/{id}", ConfirmAsync)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -126,7 +126,7 @@ public class SeedController(IWebHostEnvironment environment) : ICarterModule
 | 
				
			||||||
                    seedBlogRequestDto.CategoryId = noCategory.Id;
 | 
					                    seedBlogRequestDto.CategoryId = noCategory.Id;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            var ent = Blog.Create(seedBlogRequestDto.Title, seedBlogRequestDto.Slug, seedBlogRequestDto.Content, seedBlogRequestDto.Tags, seedBlogRequestDto.ReadingTime,
 | 
					            var ent = Blog.Create(seedBlogRequestDto.Title, seedBlogRequestDto.Slug, seedBlogRequestDto.Content, seedBlogRequestDto.Tags, seedBlogRequestDto.ReadingTime,
 | 
				
			||||||
                seedBlogRequestDto.Summery, seedBlogRequestDto.IsSuggested, seedBlogRequestDto.CategoryId,default);
 | 
					                seedBlogRequestDto.Summery, seedBlogRequestDto.IsSuggested, seedBlogRequestDto.CategoryId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            foreach (var storageFileSDto in seedBlogRequestDto.Files)
 | 
					            foreach (var storageFileSDto in seedBlogRequestDto.Files)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,8 +6,8 @@
 | 
				
			||||||
    <ImplicitUsings>enable</ImplicitUsings>
 | 
					    <ImplicitUsings>enable</ImplicitUsings>
 | 
				
			||||||
    <InvariantGlobalization>true</InvariantGlobalization>
 | 
					    <InvariantGlobalization>true</InvariantGlobalization>
 | 
				
			||||||
    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
 | 
					    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
 | 
				
			||||||
    <AssemblyVersion>1.4.12.17</AssemblyVersion>
 | 
					    <AssemblyVersion>1.2.11.13</AssemblyVersion>
 | 
				
			||||||
    <FileVersion>1.4.12.17do</FileVersion>
 | 
					    <FileVersion>1.2.11.13</FileVersion>
 | 
				
			||||||
  </PropertyGroup>
 | 
					  </PropertyGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,6 @@ builder.Host.UseSerilog();
 | 
				
			||||||
LoggerConfig.ConfigureSerilog();
 | 
					LoggerConfig.ConfigureSerilog();
 | 
				
			||||||
string env = builder.Environment.IsDevelopment() == true ? "Development" : "Production";
 | 
					string env = builder.Environment.IsDevelopment() == true ? "Development" : "Production";
 | 
				
			||||||
builder.Host.UseContentRoot(Directory.GetCurrentDirectory());
 | 
					builder.Host.UseContentRoot(Directory.GetCurrentDirectory());
 | 
				
			||||||
 | 
					 | 
				
			||||||
if (builder.Environment.IsDevelopment())
 | 
					if (builder.Environment.IsDevelopment())
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    string projectName = "Vesmeh";
 | 
					    string projectName = "Vesmeh";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,24 +1,16 @@
 | 
				
			||||||
namespace Netina.Common.Models.Entity
 | 
					namespace Netina.Common.Models.Entity
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    [AttributeUsage(AttributeTargets.Class)]
 | 
					    [AttributeUsage(AttributeTargets.Class)]
 | 
				
			||||||
    public class PageClassDisplay : Attribute
 | 
					    public class PageClassDisplay(string name, string description) : Attribute
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private readonly string _name;
 | 
					 | 
				
			||||||
        private readonly string _description;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        public PageClassDisplay(string name, string description)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            _name = name;
 | 
					 | 
				
			||||||
            _description = description;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        public string GetName()
 | 
					        public string GetName()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return _name;
 | 
					            return name;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string GetDescription()
 | 
					        public string GetDescription()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return _description;
 | 
					            return description;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -104,10 +104,7 @@ public class PageService(
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var newLink = pageSetting.RedirectItems.FirstOrDefault(f => f.OldUrl.ToLower().Trim() == oldEncode.ToLower().Trim());
 | 
					            var newLink = pageSetting.RedirectItems.FirstOrDefault(f => f.OldUrl.ToLower().Trim() == oldEncode.ToLower().Trim());
 | 
				
			||||||
            if (newLink != null)
 | 
					            if (newLink != null)
 | 
				
			||||||
            {
 | 
					                return newLink.NewUrl;
 | 
				
			||||||
                var response = newLink.NewUrl[0] == '/' ? newLink.NewUrl : $"/{newLink.NewUrl}";
 | 
					 | 
				
			||||||
                return response;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                throw new BaseApiException(ApiResultStatusCode.NotFound, "Url not found");
 | 
					                throw new BaseApiException(ApiResultStatusCode.NotFound, "Url not found");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,9 @@
 | 
				
			||||||
using Review = Netina.Domain.Entities.Reviews.Review;
 | 
					namespace Netina.Core.EntityServices.ReviewHandlers;
 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace Netina.Core.EntityServices.ReviewHandlers;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class ConfirmReviewCommandHandler(IRepositoryWrapper repositoryWrapper)
 | 
					public class ConfirmReviewCommandHandler(IRepositoryWrapper repositoryWrapper)
 | 
				
			||||||
    : IRequestHandler<ConfirmReviewCommand, Guid>
 | 
					    : IRequestHandler<ConfirmReviewCommand, bool>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public async Task<Guid> Handle(ConfirmReviewCommand request, CancellationToken cancellationToken)
 | 
					    public async Task<bool> Handle(ConfirmReviewCommand request, CancellationToken cancellationToken)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var review = await repositoryWrapper.SetRepository<Review>().TableNoTracking
 | 
					        var review = await repositoryWrapper.SetRepository<Review>().TableNoTracking
 | 
				
			||||||
            .FirstOrDefaultAsync(r => r.Id == request.Id, cancellationToken);
 | 
					            .FirstOrDefaultAsync(r => r.Id == request.Id, cancellationToken);
 | 
				
			||||||
| 
						 | 
					@ -15,6 +13,6 @@ public class ConfirmReviewCommandHandler(IRepositoryWrapper repositoryWrapper)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        repositoryWrapper.SetRepository<Review>().Update(review);
 | 
					        repositoryWrapper.SetRepository<Review>().Update(review);
 | 
				
			||||||
        await repositoryWrapper.SaveChangesAsync(cancellationToken);
 | 
					        await repositoryWrapper.SaveChangesAsync(cancellationToken);
 | 
				
			||||||
        return review.Id;
 | 
					        return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
namespace Netina.Domain.CommandQueries.Commands;
 | 
					namespace Netina.Domain.CommandQueries.Commands;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public sealed record CreateReviewCommand(string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId) : IRequest<Guid>;
 | 
					public sealed record CreateReviewCommand(string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId) : IRequest<ReviewSDto>;
 | 
				
			||||||
public sealed record UpdateReviewCommand(Guid Id,string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId): IRequest<Guid>;
 | 
					public sealed record UpdateReviewCommand(Guid Id,string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId): IRequest<bool>;
 | 
				
			||||||
public sealed record ConfirmReviewCommand(Guid Id) : IRequest<Guid>;
 | 
					public sealed record ConfirmReviewCommand(Guid Id) : IRequest<bool>;
 | 
				
			||||||
public sealed record DeleteReviewCommand(Guid Id) : IRequest<Guid>;
 | 
					public sealed record DeleteReviewCommand(Guid Id) : IRequest<bool>;
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
namespace Netina.Domain.CommandQueries.Queries;
 | 
					namespace Netina.Domain.CommandQueries.Queries;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public record GetReviewsQuery(int Page = 0,Guid? ProductId = null) : IRequest<List<ReviewSDto>>;
 | 
					public record GetReviewsQuery(int Page = 0) : IRequest<List<ReviewSDto>>;
 | 
				
			||||||
public record GetReviewQuery(Guid Id) : IRequest<ReviewLDto>;
 | 
					public record GetReviewQuery(Guid Id) : IRequest<ReviewLDto>;
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,5 @@ public class BlogLDto : BaseDto<BlogLDto , Blog>
 | 
				
			||||||
    public bool IsSuggested { get; set; }
 | 
					    public bool IsSuggested { get; set; }
 | 
				
			||||||
    public Guid CategoryId { get; set; }
 | 
					    public Guid CategoryId { get; set; }
 | 
				
			||||||
    public string CategoryName { get; set; } = string.Empty;
 | 
					    public string CategoryName { get; set; } = string.Empty;
 | 
				
			||||||
    public Guid AuthorId { get; set; }
 | 
					 | 
				
			||||||
    public string AuthorFullName { get; set; } = string.Empty;
 | 
					 | 
				
			||||||
    public List<StorageFileSDto> Files { get; set; } = new();
 | 
					    public List<StorageFileSDto> Files { get; set; } = new();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -31,6 +31,4 @@ public class ProductLDto : BaseDto<ProductLDto,Product>
 | 
				
			||||||
    public List<StorageFileSDto> Files { get; set; } = new();
 | 
					    public List<StorageFileSDto> Files { get; set; } = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public DiscountSDto? SpecialOffer { get; set; }
 | 
					    public DiscountSDto? SpecialOffer { get; set; }
 | 
				
			||||||
    public Guid AuthorId { get; set; }
 | 
					 | 
				
			||||||
    public string AuthorFullName { get; set; } = string.Empty;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,4 @@
 | 
				
			||||||
using Review = Netina.Domain.Entities.Reviews.Review;
 | 
					namespace Netina.Domain.Dtos.LargDtos;
 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace Netina.Domain.Dtos.LargDtos;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class ReviewLDto : BaseDto<ReviewLDto,Review>
 | 
					public class ReviewLDto : BaseDto<ReviewLDto,Review>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,6 +12,4 @@ public class BlogSDto : BaseDto<BlogSDto , Blog>
 | 
				
			||||||
    public string CategoryName { get; set; } = string.Empty;
 | 
					    public string CategoryName { get; set; } = string.Empty;
 | 
				
			||||||
    public string MainImage { get; set; } = string.Empty;
 | 
					    public string MainImage { get; set; } = string.Empty;
 | 
				
			||||||
    public DateTime ModifiedAt { get; set; }
 | 
					    public DateTime ModifiedAt { get; set; }
 | 
				
			||||||
    public Guid AuthorId { get; set; }
 | 
					 | 
				
			||||||
    public string AuthorFullName { get; set; } = string.Empty;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -30,6 +30,4 @@ public class ProductSDto : BaseDto<ProductSDto, Product>
 | 
				
			||||||
    public string BrandName { get; set; } = string.Empty;
 | 
					    public string BrandName { get; set; } = string.Empty;
 | 
				
			||||||
    public string CategoryName { get; set; } = string.Empty;
 | 
					    public string CategoryName { get; set; } = string.Empty;
 | 
				
			||||||
    public DateTime ModifiedAt { get; set; }
 | 
					    public DateTime ModifiedAt { get; set; }
 | 
				
			||||||
    public Guid AuthorId { get; set; }
 | 
					 | 
				
			||||||
    public string AuthorFullName { get; set; } = string.Empty;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,4 @@
 | 
				
			||||||
using Review = Netina.Domain.Entities.Reviews.Review;
 | 
					namespace Netina.Domain.Dtos.SmallDtos;
 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace Netina.Domain.Dtos.SmallDtos;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class ReviewSDto : BaseDto<ReviewSDto, Review>
 | 
					public class ReviewSDto : BaseDto<ReviewSDto, Review>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,17 +2,17 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public partial class Blog
 | 
					public partial class Blog
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public static Blog Create(string title, string content, string tags, int readingTime, string summery, bool isSuggested, Guid categoryId, Guid authorId)
 | 
					    public static Blog Create(string title, string content, string tags, int readingTime, string summery, bool isSuggested, Guid categoryId)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var slug = StringExtensions.GetSlug(title);
 | 
					        var slug = StringExtensions.GetSlug(title);
 | 
				
			||||||
        return new Blog(title, slug, content, tags, readingTime, summery, isSuggested, categoryId,authorId);
 | 
					        return new Blog(title, slug, content, tags, readingTime, summery, isSuggested, categoryId);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static Blog Create(string title, string slug, string content, string tags, int readingTime, string summery, bool isSuggested, Guid categoryId, Guid authorId)
 | 
					    public static Blog Create(string title, string slug, string content, string tags, int readingTime, string summery, bool isSuggested, Guid categoryId)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (slug.IsNullOrEmpty())
 | 
					        if (slug.IsNullOrEmpty())
 | 
				
			||||||
            slug = StringExtensions.GetSlug(title);
 | 
					            slug = StringExtensions.GetSlug(title);
 | 
				
			||||||
        return new Blog(title, slug, content, tags, readingTime, summery, isSuggested, categoryId, authorId);
 | 
					        return new Blog(title, slug, content, tags, readingTime, summery, isSuggested, categoryId);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public BlogStorageFile AddFile(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType)
 | 
					    public BlogStorageFile AddFile(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@ public partial class Blog : ApiEntity
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public Blog(string title,string slug,string content,string tags, int readingTime,string summery, bool isSuggested, Guid categoryId,Guid authorId)
 | 
					    public Blog(string title,string slug,string content,string tags, int readingTime,string summery, bool isSuggested, Guid categoryId)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Title = title;
 | 
					        Title = title;
 | 
				
			||||||
        Content = content;
 | 
					        Content = content;
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,6 @@ public partial class Blog : ApiEntity
 | 
				
			||||||
        Summery = summery;
 | 
					        Summery = summery;
 | 
				
			||||||
        IsSuggested = isSuggested;
 | 
					        IsSuggested = isSuggested;
 | 
				
			||||||
        CategoryId = categoryId;
 | 
					        CategoryId = categoryId;
 | 
				
			||||||
        AuthorId = authorId;
 | 
					 | 
				
			||||||
        Slug = slug;
 | 
					        Slug = slug;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public string Title { get; internal set; } = string.Empty;
 | 
					    public string Title { get; internal set; } = string.Empty;
 | 
				
			||||||
| 
						 | 
					@ -33,7 +32,5 @@ public partial class Blog : ApiEntity
 | 
				
			||||||
    public Guid CategoryId { get; internal set; }
 | 
					    public Guid CategoryId { get; internal set; }
 | 
				
			||||||
    public BlogCategory? Category { get; internal set; }
 | 
					    public BlogCategory? Category { get; internal set; }
 | 
				
			||||||
    public List<BlogStorageFile> Files { get; internal set; } = new();
 | 
					    public List<BlogStorageFile> Files { get; internal set; } = new();
 | 
				
			||||||
    public Guid AuthorId { get; internal set; }
 | 
					 | 
				
			||||||
    public ApplicationUser? Author { get; internal set; }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
 | 
					[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
 | 
				
			||||||
[GenerateMapper]
 | 
					[GenerateMapper]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//[Index(nameof(Slug), IsUnique = true)]
 | 
					[Index(nameof(Slug), IsUnique = true)]
 | 
				
			||||||
public partial class Brand : ApiEntity
 | 
					public partial class Brand : ApiEntity
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public Brand()
 | 
					    public Brand()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@ public partial class Product
 | 
				
			||||||
        int stock,
 | 
					        int stock,
 | 
				
			||||||
        int maxOrderCount,
 | 
					        int maxOrderCount,
 | 
				
			||||||
        Guid brandId,
 | 
					        Guid brandId,
 | 
				
			||||||
        Guid categoryId, Guid authorId)
 | 
					        Guid categoryId)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var slug = StringExtensions.GetSlug(persianName);
 | 
					        var slug = StringExtensions.GetSlug(persianName);
 | 
				
			||||||
        return new Product(
 | 
					        return new Product(
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ public partial class Product
 | 
				
			||||||
            maxOrderCount,
 | 
					            maxOrderCount,
 | 
				
			||||||
            stock > 0,
 | 
					            stock > 0,
 | 
				
			||||||
            brandId,
 | 
					            brandId,
 | 
				
			||||||
            categoryId,authorId);
 | 
					            categoryId);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void AddRate(float rate)
 | 
					    public void AddRate(float rate)
 | 
				
			||||||
| 
						 | 
					@ -69,7 +69,16 @@ public partial class ProductStorageFile
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public partial class Review
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public static Review Create(string title, string comment, float rate, bool isBuyer, Guid productId, Guid userId)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return new Review(title, comment, rate, isBuyer, productId, userId);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void ConfirmReview()
 | 
				
			||||||
 | 
					        => IsConfirmed = true;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public partial class Specification
 | 
					public partial class Specification
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@
 | 
				
			||||||
[GenerateMapper]
 | 
					[GenerateMapper]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//[Index(nameof(Slug), IsUnique = true)]
 | 
					[Index(nameof(Slug), IsUnique = true)]
 | 
				
			||||||
public partial class Product : ApiEntity
 | 
					public partial class Product : ApiEntity
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public Product()
 | 
					    public Product()
 | 
				
			||||||
| 
						 | 
					@ -32,8 +32,7 @@ public partial class Product : ApiEntity
 | 
				
			||||||
        int maxOrderCount,
 | 
					        int maxOrderCount,
 | 
				
			||||||
        bool isEnable,
 | 
					        bool isEnable,
 | 
				
			||||||
        Guid brandId,
 | 
					        Guid brandId,
 | 
				
			||||||
        Guid categoryId,
 | 
					        Guid categoryId)
 | 
				
			||||||
        Guid authorId)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        PersianName = persianName;
 | 
					        PersianName = persianName;
 | 
				
			||||||
        EnglishName = englishName;
 | 
					        EnglishName = englishName;
 | 
				
			||||||
| 
						 | 
					@ -51,7 +50,6 @@ public partial class Product : ApiEntity
 | 
				
			||||||
        IsEnable = isEnable;
 | 
					        IsEnable = isEnable;
 | 
				
			||||||
        BrandId = brandId;
 | 
					        BrandId = brandId;
 | 
				
			||||||
        CategoryId = categoryId;
 | 
					        CategoryId = categoryId;
 | 
				
			||||||
        AuthorId = authorId;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public string PersianName { get; internal set; } = string.Empty;
 | 
					    public string PersianName { get; internal set; } = string.Empty;
 | 
				
			||||||
    public string EnglishName { get; internal set; } = string.Empty;
 | 
					    public string EnglishName { get; internal set; } = string.Empty;
 | 
				
			||||||
| 
						 | 
					@ -75,12 +73,10 @@ public partial class Product : ApiEntity
 | 
				
			||||||
    public Brand? Brand { get; internal set; }
 | 
					    public Brand? Brand { get; internal set; }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    public Guid CategoryId { get; internal set; }
 | 
					    public Guid CategoryId { get; internal set; }
 | 
				
			||||||
    public Guid AuthorId { get; internal set; }
 | 
					 | 
				
			||||||
    public ApplicationUser? Author { get; internal set; }
 | 
					 | 
				
			||||||
    public ProductCategory? Category { get; internal set; }
 | 
					    public ProductCategory? Category { get; internal set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public List<Specification> Specifications { get; internal set; } = new();
 | 
					    public List<Specification> Specifications { get; internal set; } = new();
 | 
				
			||||||
    public List<Reviews.Review> Reviews { get; internal set; } = new();
 | 
					    public List<Review> Reviews { get; internal set; } = new();
 | 
				
			||||||
    public List<ProductStorageFile> Files { get; internal set; } = new();
 | 
					    public List<ProductStorageFile> Files { get; internal set; } = new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public List<OrderProduct> OrderProducts { get; internal set; } = new();
 | 
					    public List<OrderProduct> OrderProducts { get; internal set; } = new();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
namespace Netina.Domain.Entities.Reviews;
 | 
					namespace Netina.Domain.Entities.Products;
 | 
				
			||||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
 | 
					[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
 | 
				
			||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
 | 
					[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
 | 
				
			||||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
 | 
					[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
 | 
				
			||||||
| 
						 | 
					@ -1,12 +0,0 @@
 | 
				
			||||||
namespace Netina.Domain.Entities.Reviews;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
public partial class Review
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    public static Reviews.Review Create(string title, string comment, float rate, bool isBuyer, Guid productId, Guid userId)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        return new Reviews.Review(title, comment, rate, isBuyer, productId, userId);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    public void ConfirmReview()
 | 
					 | 
				
			||||||
        => IsConfirmed = true;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -2,11 +2,9 @@ using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Linq.Expressions;
 | 
					using System.Linq.Expressions;
 | 
				
			||||||
using Mapster.Models;
 | 
					 | 
				
			||||||
using Netina.Domain.Dtos.LargDtos;
 | 
					using Netina.Domain.Dtos.LargDtos;
 | 
				
			||||||
using Netina.Domain.Dtos.SmallDtos;
 | 
					using Netina.Domain.Dtos.SmallDtos;
 | 
				
			||||||
using Netina.Domain.Entities.Blogs;
 | 
					using Netina.Domain.Entities.Blogs;
 | 
				
			||||||
using Netina.Domain.Entities.Users;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Netina.Domain.Mappers
 | 
					namespace Netina.Domain.Mappers
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -57,8 +55,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                    Name = p8.CategoryName,
 | 
					                    Name = p8.CategoryName,
 | 
				
			||||||
                    Id = p8.CategoryId
 | 
					                    Id = p8.CategoryId
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                AuthorId = p8.AuthorId,
 | 
					 | 
				
			||||||
                Author = new ApplicationUser() {Id = p8.AuthorId},
 | 
					 | 
				
			||||||
                Id = p8.Id,
 | 
					                Id = p8.Id,
 | 
				
			||||||
                CreatedAt = p8.CreatedAt,
 | 
					                CreatedAt = p8.CreatedAt,
 | 
				
			||||||
                ModifiedAt = p8.ModifiedAt
 | 
					                ModifiedAt = p8.ModifiedAt
 | 
				
			||||||
| 
						 | 
					@ -109,7 +105,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                CategoryName = p16.Category.Name,
 | 
					                CategoryName = p16.Category.Name,
 | 
				
			||||||
                MainImage = p16.Files.Count > 0 && p16.Files.Any<BlogStorageFile>(f => f.IsPrimary) ? p16.Files.FirstOrDefault<BlogStorageFile>(f => f.IsPrimary).FileName : string.Empty,
 | 
					                MainImage = p16.Files.Count > 0 && p16.Files.Any<BlogStorageFile>(f => f.IsPrimary) ? p16.Files.FirstOrDefault<BlogStorageFile>(f => f.IsPrimary).FileName : string.Empty,
 | 
				
			||||||
                ModifiedAt = p16.ModifiedAt,
 | 
					                ModifiedAt = p16.ModifiedAt,
 | 
				
			||||||
                AuthorId = p16.AuthorId,
 | 
					 | 
				
			||||||
                Id = p16.Id,
 | 
					                Id = p16.Id,
 | 
				
			||||||
                CreatedAt = p16.CreatedAt
 | 
					                CreatedAt = p16.CreatedAt
 | 
				
			||||||
            }).ToList<BlogSDto>(),
 | 
					            }).ToList<BlogSDto>(),
 | 
				
			||||||
| 
						 | 
					@ -123,9 +118,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                Name = p17.Name,
 | 
					                Name = p17.Name,
 | 
				
			||||||
                Slug = p17.Slug,
 | 
					                Slug = p17.Slug,
 | 
				
			||||||
                Description = p17.Description,
 | 
					                Description = p17.Description,
 | 
				
			||||||
                IsMain = p17.IsMain,
 | 
					 | 
				
			||||||
                ParentId = (Guid?)p17.ParentId,
 | 
					 | 
				
			||||||
                Parent = new BlogCategory() {Id = p17.ParentId},
 | 
					 | 
				
			||||||
                Id = p17.Id,
 | 
					                Id = p17.Id,
 | 
				
			||||||
                CreatedAt = p17.CreatedAt
 | 
					                CreatedAt = p17.CreatedAt
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
| 
						 | 
					@ -141,57 +133,48 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            result.Name = p18.Name;
 | 
					            result.Name = p18.Name;
 | 
				
			||||||
            result.Slug = p18.Slug;
 | 
					            result.Slug = p18.Slug;
 | 
				
			||||||
            result.Description = p18.Description;
 | 
					            result.Description = p18.Description;
 | 
				
			||||||
            result.IsMain = p18.IsMain;
 | 
					 | 
				
			||||||
            result.ParentId = (Guid?)p18.ParentId;
 | 
					 | 
				
			||||||
            result.Parent = funcMain7(new Never(), result.Parent, p18);
 | 
					 | 
				
			||||||
            result.Id = p18.Id;
 | 
					            result.Id = p18.Id;
 | 
				
			||||||
            result.CreatedAt = p18.CreatedAt;
 | 
					            result.CreatedAt = p18.CreatedAt;
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static BlogCategorySDto AdaptToSDto(this BlogCategory p22)
 | 
					        public static BlogCategorySDto AdaptToSDto(this BlogCategory p20)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return p22 == null ? null : new BlogCategorySDto()
 | 
					            return p20 == null ? null : new BlogCategorySDto()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Name = p22.Name,
 | 
					                Name = p20.Name,
 | 
				
			||||||
                BlogCount = funcMain8(p22.Blogs == null ? null : (int?)p22.Blogs.Count),
 | 
					                BlogCount = funcMain7(p20.Blogs == null ? null : (int?)p20.Blogs.Count),
 | 
				
			||||||
                Description = p22.Description,
 | 
					                Description = p20.Description,
 | 
				
			||||||
                Slug = p22.Slug,
 | 
					                Slug = p20.Slug,
 | 
				
			||||||
                IsMain = p22.IsMain,
 | 
					                Id = p20.Id,
 | 
				
			||||||
                ParentId = p22.ParentId == null ? default(Guid) : (Guid)p22.ParentId,
 | 
					                CreatedAt = p20.CreatedAt
 | 
				
			||||||
                Id = p22.Id,
 | 
					 | 
				
			||||||
                CreatedAt = p22.CreatedAt
 | 
					 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static BlogCategorySDto AdaptTo(this BlogCategory p24, BlogCategorySDto p25)
 | 
					        public static BlogCategorySDto AdaptTo(this BlogCategory p22, BlogCategorySDto p23)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (p24 == null)
 | 
					            if (p22 == null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            BlogCategorySDto result = p25 ?? new BlogCategorySDto();
 | 
					            BlogCategorySDto result = p23 ?? new BlogCategorySDto();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.Name = p24.Name;
 | 
					            result.Name = p22.Name;
 | 
				
			||||||
            result.BlogCount = funcMain9(p24.Blogs == null ? null : (int?)p24.Blogs.Count, result.BlogCount);
 | 
					            result.BlogCount = funcMain8(p22.Blogs == null ? null : (int?)p22.Blogs.Count, result.BlogCount);
 | 
				
			||||||
            result.Description = p24.Description;
 | 
					            result.Description = p22.Description;
 | 
				
			||||||
            result.Slug = p24.Slug;
 | 
					            result.Slug = p22.Slug;
 | 
				
			||||||
            result.IsMain = p24.IsMain;
 | 
					            result.Id = p22.Id;
 | 
				
			||||||
            result.ParentId = p24.ParentId == null ? default(Guid) : (Guid)p24.ParentId;
 | 
					            result.CreatedAt = p22.CreatedAt;
 | 
				
			||||||
            result.Id = p24.Id;
 | 
					 | 
				
			||||||
            result.CreatedAt = p24.CreatedAt;
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static Expression<Func<BlogCategory, BlogCategorySDto>> ProjectToSDto => p28 => new BlogCategorySDto()
 | 
					        public static Expression<Func<BlogCategory, BlogCategorySDto>> ProjectToSDto => p26 => new BlogCategorySDto()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Name = p28.Name,
 | 
					            Name = p26.Name,
 | 
				
			||||||
            BlogCount = p28.Blogs.Count,
 | 
					            BlogCount = p26.Blogs.Count,
 | 
				
			||||||
            Description = p28.Description,
 | 
					            Description = p26.Description,
 | 
				
			||||||
            Slug = p28.Slug,
 | 
					            Slug = p26.Slug,
 | 
				
			||||||
            IsMain = p28.IsMain,
 | 
					            Id = p26.Id,
 | 
				
			||||||
            ParentId = p28.ParentId == null ? default(Guid) : (Guid)p28.ParentId,
 | 
					            CreatedAt = p26.CreatedAt
 | 
				
			||||||
            Id = p28.Id,
 | 
					 | 
				
			||||||
            CreatedAt = p28.CreatedAt
 | 
					 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static List<Blog> funcMain1(List<BlogSDto> p2)
 | 
					        private static List<Blog> funcMain1(List<BlogSDto> p2)
 | 
				
			||||||
| 
						 | 
					@ -222,8 +205,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                        Name = item.CategoryName,
 | 
					                        Name = item.CategoryName,
 | 
				
			||||||
                        Id = item.CategoryId
 | 
					                        Id = item.CategoryId
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    AuthorId = item.AuthorId,
 | 
					 | 
				
			||||||
                    Author = new ApplicationUser() {Id = item.AuthorId},
 | 
					 | 
				
			||||||
                    Id = item.Id,
 | 
					                    Id = item.Id,
 | 
				
			||||||
                    CreatedAt = item.CreatedAt,
 | 
					                    CreatedAt = item.CreatedAt,
 | 
				
			||||||
                    ModifiedAt = item.ModifiedAt
 | 
					                    ModifiedAt = item.ModifiedAt
 | 
				
			||||||
| 
						 | 
					@ -262,8 +243,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                        Name = item.CategoryName,
 | 
					                        Name = item.CategoryName,
 | 
				
			||||||
                        Id = item.CategoryId
 | 
					                        Id = item.CategoryId
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                    AuthorId = item.AuthorId,
 | 
					 | 
				
			||||||
                    Author = new ApplicationUser() {Id = item.AuthorId},
 | 
					 | 
				
			||||||
                    Id = item.Id,
 | 
					                    Id = item.Id,
 | 
				
			||||||
                    CreatedAt = item.CreatedAt,
 | 
					                    CreatedAt = item.CreatedAt,
 | 
				
			||||||
                    ModifiedAt = item.ModifiedAt
 | 
					                    ModifiedAt = item.ModifiedAt
 | 
				
			||||||
| 
						 | 
					@ -300,7 +279,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                    CategoryName = item.Category == null ? null : item.Category.Name,
 | 
					                    CategoryName = item.Category == null ? null : item.Category.Name,
 | 
				
			||||||
                    MainImage = item.Files.Count > 0 && item.Files.Any<BlogStorageFile>(funcMain4) ? item.Files.FirstOrDefault<BlogStorageFile>(funcMain5).FileName : string.Empty,
 | 
					                    MainImage = item.Files.Count > 0 && item.Files.Any<BlogStorageFile>(funcMain4) ? item.Files.FirstOrDefault<BlogStorageFile>(funcMain5).FileName : string.Empty,
 | 
				
			||||||
                    ModifiedAt = item.ModifiedAt,
 | 
					                    ModifiedAt = item.ModifiedAt,
 | 
				
			||||||
                    AuthorId = item.AuthorId,
 | 
					 | 
				
			||||||
                    Id = item.Id,
 | 
					                    Id = item.Id,
 | 
				
			||||||
                    CreatedAt = item.CreatedAt
 | 
					                    CreatedAt = item.CreatedAt
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
| 
						 | 
					@ -336,7 +314,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                    CategoryName = item.Category == null ? null : item.Category.Name,
 | 
					                    CategoryName = item.Category == null ? null : item.Category.Name,
 | 
				
			||||||
                    MainImage = item.Files.Count > 0 && item.Files.Any<BlogStorageFile>(funcMain4) ? item.Files.FirstOrDefault<BlogStorageFile>(funcMain5).FileName : string.Empty,
 | 
					                    MainImage = item.Files.Count > 0 && item.Files.Any<BlogStorageFile>(funcMain4) ? item.Files.FirstOrDefault<BlogStorageFile>(funcMain5).FileName : string.Empty,
 | 
				
			||||||
                    ModifiedAt = item.ModifiedAt,
 | 
					                    ModifiedAt = item.ModifiedAt,
 | 
				
			||||||
                    AuthorId = item.AuthorId,
 | 
					 | 
				
			||||||
                    Id = item.Id,
 | 
					                    Id = item.Id,
 | 
				
			||||||
                    CreatedAt = item.CreatedAt
 | 
					                    CreatedAt = item.CreatedAt
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
| 
						 | 
					@ -346,23 +323,14 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static BlogCategory funcMain7(Never p20, BlogCategory p21, BlogCategorySDto p18)
 | 
					        private static int funcMain7(int? p21)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            BlogCategory result = p21 ?? new BlogCategory();
 | 
					            return p21 == null ? 0 : (int)p21;
 | 
				
			||||||
            
 | 
					 | 
				
			||||||
            result.Id = p18.ParentId;
 | 
					 | 
				
			||||||
            return result;
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static int funcMain8(int? p23)
 | 
					        private static int funcMain8(int? p24, int p25)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return p23 == null ? 0 : (int)p23;
 | 
					            return p24 == null ? 0 : (int)p24;
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        private static int funcMain9(int? p26, int p27)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return p26 == null ? 0 : (int)p26;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static bool funcMain4(BlogStorageFile f)
 | 
					        private static bool funcMain4(BlogStorageFile f)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,7 +6,6 @@ using Mapster.Models;
 | 
				
			||||||
using Netina.Domain.Dtos.LargDtos;
 | 
					using Netina.Domain.Dtos.LargDtos;
 | 
				
			||||||
using Netina.Domain.Dtos.SmallDtos;
 | 
					using Netina.Domain.Dtos.SmallDtos;
 | 
				
			||||||
using Netina.Domain.Entities.Blogs;
 | 
					using Netina.Domain.Entities.Blogs;
 | 
				
			||||||
using Netina.Domain.Entities.Users;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Netina.Domain.Mappers
 | 
					namespace Netina.Domain.Mappers
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -30,8 +29,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                    Id = p1.CategoryId
 | 
					                    Id = p1.CategoryId
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                Files = funcMain1(p1.Files),
 | 
					                Files = funcMain1(p1.Files),
 | 
				
			||||||
                AuthorId = p1.AuthorId,
 | 
					 | 
				
			||||||
                Author = new ApplicationUser() {Id = p1.AuthorId},
 | 
					 | 
				
			||||||
                Id = p1.Id,
 | 
					                Id = p1.Id,
 | 
				
			||||||
                CreatedAt = p1.CreatedAt
 | 
					                CreatedAt = p1.CreatedAt
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
| 
						 | 
					@ -54,223 +51,206 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            result.CategoryId = p3.CategoryId;
 | 
					            result.CategoryId = p3.CategoryId;
 | 
				
			||||||
            result.Category = funcMain2(new Never(), result.Category, p3);
 | 
					            result.Category = funcMain2(new Never(), result.Category, p3);
 | 
				
			||||||
            result.Files = funcMain3(p3.Files, result.Files);
 | 
					            result.Files = funcMain3(p3.Files, result.Files);
 | 
				
			||||||
            result.AuthorId = p3.AuthorId;
 | 
					 | 
				
			||||||
            result.Author = funcMain4(new Never(), result.Author, p3);
 | 
					 | 
				
			||||||
            result.Id = p3.Id;
 | 
					            result.Id = p3.Id;
 | 
				
			||||||
            result.CreatedAt = p3.CreatedAt;
 | 
					            result.CreatedAt = p3.CreatedAt;
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static Expression<Func<BlogLDto, Blog>> ProjectToBlog => p11 => new Blog()
 | 
					        public static Expression<Func<BlogLDto, Blog>> ProjectToBlog => p9 => new Blog()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Title = p9.Title,
 | 
				
			||||||
 | 
					            Content = p9.Content,
 | 
				
			||||||
 | 
					            Slug = p9.Slug,
 | 
				
			||||||
 | 
					            Tags = p9.Tags,
 | 
				
			||||||
 | 
					            ReadingTime = p9.ReadingTime,
 | 
				
			||||||
 | 
					            Summery = p9.Summery,
 | 
				
			||||||
 | 
					            IsSuggested = p9.IsSuggested,
 | 
				
			||||||
 | 
					            CategoryId = p9.CategoryId,
 | 
				
			||||||
 | 
					            Category = new BlogCategory()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Name = p9.CategoryName,
 | 
				
			||||||
 | 
					                Id = p9.CategoryId
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            Files = p9.Files.Select<StorageFileSDto, BlogStorageFile>(p10 => new BlogStorageFile()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Name = p10.Name,
 | 
				
			||||||
 | 
					                FileLocation = p10.FileLocation,
 | 
				
			||||||
 | 
					                FileName = p10.FileName,
 | 
				
			||||||
 | 
					                IsHeader = p10.IsHeader,
 | 
				
			||||||
 | 
					                IsPrimary = p10.IsPrimary,
 | 
				
			||||||
 | 
					                FileType = p10.FileType,
 | 
				
			||||||
 | 
					                Id = p10.Id,
 | 
				
			||||||
 | 
					                CreatedAt = p10.CreatedAt
 | 
				
			||||||
 | 
					            }).ToList<BlogStorageFile>(),
 | 
				
			||||||
 | 
					            Id = p9.Id,
 | 
				
			||||||
 | 
					            CreatedAt = p9.CreatedAt
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        public static BlogLDto AdaptToLDto(this Blog p11)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return p11 == null ? null : new BlogLDto()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Title = p11.Title,
 | 
					                Title = p11.Title,
 | 
				
			||||||
                Content = p11.Content,
 | 
					                Content = p11.Content,
 | 
				
			||||||
            Slug = p11.Slug,
 | 
					 | 
				
			||||||
                Tags = p11.Tags,
 | 
					                Tags = p11.Tags,
 | 
				
			||||||
 | 
					                Slug = p11.Slug,
 | 
				
			||||||
                ReadingTime = p11.ReadingTime,
 | 
					                ReadingTime = p11.ReadingTime,
 | 
				
			||||||
                Summery = p11.Summery,
 | 
					                Summery = p11.Summery,
 | 
				
			||||||
 | 
					                MainImage = p11.Files.Count > 0 && p11.Files.Any<BlogStorageFile>(funcMain4) ? p11.Files.FirstOrDefault<BlogStorageFile>(funcMain5).FileName : string.Empty,
 | 
				
			||||||
                IsSuggested = p11.IsSuggested,
 | 
					                IsSuggested = p11.IsSuggested,
 | 
				
			||||||
                CategoryId = p11.CategoryId,
 | 
					                CategoryId = p11.CategoryId,
 | 
				
			||||||
            Category = new BlogCategory()
 | 
					                CategoryName = p11.Category == null ? null : p11.Category.Name,
 | 
				
			||||||
            {
 | 
					                Files = funcMain6(p11.Files),
 | 
				
			||||||
                Name = p11.CategoryName,
 | 
					 | 
				
			||||||
                Id = p11.CategoryId
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
            Files = p11.Files.Select<StorageFileSDto, BlogStorageFile>(p12 => new BlogStorageFile()
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                Name = p12.Name,
 | 
					 | 
				
			||||||
                FileLocation = p12.FileLocation,
 | 
					 | 
				
			||||||
                FileName = p12.FileName,
 | 
					 | 
				
			||||||
                IsHeader = p12.IsHeader,
 | 
					 | 
				
			||||||
                IsPrimary = p12.IsPrimary,
 | 
					 | 
				
			||||||
                FileType = p12.FileType,
 | 
					 | 
				
			||||||
                Id = p12.Id,
 | 
					 | 
				
			||||||
                CreatedAt = p12.CreatedAt
 | 
					 | 
				
			||||||
            }).ToList<BlogStorageFile>(),
 | 
					 | 
				
			||||||
            AuthorId = p11.AuthorId,
 | 
					 | 
				
			||||||
            Author = new ApplicationUser() {Id = p11.AuthorId},
 | 
					 | 
				
			||||||
                Id = p11.Id,
 | 
					                Id = p11.Id,
 | 
				
			||||||
                CreatedAt = p11.CreatedAt
 | 
					                CreatedAt = p11.CreatedAt
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        public static BlogLDto AdaptToLDto(this Blog p13)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return p13 == null ? null : new BlogLDto()
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                Title = p13.Title,
 | 
					 | 
				
			||||||
                Content = p13.Content,
 | 
					 | 
				
			||||||
                Tags = p13.Tags,
 | 
					 | 
				
			||||||
                Slug = p13.Slug,
 | 
					 | 
				
			||||||
                ReadingTime = p13.ReadingTime,
 | 
					 | 
				
			||||||
                Summery = p13.Summery,
 | 
					 | 
				
			||||||
                MainImage = p13.Files.Count > 0 && p13.Files.Any<BlogStorageFile>(funcMain5) ? p13.Files.FirstOrDefault<BlogStorageFile>(funcMain6).FileName : string.Empty,
 | 
					 | 
				
			||||||
                IsSuggested = p13.IsSuggested,
 | 
					 | 
				
			||||||
                CategoryId = p13.CategoryId,
 | 
					 | 
				
			||||||
                CategoryName = p13.Category == null ? null : p13.Category.Name,
 | 
					 | 
				
			||||||
                AuthorId = p13.AuthorId,
 | 
					 | 
				
			||||||
                AuthorFullName = p13.Author != null ? p13.Author.FirstName + " " + p13.Author.LastName : string.Empty,
 | 
					 | 
				
			||||||
                Files = funcMain7(p13.Files),
 | 
					 | 
				
			||||||
                Id = p13.Id,
 | 
					 | 
				
			||||||
                CreatedAt = p13.CreatedAt
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static BlogLDto AdaptTo(this Blog p15, BlogLDto p16)
 | 
					        public static BlogLDto AdaptTo(this Blog p13, BlogLDto p14)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (p15 == null)
 | 
					            if (p13 == null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            BlogLDto result = p16 ?? new BlogLDto();
 | 
					            BlogLDto result = p14 ?? new BlogLDto();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.Title = p15.Title;
 | 
					            result.Title = p13.Title;
 | 
				
			||||||
            result.Content = p15.Content;
 | 
					            result.Content = p13.Content;
 | 
				
			||||||
            result.Tags = p15.Tags;
 | 
					            result.Tags = p13.Tags;
 | 
				
			||||||
            result.Slug = p15.Slug;
 | 
					            result.Slug = p13.Slug;
 | 
				
			||||||
            result.ReadingTime = p15.ReadingTime;
 | 
					            result.ReadingTime = p13.ReadingTime;
 | 
				
			||||||
            result.Summery = p15.Summery;
 | 
					            result.Summery = p13.Summery;
 | 
				
			||||||
            result.MainImage = p15.Files.Count > 0 && p15.Files.Any<BlogStorageFile>(funcMain5) ? p15.Files.FirstOrDefault<BlogStorageFile>(funcMain6).FileName : string.Empty;
 | 
					            result.MainImage = p13.Files.Count > 0 && p13.Files.Any<BlogStorageFile>(funcMain4) ? p13.Files.FirstOrDefault<BlogStorageFile>(funcMain5).FileName : string.Empty;
 | 
				
			||||||
            result.IsSuggested = p15.IsSuggested;
 | 
					            result.IsSuggested = p13.IsSuggested;
 | 
				
			||||||
            result.CategoryId = p15.CategoryId;
 | 
					            result.CategoryId = p13.CategoryId;
 | 
				
			||||||
            result.CategoryName = p15.Category == null ? null : p15.Category.Name;
 | 
					            result.CategoryName = p13.Category == null ? null : p13.Category.Name;
 | 
				
			||||||
            result.AuthorId = p15.AuthorId;
 | 
					            result.Files = funcMain7(p13.Files, result.Files);
 | 
				
			||||||
            result.AuthorFullName = p15.Author != null ? p15.Author.FirstName + " " + p15.Author.LastName : string.Empty;
 | 
					            result.Id = p13.Id;
 | 
				
			||||||
            result.Files = funcMain8(p15.Files, result.Files);
 | 
					            result.CreatedAt = p13.CreatedAt;
 | 
				
			||||||
            result.Id = p15.Id;
 | 
					 | 
				
			||||||
            result.CreatedAt = p15.CreatedAt;
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static Expression<Func<Blog, BlogLDto>> ProjectToLDto => p19 => new BlogLDto()
 | 
					        public static Expression<Func<Blog, BlogLDto>> ProjectToLDto => p17 => new BlogLDto()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Title = p17.Title,
 | 
				
			||||||
 | 
					            Content = p17.Content,
 | 
				
			||||||
 | 
					            Tags = p17.Tags,
 | 
				
			||||||
 | 
					            Slug = p17.Slug,
 | 
				
			||||||
 | 
					            ReadingTime = p17.ReadingTime,
 | 
				
			||||||
 | 
					            Summery = p17.Summery,
 | 
				
			||||||
 | 
					            MainImage = p17.Files.Count > 0 && p17.Files.Any<BlogStorageFile>(f => f.IsPrimary) ? p17.Files.FirstOrDefault<BlogStorageFile>(f => f.IsPrimary).FileName : string.Empty,
 | 
				
			||||||
 | 
					            IsSuggested = p17.IsSuggested,
 | 
				
			||||||
 | 
					            CategoryId = p17.CategoryId,
 | 
				
			||||||
 | 
					            CategoryName = p17.Category.Name,
 | 
				
			||||||
 | 
					            Files = p17.Files.Select<BlogStorageFile, StorageFileSDto>(p18 => new StorageFileSDto()
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Name = p18.Name,
 | 
				
			||||||
 | 
					                FileLocation = p18.FileLocation,
 | 
				
			||||||
 | 
					                FileName = p18.FileName,
 | 
				
			||||||
 | 
					                IsHeader = p18.IsHeader,
 | 
				
			||||||
 | 
					                IsPrimary = p18.IsPrimary,
 | 
				
			||||||
 | 
					                FileType = p18.FileType,
 | 
				
			||||||
 | 
					                Id = p18.Id
 | 
				
			||||||
 | 
					            }).ToList<StorageFileSDto>(),
 | 
				
			||||||
 | 
					            Id = p17.Id,
 | 
				
			||||||
 | 
					            CreatedAt = p17.CreatedAt
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        public static Blog AdaptToBlog(this BlogSDto p19)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return p19 == null ? null : new Blog()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Title = p19.Title,
 | 
					                Title = p19.Title,
 | 
				
			||||||
            Content = p19.Content,
 | 
					 | 
				
			||||||
            Tags = p19.Tags,
 | 
					 | 
				
			||||||
                Slug = p19.Slug,
 | 
					                Slug = p19.Slug,
 | 
				
			||||||
 | 
					                Tags = p19.Tags,
 | 
				
			||||||
                ReadingTime = p19.ReadingTime,
 | 
					                ReadingTime = p19.ReadingTime,
 | 
				
			||||||
                Summery = p19.Summery,
 | 
					                Summery = p19.Summery,
 | 
				
			||||||
            MainImage = p19.Files.Count > 0 && p19.Files.Any<BlogStorageFile>(f => f.IsPrimary) ? p19.Files.FirstOrDefault<BlogStorageFile>(f => f.IsPrimary).FileName : string.Empty,
 | 
					 | 
				
			||||||
                IsSuggested = p19.IsSuggested,
 | 
					                IsSuggested = p19.IsSuggested,
 | 
				
			||||||
                CategoryId = p19.CategoryId,
 | 
					                CategoryId = p19.CategoryId,
 | 
				
			||||||
            CategoryName = p19.Category.Name,
 | 
					 | 
				
			||||||
            AuthorId = p19.AuthorId,
 | 
					 | 
				
			||||||
            AuthorFullName = p19.Author != null ? p19.Author.FirstName + " " + p19.Author.LastName : string.Empty,
 | 
					 | 
				
			||||||
            Files = p19.Files.Select<BlogStorageFile, StorageFileSDto>(p20 => new StorageFileSDto()
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                Name = p20.Name,
 | 
					 | 
				
			||||||
                FileLocation = p20.FileLocation,
 | 
					 | 
				
			||||||
                FileName = p20.FileName,
 | 
					 | 
				
			||||||
                IsHeader = p20.IsHeader,
 | 
					 | 
				
			||||||
                IsPrimary = p20.IsPrimary,
 | 
					 | 
				
			||||||
                FileType = p20.FileType,
 | 
					 | 
				
			||||||
                Id = p20.Id
 | 
					 | 
				
			||||||
            }).ToList<StorageFileSDto>(),
 | 
					 | 
				
			||||||
            Id = p19.Id,
 | 
					 | 
				
			||||||
            CreatedAt = p19.CreatedAt
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
        public static Blog AdaptToBlog(this BlogSDto p21)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return p21 == null ? null : new Blog()
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                Title = p21.Title,
 | 
					 | 
				
			||||||
                Slug = p21.Slug,
 | 
					 | 
				
			||||||
                Tags = p21.Tags,
 | 
					 | 
				
			||||||
                ReadingTime = p21.ReadingTime,
 | 
					 | 
				
			||||||
                Summery = p21.Summery,
 | 
					 | 
				
			||||||
                IsSuggested = p21.IsSuggested,
 | 
					 | 
				
			||||||
                CategoryId = p21.CategoryId,
 | 
					 | 
				
			||||||
                Category = new BlogCategory()
 | 
					                Category = new BlogCategory()
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Name = p21.CategoryName,
 | 
					                    Name = p19.CategoryName,
 | 
				
			||||||
                    Id = p21.CategoryId
 | 
					                    Id = p19.CategoryId
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                AuthorId = p21.AuthorId,
 | 
					                Id = p19.Id,
 | 
				
			||||||
                Author = new ApplicationUser() {Id = p21.AuthorId},
 | 
					                CreatedAt = p19.CreatedAt,
 | 
				
			||||||
                Id = p21.Id,
 | 
					                ModifiedAt = p19.ModifiedAt
 | 
				
			||||||
                CreatedAt = p21.CreatedAt,
 | 
					 | 
				
			||||||
                ModifiedAt = p21.ModifiedAt
 | 
					 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static Blog AdaptTo(this BlogSDto p22, Blog p23)
 | 
					        public static Blog AdaptTo(this BlogSDto p20, Blog p21)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (p22 == null)
 | 
					            if (p20 == null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            Blog result = p23 ?? new Blog();
 | 
					            Blog result = p21 ?? new Blog();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.Title = p22.Title;
 | 
					            result.Title = p20.Title;
 | 
				
			||||||
            result.Slug = p22.Slug;
 | 
					            result.Slug = p20.Slug;
 | 
				
			||||||
            result.Tags = p22.Tags;
 | 
					            result.Tags = p20.Tags;
 | 
				
			||||||
            result.ReadingTime = p22.ReadingTime;
 | 
					            result.ReadingTime = p20.ReadingTime;
 | 
				
			||||||
            result.Summery = p22.Summery;
 | 
					            result.Summery = p20.Summery;
 | 
				
			||||||
            result.IsSuggested = p22.IsSuggested;
 | 
					            result.IsSuggested = p20.IsSuggested;
 | 
				
			||||||
            result.CategoryId = p22.CategoryId;
 | 
					            result.CategoryId = p20.CategoryId;
 | 
				
			||||||
            result.Category = funcMain9(new Never(), result.Category, p22);
 | 
					            result.Category = funcMain8(new Never(), result.Category, p20);
 | 
				
			||||||
            result.AuthorId = p22.AuthorId;
 | 
					            result.Id = p20.Id;
 | 
				
			||||||
            result.Author = funcMain10(new Never(), result.Author, p22);
 | 
					            result.CreatedAt = p20.CreatedAt;
 | 
				
			||||||
            result.Id = p22.Id;
 | 
					            result.ModifiedAt = p20.ModifiedAt;
 | 
				
			||||||
            result.CreatedAt = p22.CreatedAt;
 | 
					 | 
				
			||||||
            result.ModifiedAt = p22.ModifiedAt;
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static BlogSDto AdaptToSDto(this Blog p28)
 | 
					        public static BlogSDto AdaptToSDto(this Blog p24)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return p28 == null ? null : new BlogSDto()
 | 
					            return p24 == null ? null : new BlogSDto()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Title = p28.Title,
 | 
					                Title = p24.Title,
 | 
				
			||||||
                Slug = p28.Slug,
 | 
					                Slug = p24.Slug,
 | 
				
			||||||
                Tags = p28.Tags,
 | 
					                Tags = p24.Tags,
 | 
				
			||||||
                ReadingTime = p28.ReadingTime,
 | 
					                ReadingTime = p24.ReadingTime,
 | 
				
			||||||
                Summery = p28.Summery,
 | 
					                Summery = p24.Summery,
 | 
				
			||||||
                IsSuggested = p28.IsSuggested,
 | 
					                IsSuggested = p24.IsSuggested,
 | 
				
			||||||
                CategoryId = p28.CategoryId,
 | 
					                CategoryId = p24.CategoryId,
 | 
				
			||||||
                CategoryName = p28.Category == null ? null : p28.Category.Name,
 | 
					                CategoryName = p24.Category == null ? null : p24.Category.Name,
 | 
				
			||||||
                MainImage = p28.Files.Count > 0 && p28.Files.Any<BlogStorageFile>(funcMain11) ? p28.Files.FirstOrDefault<BlogStorageFile>(funcMain12).FileName : string.Empty,
 | 
					                MainImage = p24.Files.Count > 0 && p24.Files.Any<BlogStorageFile>(funcMain9) ? p24.Files.FirstOrDefault<BlogStorageFile>(funcMain10).FileName : string.Empty,
 | 
				
			||||||
                ModifiedAt = p28.ModifiedAt,
 | 
					                ModifiedAt = p24.ModifiedAt,
 | 
				
			||||||
                AuthorId = p28.AuthorId,
 | 
					                Id = p24.Id,
 | 
				
			||||||
                Id = p28.Id,
 | 
					                CreatedAt = p24.CreatedAt
 | 
				
			||||||
                CreatedAt = p28.CreatedAt
 | 
					 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static BlogSDto AdaptTo(this Blog p29, BlogSDto p30)
 | 
					        public static BlogSDto AdaptTo(this Blog p25, BlogSDto p26)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (p29 == null)
 | 
					            if (p25 == null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            BlogSDto result = p30 ?? new BlogSDto();
 | 
					            BlogSDto result = p26 ?? new BlogSDto();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.Title = p29.Title;
 | 
					            result.Title = p25.Title;
 | 
				
			||||||
            result.Slug = p29.Slug;
 | 
					            result.Slug = p25.Slug;
 | 
				
			||||||
            result.Tags = p29.Tags;
 | 
					            result.Tags = p25.Tags;
 | 
				
			||||||
            result.ReadingTime = p29.ReadingTime;
 | 
					            result.ReadingTime = p25.ReadingTime;
 | 
				
			||||||
            result.Summery = p29.Summery;
 | 
					            result.Summery = p25.Summery;
 | 
				
			||||||
            result.IsSuggested = p29.IsSuggested;
 | 
					            result.IsSuggested = p25.IsSuggested;
 | 
				
			||||||
            result.CategoryId = p29.CategoryId;
 | 
					            result.CategoryId = p25.CategoryId;
 | 
				
			||||||
            result.CategoryName = p29.Category == null ? null : p29.Category.Name;
 | 
					            result.CategoryName = p25.Category == null ? null : p25.Category.Name;
 | 
				
			||||||
            result.MainImage = p29.Files.Count > 0 && p29.Files.Any<BlogStorageFile>(funcMain11) ? p29.Files.FirstOrDefault<BlogStorageFile>(funcMain12).FileName : string.Empty;
 | 
					            result.MainImage = p25.Files.Count > 0 && p25.Files.Any<BlogStorageFile>(funcMain9) ? p25.Files.FirstOrDefault<BlogStorageFile>(funcMain10).FileName : string.Empty;
 | 
				
			||||||
            result.ModifiedAt = p29.ModifiedAt;
 | 
					            result.ModifiedAt = p25.ModifiedAt;
 | 
				
			||||||
            result.AuthorId = p29.AuthorId;
 | 
					            result.Id = p25.Id;
 | 
				
			||||||
            result.Id = p29.Id;
 | 
					            result.CreatedAt = p25.CreatedAt;
 | 
				
			||||||
            result.CreatedAt = p29.CreatedAt;
 | 
					 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public static Expression<Func<Blog, BlogSDto>> ProjectToSDto => p31 => new BlogSDto()
 | 
					        public static Expression<Func<Blog, BlogSDto>> ProjectToSDto => p27 => new BlogSDto()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Title = p31.Title,
 | 
					            Title = p27.Title,
 | 
				
			||||||
            Slug = p31.Slug,
 | 
					            Slug = p27.Slug,
 | 
				
			||||||
            Tags = p31.Tags,
 | 
					            Tags = p27.Tags,
 | 
				
			||||||
            ReadingTime = p31.ReadingTime,
 | 
					            ReadingTime = p27.ReadingTime,
 | 
				
			||||||
            Summery = p31.Summery,
 | 
					            Summery = p27.Summery,
 | 
				
			||||||
            IsSuggested = p31.IsSuggested,
 | 
					            IsSuggested = p27.IsSuggested,
 | 
				
			||||||
            CategoryId = p31.CategoryId,
 | 
					            CategoryId = p27.CategoryId,
 | 
				
			||||||
            CategoryName = p31.Category.Name,
 | 
					            CategoryName = p27.Category.Name,
 | 
				
			||||||
            MainImage = p31.Files.Count > 0 && p31.Files.Any<BlogStorageFile>(f => f.IsPrimary) ? p31.Files.FirstOrDefault<BlogStorageFile>(f => f.IsPrimary).FileName : string.Empty,
 | 
					            MainImage = p27.Files.Count > 0 && p27.Files.Any<BlogStorageFile>(f => f.IsPrimary) ? p27.Files.FirstOrDefault<BlogStorageFile>(f => f.IsPrimary).FileName : string.Empty,
 | 
				
			||||||
            ModifiedAt = p31.ModifiedAt,
 | 
					            ModifiedAt = p27.ModifiedAt,
 | 
				
			||||||
            AuthorId = p31.AuthorId,
 | 
					            Id = p27.Id,
 | 
				
			||||||
            Id = p31.Id,
 | 
					            CreatedAt = p27.CreatedAt
 | 
				
			||||||
            CreatedAt = p31.CreatedAt
 | 
					 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static List<BlogStorageFile> funcMain1(List<StorageFileSDto> p2)
 | 
					        private static List<BlogStorageFile> funcMain1(List<StorageFileSDto> p2)
 | 
				
			||||||
| 
						 | 
					@ -345,13 +325,9 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static ApplicationUser funcMain4(Never p9, ApplicationUser p10, BlogLDto p3)
 | 
					        private static bool funcMain4(BlogStorageFile f)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            ApplicationUser result = p10 ?? new ApplicationUser();
 | 
					            return f.IsPrimary;
 | 
				
			||||||
            
 | 
					 | 
				
			||||||
            result.Id = p3.AuthorId;
 | 
					 | 
				
			||||||
            return result;
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static bool funcMain5(BlogStorageFile f)
 | 
					        private static bool funcMain5(BlogStorageFile f)
 | 
				
			||||||
| 
						 | 
					@ -359,25 +335,20 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            return f.IsPrimary;
 | 
					            return f.IsPrimary;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static bool funcMain6(BlogStorageFile f)
 | 
					        private static List<StorageFileSDto> funcMain6(List<BlogStorageFile> p12)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return f.IsPrimary;
 | 
					            if (p12 == null)
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        private static List<StorageFileSDto> funcMain7(List<BlogStorageFile> p14)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (p14 == null)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            List<StorageFileSDto> result = new List<StorageFileSDto>(p14.Count);
 | 
					            List<StorageFileSDto> result = new List<StorageFileSDto>(p12.Count);
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            int i = 0;
 | 
					            int i = 0;
 | 
				
			||||||
            int len = p14.Count;
 | 
					            int len = p12.Count;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            while (i < len)
 | 
					            while (i < len)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                BlogStorageFile item = p14[i];
 | 
					                BlogStorageFile item = p12[i];
 | 
				
			||||||
                result.Add(item == null ? null : new StorageFileSDto()
 | 
					                result.Add(item == null ? null : new StorageFileSDto()
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Name = item.Name,
 | 
					                    Name = item.Name,
 | 
				
			||||||
| 
						 | 
					@ -394,20 +365,20 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static List<StorageFileSDto> funcMain8(List<BlogStorageFile> p17, List<StorageFileSDto> p18)
 | 
					        private static List<StorageFileSDto> funcMain7(List<BlogStorageFile> p15, List<StorageFileSDto> p16)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (p17 == null)
 | 
					            if (p15 == null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return null;
 | 
					                return null;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            List<StorageFileSDto> result = new List<StorageFileSDto>(p17.Count);
 | 
					            List<StorageFileSDto> result = new List<StorageFileSDto>(p15.Count);
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            int i = 0;
 | 
					            int i = 0;
 | 
				
			||||||
            int len = p17.Count;
 | 
					            int len = p15.Count;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            while (i < len)
 | 
					            while (i < len)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                BlogStorageFile item = p17[i];
 | 
					                BlogStorageFile item = p15[i];
 | 
				
			||||||
                result.Add(item == null ? null : new StorageFileSDto()
 | 
					                result.Add(item == null ? null : new StorageFileSDto()
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Name = item.Name,
 | 
					                    Name = item.Name,
 | 
				
			||||||
| 
						 | 
					@ -424,31 +395,22 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static BlogCategory funcMain9(Never p24, BlogCategory p25, BlogSDto p22)
 | 
					        private static BlogCategory funcMain8(Never p22, BlogCategory p23, BlogSDto p20)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            BlogCategory result = p25 ?? new BlogCategory();
 | 
					            BlogCategory result = p23 ?? new BlogCategory();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.Name = p22.CategoryName;
 | 
					            result.Name = p20.CategoryName;
 | 
				
			||||||
            result.Id = p22.CategoryId;
 | 
					            result.Id = p20.CategoryId;
 | 
				
			||||||
            return result;
 | 
					            return result;
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static ApplicationUser funcMain10(Never p26, ApplicationUser p27, BlogSDto p22)
 | 
					        private static bool funcMain9(BlogStorageFile f)
 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            ApplicationUser result = p27 ?? new ApplicationUser();
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
            result.Id = p22.AuthorId;
 | 
					 | 
				
			||||||
            return result;
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        private static bool funcMain11(BlogStorageFile f)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return f.IsPrimary;
 | 
					            return f.IsPrimary;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private static bool funcMain12(BlogStorageFile f)
 | 
					        private static bool funcMain10(BlogStorageFile f)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return f.IsPrimary;
 | 
					            return f.IsPrimary;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                PersianName = p1.PersianName,
 | 
					                PersianName = p1.PersianName,
 | 
				
			||||||
                EnglishName = p1.EnglishName,
 | 
					                EnglishName = p1.EnglishName,
 | 
				
			||||||
                Slug = p1.Slug,
 | 
					 | 
				
			||||||
                Description = p1.Description,
 | 
					                Description = p1.Description,
 | 
				
			||||||
                HasSpecialPage = p1.HasSpecialPage,
 | 
					                HasSpecialPage = p1.HasSpecialPage,
 | 
				
			||||||
                PageUrl = p1.PageUrl,
 | 
					                PageUrl = p1.PageUrl,
 | 
				
			||||||
| 
						 | 
					@ -35,7 +34,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.PersianName = p3.PersianName;
 | 
					            result.PersianName = p3.PersianName;
 | 
				
			||||||
            result.EnglishName = p3.EnglishName;
 | 
					            result.EnglishName = p3.EnglishName;
 | 
				
			||||||
            result.Slug = p3.Slug;
 | 
					 | 
				
			||||||
            result.Description = p3.Description;
 | 
					            result.Description = p3.Description;
 | 
				
			||||||
            result.HasSpecialPage = p3.HasSpecialPage;
 | 
					            result.HasSpecialPage = p3.HasSpecialPage;
 | 
				
			||||||
            result.PageUrl = p3.PageUrl;
 | 
					            result.PageUrl = p3.PageUrl;
 | 
				
			||||||
| 
						 | 
					@ -49,7 +47,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            PersianName = p7.PersianName,
 | 
					            PersianName = p7.PersianName,
 | 
				
			||||||
            EnglishName = p7.EnglishName,
 | 
					            EnglishName = p7.EnglishName,
 | 
				
			||||||
            Slug = p7.Slug,
 | 
					 | 
				
			||||||
            Description = p7.Description,
 | 
					            Description = p7.Description,
 | 
				
			||||||
            HasSpecialPage = p7.HasSpecialPage,
 | 
					            HasSpecialPage = p7.HasSpecialPage,
 | 
				
			||||||
            PageUrl = p7.PageUrl,
 | 
					            PageUrl = p7.PageUrl,
 | 
				
			||||||
| 
						 | 
					@ -75,7 +72,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                EnglishName = p9.EnglishName,
 | 
					                EnglishName = p9.EnglishName,
 | 
				
			||||||
                Description = p9.Description,
 | 
					                Description = p9.Description,
 | 
				
			||||||
                HasSpecialPage = p9.HasSpecialPage,
 | 
					                HasSpecialPage = p9.HasSpecialPage,
 | 
				
			||||||
                Slug = p9.Slug,
 | 
					 | 
				
			||||||
                PageUrl = p9.PageUrl,
 | 
					                PageUrl = p9.PageUrl,
 | 
				
			||||||
                Files = funcMain3(p9.Files),
 | 
					                Files = funcMain3(p9.Files),
 | 
				
			||||||
                Id = p9.Id,
 | 
					                Id = p9.Id,
 | 
				
			||||||
| 
						 | 
					@ -94,7 +90,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            result.EnglishName = p11.EnglishName;
 | 
					            result.EnglishName = p11.EnglishName;
 | 
				
			||||||
            result.Description = p11.Description;
 | 
					            result.Description = p11.Description;
 | 
				
			||||||
            result.HasSpecialPage = p11.HasSpecialPage;
 | 
					            result.HasSpecialPage = p11.HasSpecialPage;
 | 
				
			||||||
            result.Slug = p11.Slug;
 | 
					 | 
				
			||||||
            result.PageUrl = p11.PageUrl;
 | 
					            result.PageUrl = p11.PageUrl;
 | 
				
			||||||
            result.Files = funcMain4(p11.Files, result.Files);
 | 
					            result.Files = funcMain4(p11.Files, result.Files);
 | 
				
			||||||
            result.Id = p11.Id;
 | 
					            result.Id = p11.Id;
 | 
				
			||||||
| 
						 | 
					@ -108,7 +103,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            EnglishName = p15.EnglishName,
 | 
					            EnglishName = p15.EnglishName,
 | 
				
			||||||
            Description = p15.Description,
 | 
					            Description = p15.Description,
 | 
				
			||||||
            HasSpecialPage = p15.HasSpecialPage,
 | 
					            HasSpecialPage = p15.HasSpecialPage,
 | 
				
			||||||
            Slug = p15.Slug,
 | 
					 | 
				
			||||||
            PageUrl = p15.PageUrl,
 | 
					            PageUrl = p15.PageUrl,
 | 
				
			||||||
            Files = p15.Files.Select<BrandStorageFile, StorageFileSDto>(p16 => new StorageFileSDto()
 | 
					            Files = p15.Files.Select<BrandStorageFile, StorageFileSDto>(p16 => new StorageFileSDto()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -129,7 +123,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                PersianName = p17.PersianName,
 | 
					                PersianName = p17.PersianName,
 | 
				
			||||||
                EnglishName = p17.EnglishName,
 | 
					                EnglishName = p17.EnglishName,
 | 
				
			||||||
                Slug = p17.Slug,
 | 
					 | 
				
			||||||
                Description = p17.Description,
 | 
					                Description = p17.Description,
 | 
				
			||||||
                HasSpecialPage = p17.HasSpecialPage,
 | 
					                HasSpecialPage = p17.HasSpecialPage,
 | 
				
			||||||
                PageUrl = p17.PageUrl,
 | 
					                PageUrl = p17.PageUrl,
 | 
				
			||||||
| 
						 | 
					@ -147,7 +140,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.PersianName = p18.PersianName;
 | 
					            result.PersianName = p18.PersianName;
 | 
				
			||||||
            result.EnglishName = p18.EnglishName;
 | 
					            result.EnglishName = p18.EnglishName;
 | 
				
			||||||
            result.Slug = p18.Slug;
 | 
					 | 
				
			||||||
            result.Description = p18.Description;
 | 
					            result.Description = p18.Description;
 | 
				
			||||||
            result.HasSpecialPage = p18.HasSpecialPage;
 | 
					            result.HasSpecialPage = p18.HasSpecialPage;
 | 
				
			||||||
            result.PageUrl = p18.PageUrl;
 | 
					            result.PageUrl = p18.PageUrl;
 | 
				
			||||||
| 
						 | 
					@ -163,7 +155,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                PersianName = p20.PersianName,
 | 
					                PersianName = p20.PersianName,
 | 
				
			||||||
                EnglishName = p20.EnglishName,
 | 
					                EnglishName = p20.EnglishName,
 | 
				
			||||||
                Description = p20.Description,
 | 
					                Description = p20.Description,
 | 
				
			||||||
                Slug = p20.Slug,
 | 
					 | 
				
			||||||
                HasSpecialPage = p20.HasSpecialPage,
 | 
					                HasSpecialPage = p20.HasSpecialPage,
 | 
				
			||||||
                PageUrl = p20.PageUrl,
 | 
					                PageUrl = p20.PageUrl,
 | 
				
			||||||
                Id = p20.Id,
 | 
					                Id = p20.Id,
 | 
				
			||||||
| 
						 | 
					@ -181,7 +172,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            result.PersianName = p21.PersianName;
 | 
					            result.PersianName = p21.PersianName;
 | 
				
			||||||
            result.EnglishName = p21.EnglishName;
 | 
					            result.EnglishName = p21.EnglishName;
 | 
				
			||||||
            result.Description = p21.Description;
 | 
					            result.Description = p21.Description;
 | 
				
			||||||
            result.Slug = p21.Slug;
 | 
					 | 
				
			||||||
            result.HasSpecialPage = p21.HasSpecialPage;
 | 
					            result.HasSpecialPage = p21.HasSpecialPage;
 | 
				
			||||||
            result.PageUrl = p21.PageUrl;
 | 
					            result.PageUrl = p21.PageUrl;
 | 
				
			||||||
            result.Id = p21.Id;
 | 
					            result.Id = p21.Id;
 | 
				
			||||||
| 
						 | 
					@ -194,7 +184,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            PersianName = p23.PersianName,
 | 
					            PersianName = p23.PersianName,
 | 
				
			||||||
            EnglishName = p23.EnglishName,
 | 
					            EnglishName = p23.EnglishName,
 | 
				
			||||||
            Description = p23.Description,
 | 
					            Description = p23.Description,
 | 
				
			||||||
            Slug = p23.Slug,
 | 
					 | 
				
			||||||
            HasSpecialPage = p23.HasSpecialPage,
 | 
					            HasSpecialPage = p23.HasSpecialPage,
 | 
				
			||||||
            PageUrl = p23.PageUrl,
 | 
					            PageUrl = p23.PageUrl,
 | 
				
			||||||
            Id = p23.Id,
 | 
					            Id = p23.Id,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            return p1 == null ? null : new ProductCategory()
 | 
					            return p1 == null ? null : new ProductCategory()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Name = p1.Name,
 | 
					                Name = p1.Name,
 | 
				
			||||||
                Slug = p1.Slug,
 | 
					 | 
				
			||||||
                Description = p1.Description,
 | 
					                Description = p1.Description,
 | 
				
			||||||
                IsMain = p1.IsMain,
 | 
					                IsMain = p1.IsMain,
 | 
				
			||||||
                ParentId = (Guid?)p1.ParentId,
 | 
					                ParentId = (Guid?)p1.ParentId,
 | 
				
			||||||
| 
						 | 
					@ -39,7 +38,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            ProductCategory result = p4 ?? new ProductCategory();
 | 
					            ProductCategory result = p4 ?? new ProductCategory();
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            result.Name = p3.Name;
 | 
					            result.Name = p3.Name;
 | 
				
			||||||
            result.Slug = p3.Slug;
 | 
					 | 
				
			||||||
            result.Description = p3.Description;
 | 
					            result.Description = p3.Description;
 | 
				
			||||||
            result.IsMain = p3.IsMain;
 | 
					            result.IsMain = p3.IsMain;
 | 
				
			||||||
            result.ParentId = (Guid?)p3.ParentId;
 | 
					            result.ParentId = (Guid?)p3.ParentId;
 | 
				
			||||||
| 
						 | 
					@ -53,7 +51,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
        public static Expression<Func<ProductCategoryLDto, ProductCategory>> ProjectToProductCategory => p9 => new ProductCategory()
 | 
					        public static Expression<Func<ProductCategoryLDto, ProductCategory>> ProjectToProductCategory => p9 => new ProductCategory()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Name = p9.Name,
 | 
					            Name = p9.Name,
 | 
				
			||||||
            Slug = p9.Slug,
 | 
					 | 
				
			||||||
            Description = p9.Description,
 | 
					            Description = p9.Description,
 | 
				
			||||||
            IsMain = p9.IsMain,
 | 
					            IsMain = p9.IsMain,
 | 
				
			||||||
            ParentId = (Guid?)p9.ParentId,
 | 
					            ParentId = (Guid?)p9.ParentId,
 | 
				
			||||||
| 
						 | 
					@ -84,7 +81,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
                Description = p11.Description,
 | 
					                Description = p11.Description,
 | 
				
			||||||
                ParentId = p11.ParentId == null ? default(Guid) : (Guid)p11.ParentId,
 | 
					                ParentId = p11.ParentId == null ? default(Guid) : (Guid)p11.ParentId,
 | 
				
			||||||
                ParentName = p11.Parent != null ? p11.Parent.Name : string.Empty,
 | 
					                ParentName = p11.Parent != null ? p11.Parent.Name : string.Empty,
 | 
				
			||||||
                Slug = p11.Slug,
 | 
					 | 
				
			||||||
                IsMain = p11.IsMain,
 | 
					                IsMain = p11.IsMain,
 | 
				
			||||||
                Files = funcMain4(p11.Files),
 | 
					                Files = funcMain4(p11.Files),
 | 
				
			||||||
                Id = p11.Id,
 | 
					                Id = p11.Id,
 | 
				
			||||||
| 
						 | 
					@ -103,7 +99,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            result.Description = p13.Description;
 | 
					            result.Description = p13.Description;
 | 
				
			||||||
            result.ParentId = p13.ParentId == null ? default(Guid) : (Guid)p13.ParentId;
 | 
					            result.ParentId = p13.ParentId == null ? default(Guid) : (Guid)p13.ParentId;
 | 
				
			||||||
            result.ParentName = p13.Parent != null ? p13.Parent.Name : string.Empty;
 | 
					            result.ParentName = p13.Parent != null ? p13.Parent.Name : string.Empty;
 | 
				
			||||||
            result.Slug = p13.Slug;
 | 
					 | 
				
			||||||
            result.IsMain = p13.IsMain;
 | 
					            result.IsMain = p13.IsMain;
 | 
				
			||||||
            result.Files = funcMain5(p13.Files, result.Files);
 | 
					            result.Files = funcMain5(p13.Files, result.Files);
 | 
				
			||||||
            result.Id = p13.Id;
 | 
					            result.Id = p13.Id;
 | 
				
			||||||
| 
						 | 
					@ -117,7 +112,6 @@ namespace Netina.Domain.Mappers
 | 
				
			||||||
            Description = p17.Description,
 | 
					            Description = p17.Description,
 | 
				
			||||||
            ParentId = p17.ParentId == null ? default(Guid) : (Guid)p17.ParentId,
 | 
					            ParentId = p17.ParentId == null ? default(Guid) : (Guid)p17.ParentId,
 | 
				
			||||||
            ParentName = p17.Parent != null ? p17.Parent.Name : string.Empty,
 | 
					            ParentName = p17.Parent != null ? p17.Parent.Name : string.Empty,
 | 
				
			||||||
            Slug = p17.Slug,
 | 
					 | 
				
			||||||
            IsMain = p17.IsMain,
 | 
					            IsMain = p17.IsMain,
 | 
				
			||||||
            Files = p17.Files.Select<ProductCategoryStorageFile, StorageFileSDto>(p18 => new StorageFileSDto()
 | 
					            Files = p17.Files.Select<ProductCategoryStorageFile, StorageFileSDto>(p18 => new StorageFileSDto()
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -2,7 +2,7 @@ using System;
 | 
				
			||||||
using System.Linq.Expressions;
 | 
					using System.Linq.Expressions;
 | 
				
			||||||
using Netina.Domain.Dtos.LargDtos;
 | 
					using Netina.Domain.Dtos.LargDtos;
 | 
				
			||||||
using Netina.Domain.Dtos.SmallDtos;
 | 
					using Netina.Domain.Dtos.SmallDtos;
 | 
				
			||||||
using Netina.Domain.Entities.Reviews;
 | 
					using Netina.Domain.Entities.Products;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Netina.Domain.Mappers
 | 
					namespace Netina.Domain.Mappers
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,6 @@ public class MapsterRegister : IRegister
 | 
				
			||||||
            .TwoWays();
 | 
					            .TwoWays();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        config.NewConfig<Blog, BlogLDto>()
 | 
					        config.NewConfig<Blog, BlogLDto>()
 | 
				
			||||||
            .Map(o=>o.AuthorFullName , d=>d.Author!=null ? d.Author.FirstName + " " + d.Author.LastName : string.Empty)
 | 
					 | 
				
			||||||
            .Map("MainImage", o => o.Files.Count > 0 && o.Files.Any(f => f.IsPrimary) ? o.Files.FirstOrDefault(f => f.IsPrimary)!.FileName : string.Empty)
 | 
					            .Map("MainImage", o => o.Files.Count > 0 && o.Files.Any(f => f.IsPrimary) ? o.Files.FirstOrDefault(f => f.IsPrimary)!.FileName : string.Empty)
 | 
				
			||||||
            .TwoWays();
 | 
					            .TwoWays();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,7 +37,6 @@ public class MapsterRegister : IRegister
 | 
				
			||||||
            .TwoWays();
 | 
					            .TwoWays();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        config.NewConfig<Product, ProductSDto>()
 | 
					        config.NewConfig<Product, ProductSDto>()
 | 
				
			||||||
            .Map(o => o.AuthorFullName, d => d.Author != null ? d.Author.FirstName + " " + d.Author.LastName : string.Empty)
 | 
					 | 
				
			||||||
            .Map("MainImage", o => o.Files.FirstOrDefault(f => f.IsPrimary) != null ? o.Files.FirstOrDefault(f => f.IsPrimary).FileLocation : o.Files.Count > 0 ? o.Files.FirstOrDefault().FileLocation : string.Empty)
 | 
					            .Map("MainImage", o => o.Files.FirstOrDefault(f => f.IsPrimary) != null ? o.Files.FirstOrDefault(f => f.IsPrimary).FileLocation : o.Files.Count > 0 ? o.Files.FirstOrDefault().FileLocation : string.Empty)
 | 
				
			||||||
            .Map("CategoryName", o => o.Category == null ? null : o.Category.Name)
 | 
					            .Map("CategoryName", o => o.Category == null ? null : o.Category.Name)
 | 
				
			||||||
            .Map("BrandName", o => o.Brand == null ? null : o.Brand.PersianName)
 | 
					            .Map("BrandName", o => o.Brand == null ? null : o.Brand.PersianName)
 | 
				
			||||||
| 
						 | 
					@ -55,12 +53,14 @@ public class MapsterRegister : IRegister
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        config.NewConfig<Product, ProductLDto>()
 | 
					        config.NewConfig<Product, ProductLDto>()
 | 
				
			||||||
            .Map(o => o.AuthorFullName, d => d.Author != null ? d.Author.FirstName + " " + d.Author.LastName : string.Empty)
 | 
					 | 
				
			||||||
            .Map("CategoryName", o => o.Category == null ? null : o.Category.Name)
 | 
					            .Map("CategoryName", o => o.Category == null ? null : o.Category.Name)
 | 
				
			||||||
            .Map("BrandName", o => o.Brand == null ? null : o.Brand.PersianName)
 | 
					            .Map("BrandName", o => o.Brand == null ? null : o.Brand.PersianName)
 | 
				
			||||||
            .IgnoreNullValues(false)
 | 
					            .IgnoreNullValues(false)
 | 
				
			||||||
            .TwoWays();
 | 
					            .TwoWays();
 | 
				
			||||||
 | 
					        config.NewConfig<Product, ProductSDto>()
 | 
				
			||||||
 | 
					            .Map("MainImage", o => o.Files.FirstOrDefault(f => f.IsPrimary) != null ? o.Files.FirstOrDefault(f => f.IsPrimary).FileLocation : o.Files.Count > 0 ? o.Files.FirstOrDefault().FileLocation : string.Empty)
 | 
				
			||||||
 | 
					            .IgnoreNullValues(false)
 | 
				
			||||||
 | 
					            .TwoWays();
 | 
				
			||||||
        config.NewConfig<Product, TorobProductResponseDto>()
 | 
					        config.NewConfig<Product, TorobProductResponseDto>()
 | 
				
			||||||
            .Map(s=>s.availibility,o=>o.IsEnable)
 | 
					            .Map(s=>s.availibility,o=>o.IsEnable)
 | 
				
			||||||
            .Map(s=>s.price , o=>o.Cost)
 | 
					            .Map(s=>s.price , o=>o.Cost)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,8 +15,7 @@ public class ChangeProductCostCommandHandler(IRepositoryWrapper repositoryWrappe
 | 
				
			||||||
            ent.Warranty,
 | 
					            ent.Warranty,
 | 
				
			||||||
            ent.BeDisplayed, request.Cost, ent.PackingCost, ent.HasExpressDelivery, ent.Stock, ent.MaxOrderCount,
 | 
					            ent.BeDisplayed, request.Cost, ent.PackingCost, ent.HasExpressDelivery, ent.Stock, ent.MaxOrderCount,
 | 
				
			||||||
            ent.BrandId,
 | 
					            ent.BrandId,
 | 
				
			||||||
            ent.CategoryId,
 | 
					            ent.CategoryId);
 | 
				
			||||||
            ent.AuthorId);
 | 
					 | 
				
			||||||
        newEnt.CreatedAt = ent.CreatedAt;
 | 
					        newEnt.CreatedAt = ent.CreatedAt;
 | 
				
			||||||
        newEnt.CreatedBy = ent.CreatedBy;
 | 
					        newEnt.CreatedBy = ent.CreatedBy;
 | 
				
			||||||
        newEnt.Id = ent.Id;
 | 
					        newEnt.Id = ent.Id;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,8 +14,7 @@ public class ChangeProductDisplayedCommandHandler(IRepositoryWrapper repositoryW
 | 
				
			||||||
            ent.Warranty,
 | 
					            ent.Warranty,
 | 
				
			||||||
            request.BeDisplayed, ent.Cost, ent.PackingCost, ent.HasExpressDelivery, ent.Stock, ent.MaxOrderCount,
 | 
					            request.BeDisplayed, ent.Cost, ent.PackingCost, ent.HasExpressDelivery, ent.Stock, ent.MaxOrderCount,
 | 
				
			||||||
            ent.BrandId,
 | 
					            ent.BrandId,
 | 
				
			||||||
            ent.CategoryId,
 | 
					            ent.CategoryId);
 | 
				
			||||||
            ent.AuthorId);
 | 
					 | 
				
			||||||
        newEnt.CreatedAt = ent.CreatedAt;
 | 
					        newEnt.CreatedAt = ent.CreatedAt;
 | 
				
			||||||
        newEnt.CreatedBy = ent.CreatedBy;
 | 
					        newEnt.CreatedBy = ent.CreatedBy;
 | 
				
			||||||
        newEnt.Id = ent.Id;
 | 
					        newEnt.Id = ent.Id;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,22 +1,17 @@
 | 
				
			||||||
namespace Netina.Repository.Handlers.Products;
 | 
					namespace Netina.Repository.Handlers.Products;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class CreateProductCommandHandler(IRepositoryWrapper repositoryWrapper,IMartenRepositoryWrapper martenRepositoryWrapper, IMediator mediator,ICurrentUserService currentUserService)
 | 
					public class CreateProductCommandHandler(IRepositoryWrapper repositoryWrapper,IMartenRepositoryWrapper martenRepositoryWrapper, IMediator mediator)
 | 
				
			||||||
    : IRequestHandler<CreateProductCommand, ProductLDto>
 | 
					    : IRequestHandler<CreateProductCommand, ProductLDto>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public async Task<ProductLDto> Handle(CreateProductCommand request, CancellationToken cancellationToken)
 | 
					    public async Task<ProductLDto> Handle(CreateProductCommand request, CancellationToken cancellationToken)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (currentUserService.UserId == null)
 | 
					 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
        if (!Guid.TryParse(currentUserService.UserId, out Guid userId))
 | 
					 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        var ent = Product.Create(request.PersianName, request.EnglishName, request.Summery, request.ExpertCheck,
 | 
					        var ent = Product.Create(request.PersianName, request.EnglishName, request.Summery, request.ExpertCheck,
 | 
				
			||||||
            request.Tags, request.Warranty,request.BeDisplayed,request.Cost,request.PackingCost,
 | 
					            request.Tags, request.Warranty,request.BeDisplayed,request.Cost,request.PackingCost,
 | 
				
			||||||
            request.HasExpressDelivery,
 | 
					            request.HasExpressDelivery,
 | 
				
			||||||
            request.Stock,
 | 
					            request.Stock,
 | 
				
			||||||
            request.MaxOrderCount,
 | 
					            request.MaxOrderCount,
 | 
				
			||||||
            request.BrandId,request.CategoryId, userId);
 | 
					            request.BrandId,request.CategoryId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach (var specification in request.Specifications)
 | 
					        foreach (var specification in request.Specifications)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
namespace Netina.Repository.Handlers.Products;
 | 
					namespace Netina.Repository.Handlers.Products;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class UpdateProductCommandHandler(IRepositoryWrapper repositoryWrapper,IMartenRepositoryWrapper martenRepositoryWrapper, IMediator mediator,ICurrentUserService currentUserService)
 | 
					public class UpdateProductCommandHandler(IRepositoryWrapper repositoryWrapper,IMartenRepositoryWrapper martenRepositoryWrapper, IMediator mediator)
 | 
				
			||||||
    : IRequestHandler<UpdateProductCommand, bool>
 | 
					    : IRequestHandler<UpdateProductCommand, bool>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public async Task<bool> Handle(UpdateProductCommand request, CancellationToken cancellationToken)
 | 
					    public async Task<bool> Handle(UpdateProductCommand request, CancellationToken cancellationToken)
 | 
				
			||||||
| 
						 | 
					@ -9,10 +9,7 @@ public class UpdateProductCommandHandler(IRepositoryWrapper repositoryWrapper,IM
 | 
				
			||||||
            .FirstOrDefaultAsync(e => e.Id == request.Id, cancellationToken);
 | 
					            .FirstOrDefaultAsync(e => e.Id == request.Id, cancellationToken);
 | 
				
			||||||
        if (ent == null)
 | 
					        if (ent == null)
 | 
				
			||||||
            throw new AppException("Product not found", ApiResultStatusCode.NotFound);
 | 
					            throw new AppException("Product not found", ApiResultStatusCode.NotFound);
 | 
				
			||||||
        if (currentUserService.UserId == null)
 | 
					
 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
        if(!Guid.TryParse(currentUserService.UserId,out Guid userId))
 | 
					 | 
				
			||||||
            throw new BaseApiException(ApiResultStatusCode.UnAuthorized, "User id is wrong");
 | 
					 | 
				
			||||||
        var newEnt = Product.Create(request.PersianName, request.EnglishName, request.Summery, request.ExpertCheck,
 | 
					        var newEnt = Product.Create(request.PersianName, request.EnglishName, request.Summery, request.ExpertCheck,
 | 
				
			||||||
            request.Tags, 
 | 
					            request.Tags, 
 | 
				
			||||||
            request.Warranty,
 | 
					            request.Warranty,
 | 
				
			||||||
| 
						 | 
					@ -23,8 +20,7 @@ public class UpdateProductCommandHandler(IRepositoryWrapper repositoryWrapper,IM
 | 
				
			||||||
            request.Stock,
 | 
					            request.Stock,
 | 
				
			||||||
            request.MaxOrderCount,
 | 
					            request.MaxOrderCount,
 | 
				
			||||||
            request.BrandId,
 | 
					            request.BrandId,
 | 
				
			||||||
            request.CategoryId,
 | 
					            request.CategoryId);
 | 
				
			||||||
            userId);
 | 
					 | 
				
			||||||
        newEnt.Id = ent.Id;
 | 
					        newEnt.Id = ent.Id;
 | 
				
			||||||
        newEnt.CreatedAt = ent.CreatedAt;
 | 
					        newEnt.CreatedAt = ent.CreatedAt;
 | 
				
			||||||
        newEnt.CreatedBy = ent.CreatedBy;
 | 
					        newEnt.CreatedBy = ent.CreatedBy;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,19 +2,13 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Netina.Repository.Handlers.Reviews;
 | 
					namespace Netina.Repository.Handlers.Reviews;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class CreateReviewCommandHandler(IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService)
 | 
					public class CreateReviewCommandHandler(IRepositoryWrapper repositoryWrapper)
 | 
				
			||||||
    : IRequestHandler<CreateReviewCommand, Guid>
 | 
					    : IRequestHandler<CreateReviewCommand, ReviewSDto>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public async Task<Guid> Handle(CreateReviewCommand request, CancellationToken cancellationToken)
 | 
					    public async Task<ReviewSDto> Handle(CreateReviewCommand request, CancellationToken cancellationToken)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Guid userId = request.UserId;
 | 
					 | 
				
			||||||
        if (userId == default)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (!Guid.TryParse(currentUserService.UserId, out userId))
 | 
					 | 
				
			||||||
                throw new AppException("User id is wrong", ApiResultStatusCode.BadRequest);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        var review = Review.Create(request.Title, request.Comment, request.Rate, request.IsBuyer, request.ProductId,
 | 
					        var review = Review.Create(request.Title, request.Comment, request.Rate, request.IsBuyer, request.ProductId,
 | 
				
			||||||
            userId);
 | 
					            request.UserId);
 | 
				
			||||||
        var product = await repositoryWrapper.SetRepository<Product>()
 | 
					        var product = await repositoryWrapper.SetRepository<Product>()
 | 
				
			||||||
            .TableNoTracking
 | 
					            .TableNoTracking
 | 
				
			||||||
            .FirstOrDefaultAsync(p => p.Id == request.ProductId, cancellationToken);
 | 
					            .FirstOrDefaultAsync(p => p.Id == request.ProductId, cancellationToken);
 | 
				
			||||||
| 
						 | 
					@ -29,6 +23,6 @@ public class CreateReviewCommandHandler(IRepositoryWrapper repositoryWrapper,ICu
 | 
				
			||||||
        repositoryWrapper.SetRepository<Review>().Add(review);
 | 
					        repositoryWrapper.SetRepository<Review>().Add(review);
 | 
				
			||||||
        await repositoryWrapper.SaveChangesAsync(cancellationToken);
 | 
					        await repositoryWrapper.SaveChangesAsync(cancellationToken);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return review.Id;
 | 
					        return review.AdaptToSDto();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,26 +1,17 @@
 | 
				
			||||||
namespace Netina.Repository.Handlers.Reviews;
 | 
					namespace Netina.Repository.Handlers.Reviews;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class DeleteReviewCommandHandler(IRepositoryWrapper repositoryWrapper)
 | 
					public class DeleteReviewCommandHandler(IRepositoryWrapper repositoryWrapper)
 | 
				
			||||||
    : IRequestHandler<DeleteReviewCommand, Guid>
 | 
					    : IRequestHandler<DeleteReviewCommand, bool>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public async Task<Guid> Handle(DeleteReviewCommand request, CancellationToken cancellationToken)
 | 
					    public async Task<bool> Handle(DeleteReviewCommand request, CancellationToken cancellationToken)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var review = await repositoryWrapper.SetRepository<Review>().TableNoTracking
 | 
					        var review = await repositoryWrapper.SetRepository<Review>().TableNoTracking
 | 
				
			||||||
            .FirstOrDefaultAsync(r => r.Id == request.Id, cancellationToken);
 | 
					            .FirstOrDefaultAsync(r => r.Id == request.Id, cancellationToken);
 | 
				
			||||||
        if (review == null)
 | 
					        if (review == null)
 | 
				
			||||||
            throw new AppException("Review not found", ApiResultStatusCode.NotFound);
 | 
					            throw new AppException("Review not found", ApiResultStatusCode.NotFound);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var product = await repositoryWrapper.SetRepository<Product>()
 | 
					 | 
				
			||||||
            .TableNoTracking
 | 
					 | 
				
			||||||
            .FirstOrDefaultAsync(p => p.Id == review.ProductId, cancellationToken);
 | 
					 | 
				
			||||||
        if (product != null)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            product.RemoveRate(review.Rate);
 | 
					 | 
				
			||||||
            repositoryWrapper.SetRepository<Product>().Update(product);
 | 
					 | 
				
			||||||
            await repositoryWrapper.SaveChangesAsync(cancellationToken);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        repositoryWrapper.SetRepository<Review>().Delete(review);
 | 
					        repositoryWrapper.SetRepository<Review>().Delete(review);
 | 
				
			||||||
        await repositoryWrapper.SaveChangesAsync(cancellationToken);
 | 
					        await repositoryWrapper.SaveChangesAsync(cancellationToken);
 | 
				
			||||||
        return review.Id;
 | 
					        return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,4 @@
 | 
				
			||||||
using Review = Netina.Domain.Entities.Reviews.Review;
 | 
					namespace Netina.Repository.Handlers.Reviews;
 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace Netina.Repository.Handlers.Reviews;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class GetReviewQueryHandler(IRepositoryWrapper repositoryWrapper) : IRequestHandler<GetReviewQuery, ReviewLDto>
 | 
					public class GetReviewQueryHandler(IRepositoryWrapper repositoryWrapper) : IRequestHandler<GetReviewQuery, ReviewLDto>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,18 +1,12 @@
 | 
				
			||||||
using Review = Netina.Domain.Entities.Reviews.Review;
 | 
					namespace Netina.Repository.Handlers.Reviews;
 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace Netina.Repository.Handlers.Reviews;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class GetReviewsQueryHandler(IRepositoryWrapper repositoryWrapper)
 | 
					public class GetReviewsQueryHandler(IRepositoryWrapper repositoryWrapper)
 | 
				
			||||||
    : IRequestHandler<GetReviewsQuery, List<ReviewSDto>>
 | 
					    : IRequestHandler<GetReviewsQuery, List<ReviewSDto>>
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public async Task<List<ReviewSDto>> Handle(GetReviewsQuery request, CancellationToken cancellationToken)
 | 
					    public async Task<List<ReviewSDto>> Handle(GetReviewsQuery request, CancellationToken cancellationToken)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        var query = repositoryWrapper.SetRepository<Review>()
 | 
					        return await repositoryWrapper.SetRepository<Review>()
 | 
				
			||||||
            .TableNoTracking;
 | 
					            .TableNoTracking
 | 
				
			||||||
        if (request.ProductId != null)
 | 
					 | 
				
			||||||
            query = query.Where(q => q.ProductId == request.ProductId);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return await query
 | 
					 | 
				
			||||||
            .OrderByDescending(r => r.CreatedAt)
 | 
					            .OrderByDescending(r => r.CreatedAt)
 | 
				
			||||||
            .Skip(request.Page * 15)
 | 
					            .Skip(request.Page * 15)
 | 
				
			||||||
            .Take(15)
 | 
					            .Take(15)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -1,97 +0,0 @@
 | 
				
			||||||
using System;
 | 
					 | 
				
			||||||
using Microsoft.EntityFrameworkCore.Migrations;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#nullable disable
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
namespace NetinaShop.Repository.Migrations
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    /// <inheritdoc />
 | 
					 | 
				
			||||||
    public partial class AddAuthor : Migration
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /// <inheritdoc />
 | 
					 | 
				
			||||||
        protected override void Up(MigrationBuilder migrationBuilder)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            migrationBuilder.AddColumn<Guid>(
 | 
					 | 
				
			||||||
                name: "AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Products",
 | 
					 | 
				
			||||||
                type: "uuid",
 | 
					 | 
				
			||||||
                nullable: false,
 | 
					 | 
				
			||||||
                defaultValue: new Guid("8723f1d2-e091-4812-9110-5161c9e23586"));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.AddColumn<Guid>(
 | 
					 | 
				
			||||||
                name: "AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Blogs",
 | 
					 | 
				
			||||||
                type: "uuid",
 | 
					 | 
				
			||||||
                nullable: false,
 | 
					 | 
				
			||||||
                defaultValue: new Guid("8723f1d2-e091-4812-9110-5161c9e23586"));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.CreateIndex(
 | 
					 | 
				
			||||||
                name: "IX_Products_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Products",
 | 
					 | 
				
			||||||
                column: "AuthorId");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.CreateIndex(
 | 
					 | 
				
			||||||
                name: "IX_Blogs_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Blogs",
 | 
					 | 
				
			||||||
                column: "AuthorId");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.AddForeignKey(
 | 
					 | 
				
			||||||
                name: "FK_Blogs_Users_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Blogs",
 | 
					 | 
				
			||||||
                column: "AuthorId",
 | 
					 | 
				
			||||||
                principalSchema: "public",
 | 
					 | 
				
			||||||
                principalTable: "Users",
 | 
					 | 
				
			||||||
                principalColumn: "Id",
 | 
					 | 
				
			||||||
                onDelete: ReferentialAction.Restrict);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.AddForeignKey(
 | 
					 | 
				
			||||||
                name: "FK_Products_Users_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Products",
 | 
					 | 
				
			||||||
                column: "AuthorId",
 | 
					 | 
				
			||||||
                principalSchema: "public",
 | 
					 | 
				
			||||||
                principalTable: "Users",
 | 
					 | 
				
			||||||
                principalColumn: "Id",
 | 
					 | 
				
			||||||
                onDelete: ReferentialAction.Restrict);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <inheritdoc />
 | 
					 | 
				
			||||||
        protected override void Down(MigrationBuilder migrationBuilder)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            migrationBuilder.DropForeignKey(
 | 
					 | 
				
			||||||
                name: "FK_Blogs_Users_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Blogs");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.DropForeignKey(
 | 
					 | 
				
			||||||
                name: "FK_Products_Users_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Products");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.DropIndex(
 | 
					 | 
				
			||||||
                name: "IX_Products_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Products");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.DropIndex(
 | 
					 | 
				
			||||||
                name: "IX_Blogs_AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Blogs");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.DropColumn(
 | 
					 | 
				
			||||||
                name: "AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Products");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            migrationBuilder.DropColumn(
 | 
					 | 
				
			||||||
                name: "AuthorId",
 | 
					 | 
				
			||||||
                schema: "public",
 | 
					 | 
				
			||||||
                table: "Blogs");
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
#pragma warning disable 612, 618
 | 
					#pragma warning disable 612, 618
 | 
				
			||||||
            modelBuilder
 | 
					            modelBuilder
 | 
				
			||||||
                .HasDefaultSchema("public")
 | 
					                .HasDefaultSchema("public")
 | 
				
			||||||
                .HasAnnotation("ProductVersion", "8.0.7")
 | 
					                .HasAnnotation("ProductVersion", "8.0.4")
 | 
				
			||||||
                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 | 
					                .HasAnnotation("Relational:MaxIdentifierLength", 63);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
 | 
					            NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "fuzzystrmatch");
 | 
				
			||||||
| 
						 | 
					@ -208,9 +208,6 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
                        .ValueGeneratedOnAdd()
 | 
					                        .ValueGeneratedOnAdd()
 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					                        .HasColumnType("uuid");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Property<Guid>("AuthorId")
 | 
					 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<Guid>("CategoryId")
 | 
					                    b.Property<Guid>("CategoryId")
 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					                        .HasColumnType("uuid");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -266,8 +263,6 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.HasKey("Id");
 | 
					                    b.HasKey("Id");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.HasIndex("AuthorId");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasIndex("CategoryId");
 | 
					                    b.HasIndex("CategoryId");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.ToTable("Blogs", "public");
 | 
					                    b.ToTable("Blogs", "public");
 | 
				
			||||||
| 
						 | 
					@ -496,7 +491,7 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.ToTable("Discounts", "public");
 | 
					                    b.ToTable("Discounts", "public");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.HasDiscriminator().HasValue("Discount");
 | 
					                    b.HasDiscriminator<string>("Discriminator").HasValue("Discount");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.UseTphMappingStrategy();
 | 
					                    b.UseTphMappingStrategy();
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
| 
						 | 
					@ -796,9 +791,6 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
                        .ValueGeneratedOnAdd()
 | 
					                        .ValueGeneratedOnAdd()
 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					                        .HasColumnType("uuid");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Property<Guid>("AuthorId")
 | 
					 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<bool>("BeDisplayed")
 | 
					                    b.Property<bool>("BeDisplayed")
 | 
				
			||||||
                        .HasColumnType("boolean");
 | 
					                        .HasColumnType("boolean");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -889,8 +881,6 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.HasKey("Id");
 | 
					                    b.HasKey("Id");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.HasIndex("AuthorId");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasIndex("BrandId");
 | 
					                    b.HasIndex("BrandId");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.HasIndex("CategoryId");
 | 
					                    b.HasIndex("CategoryId");
 | 
				
			||||||
| 
						 | 
					@ -898,6 +888,68 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
                    b.ToTable("Products", "public");
 | 
					                    b.ToTable("Products", "public");
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.Products.Review", b =>
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    b.Property<Guid>("Id")
 | 
				
			||||||
 | 
					                        .ValueGeneratedOnAdd()
 | 
				
			||||||
 | 
					                        .HasColumnType("uuid");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<string>("Comment")
 | 
				
			||||||
 | 
					                        .IsRequired()
 | 
				
			||||||
 | 
					                        .HasColumnType("text");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<DateTime>("CreatedAt")
 | 
				
			||||||
 | 
					                        .HasColumnType("timestamp without time zone");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<string>("CreatedBy")
 | 
				
			||||||
 | 
					                        .IsRequired()
 | 
				
			||||||
 | 
					                        .HasColumnType("text");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<bool>("IsBuyer")
 | 
				
			||||||
 | 
					                        .HasColumnType("boolean");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<bool>("IsConfirmed")
 | 
				
			||||||
 | 
					                        .HasColumnType("boolean");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<bool>("IsRemoved")
 | 
				
			||||||
 | 
					                        .HasColumnType("boolean");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<DateTime>("ModifiedAt")
 | 
				
			||||||
 | 
					                        .HasColumnType("timestamp without time zone");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<string>("ModifiedBy")
 | 
				
			||||||
 | 
					                        .IsRequired()
 | 
				
			||||||
 | 
					                        .HasColumnType("text");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<Guid>("ProductId")
 | 
				
			||||||
 | 
					                        .HasColumnType("uuid");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<float>("Rate")
 | 
				
			||||||
 | 
					                        .HasColumnType("real");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<DateTime>("RemovedAt")
 | 
				
			||||||
 | 
					                        .HasColumnType("timestamp without time zone");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<string>("RemovedBy")
 | 
				
			||||||
 | 
					                        .IsRequired()
 | 
				
			||||||
 | 
					                        .HasColumnType("text");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<string>("Title")
 | 
				
			||||||
 | 
					                        .IsRequired()
 | 
				
			||||||
 | 
					                        .HasColumnType("text");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Property<Guid>("UserId")
 | 
				
			||||||
 | 
					                        .HasColumnType("uuid");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.HasKey("Id");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.HasIndex("ProductId");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.HasIndex("UserId");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.ToTable("Reviews", "public");
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.Products.Specification", b =>
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.Products.Specification", b =>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    b.Property<Guid>("Id")
 | 
					                    b.Property<Guid>("Id")
 | 
				
			||||||
| 
						 | 
					@ -958,68 +1010,6 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
                    b.ToTable("Specifications", "public");
 | 
					                    b.ToTable("Specifications", "public");
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.Reviews.Review", b =>
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    b.Property<Guid>("Id")
 | 
					 | 
				
			||||||
                        .ValueGeneratedOnAdd()
 | 
					 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<string>("Comment")
 | 
					 | 
				
			||||||
                        .IsRequired()
 | 
					 | 
				
			||||||
                        .HasColumnType("text");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<DateTime>("CreatedAt")
 | 
					 | 
				
			||||||
                        .HasColumnType("timestamp without time zone");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<string>("CreatedBy")
 | 
					 | 
				
			||||||
                        .IsRequired()
 | 
					 | 
				
			||||||
                        .HasColumnType("text");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<bool>("IsBuyer")
 | 
					 | 
				
			||||||
                        .HasColumnType("boolean");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<bool>("IsConfirmed")
 | 
					 | 
				
			||||||
                        .HasColumnType("boolean");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<bool>("IsRemoved")
 | 
					 | 
				
			||||||
                        .HasColumnType("boolean");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<DateTime>("ModifiedAt")
 | 
					 | 
				
			||||||
                        .HasColumnType("timestamp without time zone");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<string>("ModifiedBy")
 | 
					 | 
				
			||||||
                        .IsRequired()
 | 
					 | 
				
			||||||
                        .HasColumnType("text");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<Guid>("ProductId")
 | 
					 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<float>("Rate")
 | 
					 | 
				
			||||||
                        .HasColumnType("real");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<DateTime>("RemovedAt")
 | 
					 | 
				
			||||||
                        .HasColumnType("timestamp without time zone");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<string>("RemovedBy")
 | 
					 | 
				
			||||||
                        .IsRequired()
 | 
					 | 
				
			||||||
                        .HasColumnType("text");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<string>("Title")
 | 
					 | 
				
			||||||
                        .IsRequired()
 | 
					 | 
				
			||||||
                        .HasColumnType("text");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Property<Guid>("UserId")
 | 
					 | 
				
			||||||
                        .HasColumnType("uuid");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasKey("Id");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasIndex("ProductId");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasIndex("UserId");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.ToTable("Reviews", "public");
 | 
					 | 
				
			||||||
                });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.StorageFiles.StorageFile", b =>
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.StorageFiles.StorageFile", b =>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    b.Property<Guid>("Id")
 | 
					                    b.Property<Guid>("Id")
 | 
				
			||||||
| 
						 | 
					@ -1080,7 +1070,7 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.ToTable("StorageFiles", "public");
 | 
					                    b.ToTable("StorageFiles", "public");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.HasDiscriminator().HasValue("StorageFile");
 | 
					                    b.HasDiscriminator<string>("Discriminator").HasValue("StorageFile");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.UseTphMappingStrategy();
 | 
					                    b.UseTphMappingStrategy();
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
| 
						 | 
					@ -1707,18 +1697,11 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.Blogs.Blog", b =>
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.Blogs.Blog", b =>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Users.ApplicationUser", "Author")
 | 
					 | 
				
			||||||
                        .WithMany()
 | 
					 | 
				
			||||||
                        .HasForeignKey("AuthorId")
 | 
					 | 
				
			||||||
                        .OnDelete(DeleteBehavior.Restrict);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Blogs.BlogCategory", "Category")
 | 
					                    b.HasOne("Netina.Domain.Entities.Blogs.BlogCategory", "Category")
 | 
				
			||||||
                        .WithMany("Blogs")
 | 
					                        .WithMany("Blogs")
 | 
				
			||||||
                        .HasForeignKey("CategoryId")
 | 
					                        .HasForeignKey("CategoryId")
 | 
				
			||||||
                        .OnDelete(DeleteBehavior.Restrict);
 | 
					                        .OnDelete(DeleteBehavior.Restrict);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Navigation("Author");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Navigation("Category");
 | 
					                    b.Navigation("Category");
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1806,11 +1789,6 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.Products.Product", b =>
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.Products.Product", b =>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Users.ApplicationUser", "Author")
 | 
					 | 
				
			||||||
                        .WithMany()
 | 
					 | 
				
			||||||
                        .HasForeignKey("AuthorId")
 | 
					 | 
				
			||||||
                        .OnDelete(DeleteBehavior.Restrict);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Brands.Brand", "Brand")
 | 
					                    b.HasOne("Netina.Domain.Entities.Brands.Brand", "Brand")
 | 
				
			||||||
                        .WithMany("Products")
 | 
					                        .WithMany("Products")
 | 
				
			||||||
                        .HasForeignKey("BrandId")
 | 
					                        .HasForeignKey("BrandId")
 | 
				
			||||||
| 
						 | 
					@ -1821,13 +1799,28 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
                        .HasForeignKey("CategoryId")
 | 
					                        .HasForeignKey("CategoryId")
 | 
				
			||||||
                        .OnDelete(DeleteBehavior.Restrict);
 | 
					                        .OnDelete(DeleteBehavior.Restrict);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Navigation("Author");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Navigation("Brand");
 | 
					                    b.Navigation("Brand");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    b.Navigation("Category");
 | 
					                    b.Navigation("Category");
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.Products.Review", b =>
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    b.HasOne("Netina.Domain.Entities.Products.Product", "Product")
 | 
				
			||||||
 | 
					                        .WithMany("Reviews")
 | 
				
			||||||
 | 
					                        .HasForeignKey("ProductId")
 | 
				
			||||||
 | 
					                        .OnDelete(DeleteBehavior.Restrict);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.HasOne("Netina.Domain.Entities.Users.ApplicationUser", "User")
 | 
				
			||||||
 | 
					                        .WithMany()
 | 
				
			||||||
 | 
					                        .HasForeignKey("UserId")
 | 
				
			||||||
 | 
					                        .OnDelete(DeleteBehavior.Restrict);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Navigation("Product");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    b.Navigation("User");
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.Products.Specification", b =>
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.Products.Specification", b =>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Products.Specification", "Parent")
 | 
					                    b.HasOne("Netina.Domain.Entities.Products.Specification", "Parent")
 | 
				
			||||||
| 
						 | 
					@ -1844,23 +1837,6 @@ namespace NetinaShop.Repository.Migrations
 | 
				
			||||||
                    b.Navigation("Product");
 | 
					                    b.Navigation("Product");
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.Reviews.Review", b =>
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Products.Product", "Product")
 | 
					 | 
				
			||||||
                        .WithMany("Reviews")
 | 
					 | 
				
			||||||
                        .HasForeignKey("ProductId")
 | 
					 | 
				
			||||||
                        .OnDelete(DeleteBehavior.Restrict);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Users.ApplicationUser", "User")
 | 
					 | 
				
			||||||
                        .WithMany()
 | 
					 | 
				
			||||||
                        .HasForeignKey("UserId")
 | 
					 | 
				
			||||||
                        .OnDelete(DeleteBehavior.Restrict);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Navigation("Product");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    b.Navigation("User");
 | 
					 | 
				
			||||||
                });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            modelBuilder.Entity("Netina.Domain.Entities.Users.Customer", b =>
 | 
					            modelBuilder.Entity("Netina.Domain.Entities.Users.Customer", b =>
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    b.HasOne("Netina.Domain.Entities.Users.ApplicationUser", "User")
 | 
					                    b.HasOne("Netina.Domain.Entities.Users.ApplicationUser", "User")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,7 +62,6 @@
 | 
				
			||||||
		<Using Include="Netina.Domain.Entities.Discounts" />
 | 
							<Using Include="Netina.Domain.Entities.Discounts" />
 | 
				
			||||||
		<Using Include="Netina.Domain.Entities.ProductCategories" />
 | 
							<Using Include="Netina.Domain.Entities.ProductCategories" />
 | 
				
			||||||
		<Using Include="Netina.Domain.Entities.Products" />
 | 
							<Using Include="Netina.Domain.Entities.Products" />
 | 
				
			||||||
		<Using Include="Netina.Domain.Entities.Reviews" />
 | 
					 | 
				
			||||||
		<Using Include="Netina.Domain.Entities.Users" />
 | 
							<Using Include="Netina.Domain.Entities.Users" />
 | 
				
			||||||
		<Using Include="Netina.Domain.Enums" />
 | 
							<Using Include="Netina.Domain.Enums" />
 | 
				
			||||||
		<Using Include="Netina.Domain.Extensions" />
 | 
							<Using Include="Netina.Domain.Extensions" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue