feat : add shipping methods CRUD

create shipping page and action dialog , complete shipping CRUD
release
Amir Hossein Khademi 2024-02-09 21:43:14 +03:30
parent d442ed17ee
commit c4286e9d40
14 changed files with 2983 additions and 436 deletions

View File

@ -1,18 +1,18 @@
namespace NetinaShop.Domain.CommandQueries.Commands;
public sealed record CreateShippingCommand (
string Title,
string Name,
string WarehouseName,
bool IsFastShipping ,
bool IsExpressShipping,
bool IsShipBySeller ,
bool IsOriginalWarehouse,
double DeliveryCost) : IRequest<ShippingSDto>;
public sealed record UpdateShippingCommand(
Guid Id,
string Title,
string Name,
string WarehouseName,
bool IsFastShipping,
bool IsExpressShipping,
bool IsShipBySeller,
bool IsOriginalWarehouse,
double DeliveryCost) : IRequest<bool>;

View File

@ -10,9 +10,9 @@ public class ProductLDto : BaseDto<ProductLDto,Product>
public string Warranty { get; set; } = string.Empty;
public bool BeDisplayed { get; set; }
public bool HasExpressDelivery { get; set; }
public int MaxOrderCount { get; set; }
public double Cost { get; set; }
public double PackingCost { get; set; }
public int MaxOrderCount { get; set; }
public int Stock { get; set; }
public Guid BrandId { get; set; }
public string BrandName { get; set; } = string.Empty;

View File

@ -12,6 +12,8 @@ public class DiscountSDto : BaseDto<DiscountSDto,Discount>
public DateTime StartDate { get; set; }
public DateTime ExpireDate { get; set; }
public long PriceFloor { get; set; }
public int MaxOrderCount { get; set; }
public int Stock { get; set; }
public bool HasPriceFloor { get; set; }
public long PriceCeiling { get; set; }
public bool HasPriceCeiling { get; set; }

View File

@ -2,5 +2,10 @@
public class ShippingSDto : BaseDto<ShippingSDto,Shipping>
{
public string Name { get; set; } = string.Empty;
public string WarehouseName { get; set; } = string.Empty;
public bool IsExpressShipping { get; set; }
public bool IsShipBySeller { get; set; }
public bool IsOriginalWarehouse { get; set; }
public double DeliveryCost { get; set; }
}

View File

@ -9,9 +9,9 @@ public partial class Shipping : ApiEntity
{
}
public Shipping(string title, string warehouseName, bool isExpressShipping, bool isShipBySeller, bool isOriginalWarehouse, double deliveryCost)
public Shipping(string name, string warehouseName, bool isExpressShipping, bool isShipBySeller, bool isOriginalWarehouse, double deliveryCost)
{
Title = title;
Name = name;
WarehouseName = warehouseName;
IsExpressShipping = isExpressShipping;
IsShipBySeller = isShipBySeller;
@ -19,7 +19,7 @@ public partial class Shipping : ApiEntity
DeliveryCost = deliveryCost;
}
public string Title { get; internal set; } = string.Empty;
public string Name { get; internal set; } = string.Empty;
public string WarehouseName { get; internal set; } = string.Empty;
public bool IsExpressShipping { get; internal set; }
public bool IsShipBySeller { get; internal set; }

View File

@ -30,7 +30,17 @@ namespace NetinaShop.Domain.Mappers
HasExpressDelivery = p1.HasExpressDelivery,
MaxOrderCount = p1.MaxOrderCount,
BrandId = p1.BrandId,
Brand = new Brand()
{
Name = p1.BrandName,
Id = p1.BrandId
},
CategoryId = p1.CategoryId,
Category = new ProductCategory()
{
Name = p1.CategoryName,
Id = p1.CategoryId
},
Specifications = funcMain1(p1.Specifications),
Reviews = funcMain2(p1.Reviews),
Files = funcMain3(p1.Files),
@ -59,318 +69,333 @@ namespace NetinaShop.Domain.Mappers
result.HasExpressDelivery = p5.HasExpressDelivery;
result.MaxOrderCount = p5.MaxOrderCount;
result.BrandId = p5.BrandId;
result.Brand = funcMain4(new Never(), result.Brand, p5);
result.CategoryId = p5.CategoryId;
result.Specifications = funcMain4(p5.Specifications, result.Specifications);
result.Reviews = funcMain5(p5.Reviews, result.Reviews);
result.Files = funcMain6(p5.Files, result.Files);
result.Category = funcMain5(new Never(), result.Category, p5);
result.Specifications = funcMain6(p5.Specifications, result.Specifications);
result.Reviews = funcMain7(p5.Reviews, result.Reviews);
result.Files = funcMain8(p5.Files, result.Files);
result.Id = p5.Id;
result.CreatedAt = p5.CreatedAt;
return result;
}
public static Expression<Func<ProductLDto, Product>> ProjectToProduct => p13 => new Product()
public static Expression<Func<ProductLDto, Product>> ProjectToProduct => p17 => new Product()
{
PersianName = p13.PersianName,
EnglishName = p13.EnglishName,
Summery = p13.Summery,
ExpertCheck = p13.ExpertCheck,
Tags = p13.Tags,
Warranty = p13.Warranty,
Cost = p13.Cost,
BeDisplayed = p13.BeDisplayed,
PackingCost = p13.PackingCost,
Stock = p13.Stock,
HasExpressDelivery = p13.HasExpressDelivery,
MaxOrderCount = p13.MaxOrderCount,
BrandId = p13.BrandId,
CategoryId = p13.CategoryId,
Specifications = p13.Specifications.Select<SpecificationSDto, Specification>(p14 => new Specification()
PersianName = p17.PersianName,
EnglishName = p17.EnglishName,
Summery = p17.Summery,
ExpertCheck = p17.ExpertCheck,
Tags = p17.Tags,
Warranty = p17.Warranty,
Cost = p17.Cost,
BeDisplayed = p17.BeDisplayed,
PackingCost = p17.PackingCost,
Stock = p17.Stock,
HasExpressDelivery = p17.HasExpressDelivery,
MaxOrderCount = p17.MaxOrderCount,
BrandId = p17.BrandId,
Brand = new Brand()
{
Title = p14.Title,
Detail = p14.Detail,
Value = p14.Value,
IsFeature = p14.IsFeature,
ProductId = p14.ProductId,
ParentId = (Guid?)p14.ParentId,
Id = p14.Id,
CreatedAt = p14.CreatedAt
Name = p17.BrandName,
Id = p17.BrandId
},
CategoryId = p17.CategoryId,
Category = new ProductCategory()
{
Name = p17.CategoryName,
Id = p17.CategoryId
},
Specifications = p17.Specifications.Select<SpecificationSDto, Specification>(p18 => new Specification()
{
Title = p18.Title,
Detail = p18.Detail,
Value = p18.Value,
IsFeature = p18.IsFeature,
ProductId = p18.ProductId,
ParentId = (Guid?)p18.ParentId,
Id = p18.Id,
CreatedAt = p18.CreatedAt
}).ToList<Specification>(),
Reviews = p13.Reviews.Select<ReviewSDto, Review>(p15 => new Review()
Reviews = p17.Reviews.Select<ReviewSDto, Review>(p19 => new Review()
{
Title = p15.Title,
Comment = p15.Comment,
Rate = p15.Rate,
IsBuyer = p15.IsBuyer,
ProductId = p15.ProductId,
UserId = p15.UserId,
Id = p15.Id,
CreatedAt = p15.CreatedAt
Title = p19.Title,
Comment = p19.Comment,
Rate = p19.Rate,
IsBuyer = p19.IsBuyer,
ProductId = p19.ProductId,
UserId = p19.UserId,
Id = p19.Id,
CreatedAt = p19.CreatedAt
}).ToList<Review>(),
Files = p13.Files.Select<StorageFileSDto, ProductStorageFile>(p16 => new ProductStorageFile()
Files = p17.Files.Select<StorageFileSDto, ProductStorageFile>(p20 => new ProductStorageFile()
{
Name = p16.Name,
FileLocation = p16.FileLocation,
FileName = p16.FileName,
IsHeader = p16.IsHeader,
IsPrimary = p16.IsPrimary,
FileType = p16.FileType,
Id = p16.Id,
CreatedAt = p16.CreatedAt
Name = p20.Name,
FileLocation = p20.FileLocation,
FileName = p20.FileName,
IsHeader = p20.IsHeader,
IsPrimary = p20.IsPrimary,
FileType = p20.FileType,
Id = p20.Id,
CreatedAt = p20.CreatedAt
}).ToList<ProductStorageFile>(),
Id = p13.Id,
CreatedAt = p13.CreatedAt
Id = p17.Id,
CreatedAt = p17.CreatedAt
};
public static ProductLDto AdaptToLDto(this Product p17)
public static ProductLDto AdaptToLDto(this Product p21)
{
return p17 == null ? null : new ProductLDto()
return p21 == null ? null : new ProductLDto()
{
PersianName = p17.PersianName,
EnglishName = p17.EnglishName,
Summery = p17.Summery,
ExpertCheck = p17.ExpertCheck,
Tags = p17.Tags,
Warranty = p17.Warranty,
BeDisplayed = p17.BeDisplayed,
HasExpressDelivery = p17.HasExpressDelivery,
MaxOrderCount = p17.MaxOrderCount,
Cost = p17.Cost,
PackingCost = p17.PackingCost,
Stock = p17.Stock,
BrandId = p17.BrandId,
BrandName = p17.Brand == null ? null : p17.Brand.Name,
CategoryId = p17.CategoryId,
CategoryName = p17.Category == null ? null : p17.Category.Name,
Specifications = funcMain7(p17.Specifications),
Reviews = funcMain8(p17.Reviews),
Files = funcMain9(p17.Files),
Id = p17.Id,
CreatedAt = p17.CreatedAt
PersianName = p21.PersianName,
EnglishName = p21.EnglishName,
Summery = p21.Summery,
ExpertCheck = p21.ExpertCheck,
Tags = p21.Tags,
Warranty = p21.Warranty,
BeDisplayed = p21.BeDisplayed,
HasExpressDelivery = p21.HasExpressDelivery,
Cost = p21.Cost,
PackingCost = p21.PackingCost,
MaxOrderCount = p21.MaxOrderCount,
Stock = p21.Stock,
BrandId = p21.BrandId,
BrandName = p21.Brand == null ? null : p21.Brand.Name,
CategoryId = p21.CategoryId,
CategoryName = p21.Category == null ? null : p21.Category.Name,
Specifications = funcMain9(p21.Specifications),
Reviews = funcMain10(p21.Reviews),
Files = funcMain11(p21.Files),
Id = p21.Id,
CreatedAt = p21.CreatedAt
};
}
public static ProductLDto AdaptTo(this Product p21, ProductLDto p22)
public static ProductLDto AdaptTo(this Product p25, ProductLDto p26)
{
if (p21 == null)
if (p25 == null)
{
return null;
}
ProductLDto result = p22 ?? new ProductLDto();
ProductLDto result = p26 ?? new ProductLDto();
result.PersianName = p21.PersianName;
result.EnglishName = p21.EnglishName;
result.Summery = p21.Summery;
result.ExpertCheck = p21.ExpertCheck;
result.Tags = p21.Tags;
result.Warranty = p21.Warranty;
result.BeDisplayed = p21.BeDisplayed;
result.HasExpressDelivery = p21.HasExpressDelivery;
result.MaxOrderCount = p21.MaxOrderCount;
result.Cost = p21.Cost;
result.PackingCost = p21.PackingCost;
result.Stock = p21.Stock;
result.BrandId = p21.BrandId;
result.BrandName = p21.Brand == null ? null : p21.Brand.Name;
result.CategoryId = p21.CategoryId;
result.CategoryName = p21.Category == null ? null : p21.Category.Name;
result.Specifications = funcMain10(p21.Specifications, result.Specifications);
result.Reviews = funcMain11(p21.Reviews, result.Reviews);
result.Files = funcMain12(p21.Files, result.Files);
result.Id = p21.Id;
result.CreatedAt = p21.CreatedAt;
result.PersianName = p25.PersianName;
result.EnglishName = p25.EnglishName;
result.Summery = p25.Summery;
result.ExpertCheck = p25.ExpertCheck;
result.Tags = p25.Tags;
result.Warranty = p25.Warranty;
result.BeDisplayed = p25.BeDisplayed;
result.HasExpressDelivery = p25.HasExpressDelivery;
result.Cost = p25.Cost;
result.PackingCost = p25.PackingCost;
result.MaxOrderCount = p25.MaxOrderCount;
result.Stock = p25.Stock;
result.BrandId = p25.BrandId;
result.BrandName = p25.Brand == null ? null : p25.Brand.Name;
result.CategoryId = p25.CategoryId;
result.CategoryName = p25.Category == null ? null : p25.Category.Name;
result.Specifications = funcMain12(p25.Specifications, result.Specifications);
result.Reviews = funcMain13(p25.Reviews, result.Reviews);
result.Files = funcMain14(p25.Files, result.Files);
result.Id = p25.Id;
result.CreatedAt = p25.CreatedAt;
return result;
}
public static Expression<Func<Product, ProductLDto>> ProjectToLDto => p29 => new ProductLDto()
public static Expression<Func<Product, ProductLDto>> ProjectToLDto => p33 => new ProductLDto()
{
PersianName = p29.PersianName,
EnglishName = p29.EnglishName,
Summery = p29.Summery,
ExpertCheck = p29.ExpertCheck,
Tags = p29.Tags,
Warranty = p29.Warranty,
BeDisplayed = p29.BeDisplayed,
HasExpressDelivery = p29.HasExpressDelivery,
MaxOrderCount = p29.MaxOrderCount,
Cost = p29.Cost,
PackingCost = p29.PackingCost,
Stock = p29.Stock,
BrandId = p29.BrandId,
BrandName = p29.Brand.Name,
CategoryId = p29.CategoryId,
CategoryName = p29.Category.Name,
Specifications = p29.Specifications.Select<Specification, SpecificationSDto>(p30 => new SpecificationSDto()
PersianName = p33.PersianName,
EnglishName = p33.EnglishName,
Summery = p33.Summery,
ExpertCheck = p33.ExpertCheck,
Tags = p33.Tags,
Warranty = p33.Warranty,
BeDisplayed = p33.BeDisplayed,
HasExpressDelivery = p33.HasExpressDelivery,
Cost = p33.Cost,
PackingCost = p33.PackingCost,
MaxOrderCount = p33.MaxOrderCount,
Stock = p33.Stock,
BrandId = p33.BrandId,
BrandName = p33.Brand == null ? null : p33.Brand.Name,
CategoryId = p33.CategoryId,
CategoryName = p33.Category == null ? null : p33.Category.Name,
Specifications = p33.Specifications.Select<Specification, SpecificationSDto>(p34 => new SpecificationSDto()
{
Title = p30.Title,
Detail = p30.Detail,
Value = p30.Value,
IsFeature = p30.IsFeature,
ProductId = p30.ProductId,
ParentId = p30.ParentId == null ? default(Guid) : (Guid)p30.ParentId,
Id = p30.Id,
CreatedAt = p30.CreatedAt
Title = p34.Title,
Detail = p34.Detail,
Value = p34.Value,
IsFeature = p34.IsFeature,
ProductId = p34.ProductId,
ParentId = p34.ParentId == null ? default(Guid) : (Guid)p34.ParentId,
Id = p34.Id,
CreatedAt = p34.CreatedAt
}).ToList<SpecificationSDto>(),
Reviews = p29.Reviews.Select<Review, ReviewSDto>(p31 => new ReviewSDto()
Reviews = p33.Reviews.Select<Review, ReviewSDto>(p35 => new ReviewSDto()
{
Title = p31.Title,
Comment = p31.Comment,
Rate = p31.Rate,
IsBuyer = p31.IsBuyer,
ProductId = p31.ProductId,
UserId = p31.UserId,
Id = p31.Id,
CreatedAt = p31.CreatedAt
Title = p35.Title,
Comment = p35.Comment,
Rate = p35.Rate,
IsBuyer = p35.IsBuyer,
ProductId = p35.ProductId,
UserId = p35.UserId,
Id = p35.Id,
CreatedAt = p35.CreatedAt
}).ToList<ReviewSDto>(),
Files = p29.Files.Select<ProductStorageFile, StorageFileSDto>(p32 => new StorageFileSDto()
Files = p33.Files.Select<ProductStorageFile, StorageFileSDto>(p36 => new StorageFileSDto()
{
Name = p32.Name,
FileLocation = p32.FileLocation,
FileName = p32.FileName,
IsHeader = p32.IsHeader,
IsPrimary = p32.IsPrimary,
FileType = p32.FileType,
Id = p32.Id
Name = p36.Name,
FileLocation = p36.FileLocation,
FileName = p36.FileName,
IsHeader = p36.IsHeader,
IsPrimary = p36.IsPrimary,
FileType = p36.FileType,
Id = p36.Id
}).ToList<StorageFileSDto>(),
Id = p29.Id,
CreatedAt = p29.CreatedAt
Id = p33.Id,
CreatedAt = p33.CreatedAt
};
public static Product AdaptToProduct(this ProductSDto p33)
public static Product AdaptToProduct(this ProductSDto p37)
{
return p33 == null ? null : new Product()
return p37 == null ? null : new Product()
{
PersianName = p33.PersianName,
EnglishName = p33.EnglishName,
Summery = p33.Summery,
ExpertCheck = p33.ExpertCheck,
Tags = p33.Tags,
Warranty = p33.Warranty,
Cost = p33.Cost,
IsEnable = p33.IsEnable,
BeDisplayed = p33.BeDisplayed,
PackingCost = p33.PackingCost,
Rate = p33.Rate,
ReviewCount = p33.ReviewCount,
Viewed = p33.Viewed,
BrandId = p33.BrandId,
PersianName = p37.PersianName,
EnglishName = p37.EnglishName,
Summery = p37.Summery,
ExpertCheck = p37.ExpertCheck,
Tags = p37.Tags,
Warranty = p37.Warranty,
Cost = p37.Cost,
IsEnable = p37.IsEnable,
BeDisplayed = p37.BeDisplayed,
PackingCost = p37.PackingCost,
Rate = p37.Rate,
ReviewCount = p37.ReviewCount,
Viewed = p37.Viewed,
BrandId = p37.BrandId,
Brand = new Brand()
{
Name = p33.BrandName,
Id = p33.BrandId
Name = p37.BrandName,
Id = p37.BrandId
},
CategoryId = p33.CategoryId,
CategoryId = p37.CategoryId,
Category = new ProductCategory()
{
Name = p33.CategoryName,
Id = p33.CategoryId
Name = p37.CategoryName,
Id = p37.CategoryId
},
Id = p33.Id,
CreatedAt = p33.CreatedAt
Id = p37.Id,
CreatedAt = p37.CreatedAt
};
}
public static Product AdaptTo(this ProductSDto p34, Product p35)
public static Product AdaptTo(this ProductSDto p38, Product p39)
{
if (p34 == null)
if (p38 == null)
{
return null;
}
Product result = p35 ?? new Product();
Product result = p39 ?? new Product();
result.PersianName = p34.PersianName;
result.EnglishName = p34.EnglishName;
result.Summery = p34.Summery;
result.ExpertCheck = p34.ExpertCheck;
result.Tags = p34.Tags;
result.Warranty = p34.Warranty;
result.Cost = p34.Cost;
result.IsEnable = p34.IsEnable;
result.BeDisplayed = p34.BeDisplayed;
result.PackingCost = p34.PackingCost;
result.Rate = p34.Rate;
result.ReviewCount = p34.ReviewCount;
result.Viewed = p34.Viewed;
result.BrandId = p34.BrandId;
result.Brand = funcMain13(new Never(), result.Brand, p34);
result.CategoryId = p34.CategoryId;
result.Category = funcMain14(new Never(), result.Category, p34);
result.Id = p34.Id;
result.CreatedAt = p34.CreatedAt;
result.PersianName = p38.PersianName;
result.EnglishName = p38.EnglishName;
result.Summery = p38.Summery;
result.ExpertCheck = p38.ExpertCheck;
result.Tags = p38.Tags;
result.Warranty = p38.Warranty;
result.Cost = p38.Cost;
result.IsEnable = p38.IsEnable;
result.BeDisplayed = p38.BeDisplayed;
result.PackingCost = p38.PackingCost;
result.Rate = p38.Rate;
result.ReviewCount = p38.ReviewCount;
result.Viewed = p38.Viewed;
result.BrandId = p38.BrandId;
result.Brand = funcMain15(new Never(), result.Brand, p38);
result.CategoryId = p38.CategoryId;
result.Category = funcMain16(new Never(), result.Category, p38);
result.Id = p38.Id;
result.CreatedAt = p38.CreatedAt;
return result;
}
public static ProductSDto AdaptToSDto(this Product p40)
public static ProductSDto AdaptToSDto(this Product p44)
{
return p40 == null ? null : new ProductSDto()
return p44 == null ? null : new ProductSDto()
{
PersianName = p40.PersianName,
EnglishName = p40.EnglishName,
Summery = p40.Summery,
ExpertCheck = p40.ExpertCheck,
Tags = p40.Tags,
Warranty = p40.Warranty,
Cost = p40.Cost,
IsEnable = p40.IsEnable,
BeDisplayed = p40.BeDisplayed,
PackingCost = p40.PackingCost,
Rate = p40.Rate,
ReviewCount = p40.ReviewCount,
Viewed = p40.Viewed,
CategoryId = p40.CategoryId,
BrandId = p40.BrandId,
BrandName = p40.Brand == null ? null : p40.Brand.Name,
CategoryName = p40.Category == null ? null : p40.Category.Name,
Id = p40.Id,
CreatedAt = p40.CreatedAt
PersianName = p44.PersianName,
EnglishName = p44.EnglishName,
Summery = p44.Summery,
ExpertCheck = p44.ExpertCheck,
Tags = p44.Tags,
Warranty = p44.Warranty,
Cost = p44.Cost,
IsEnable = p44.IsEnable,
BeDisplayed = p44.BeDisplayed,
PackingCost = p44.PackingCost,
Rate = p44.Rate,
ReviewCount = p44.ReviewCount,
Viewed = p44.Viewed,
MainImage = p44.Files.FirstOrDefault<ProductStorageFile>(funcMain17) != null ? p44.Files.FirstOrDefault<ProductStorageFile>(funcMain18).FileLocation : (p44.Files.Count > 0 ? p44.Files.FirstOrDefault<ProductStorageFile>().FileLocation : string.Empty),
CategoryId = p44.CategoryId,
BrandId = p44.BrandId,
BrandName = p44.Brand == null ? null : p44.Brand.Name,
CategoryName = p44.Category == null ? null : p44.Category.Name,
Id = p44.Id,
CreatedAt = p44.CreatedAt
};
}
public static ProductSDto AdaptTo(this Product p41, ProductSDto p42)
public static ProductSDto AdaptTo(this Product p45, ProductSDto p46)
{
if (p41 == null)
if (p45 == null)
{
return null;
}
ProductSDto result = p42 ?? new ProductSDto();
ProductSDto result = p46 ?? new ProductSDto();
result.PersianName = p41.PersianName;
result.EnglishName = p41.EnglishName;
result.Summery = p41.Summery;
result.ExpertCheck = p41.ExpertCheck;
result.Tags = p41.Tags;
result.Warranty = p41.Warranty;
result.Cost = p41.Cost;
result.IsEnable = p41.IsEnable;
result.BeDisplayed = p41.BeDisplayed;
result.PackingCost = p41.PackingCost;
result.Rate = p41.Rate;
result.ReviewCount = p41.ReviewCount;
result.Viewed = p41.Viewed;
result.CategoryId = p41.CategoryId;
result.BrandId = p41.BrandId;
result.BrandName = p41.Brand == null ? null : p41.Brand.Name;
result.CategoryName = p41.Category == null ? null : p41.Category.Name;
result.Id = p41.Id;
result.CreatedAt = p41.CreatedAt;
result.PersianName = p45.PersianName;
result.EnglishName = p45.EnglishName;
result.Summery = p45.Summery;
result.ExpertCheck = p45.ExpertCheck;
result.Tags = p45.Tags;
result.Warranty = p45.Warranty;
result.Cost = p45.Cost;
result.IsEnable = p45.IsEnable;
result.BeDisplayed = p45.BeDisplayed;
result.PackingCost = p45.PackingCost;
result.Rate = p45.Rate;
result.ReviewCount = p45.ReviewCount;
result.Viewed = p45.Viewed;
result.MainImage = p45.Files.FirstOrDefault<ProductStorageFile>(funcMain17) != null ? p45.Files.FirstOrDefault<ProductStorageFile>(funcMain18).FileLocation : (p45.Files.Count > 0 ? p45.Files.FirstOrDefault<ProductStorageFile>().FileLocation : string.Empty);
result.CategoryId = p45.CategoryId;
result.BrandId = p45.BrandId;
result.BrandName = p45.Brand == null ? null : p45.Brand.Name;
result.CategoryName = p45.Category == null ? null : p45.Category.Name;
result.Id = p45.Id;
result.CreatedAt = p45.CreatedAt;
return result;
}
public static Expression<Func<Product, ProductSDto>> ProjectToSDto => p43 => new ProductSDto()
public static Expression<Func<Product, ProductSDto>> ProjectToSDto => p47 => new ProductSDto()
{
PersianName = p43.PersianName,
EnglishName = p43.EnglishName,
Summery = p43.Summery,
ExpertCheck = p43.ExpertCheck,
Tags = p43.Tags,
Warranty = p43.Warranty,
Cost = p43.Cost,
IsEnable = p43.IsEnable,
BeDisplayed = p43.BeDisplayed,
PackingCost = p43.PackingCost,
Rate = p43.Rate,
ReviewCount = p43.ReviewCount,
Viewed = p43.Viewed,
CategoryId = p43.CategoryId,
BrandId = p43.BrandId,
BrandName = p43.Brand == null ? null : p43.Brand.Name,
CategoryName = p43.Category == null ? null : p43.Category.Name,
Id = p43.Id,
CreatedAt = p43.CreatedAt
PersianName = p47.PersianName,
EnglishName = p47.EnglishName,
Summery = p47.Summery,
ExpertCheck = p47.ExpertCheck,
Tags = p47.Tags,
Warranty = p47.Warranty,
Cost = p47.Cost,
IsEnable = p47.IsEnable,
BeDisplayed = p47.BeDisplayed,
PackingCost = p47.PackingCost,
Rate = p47.Rate,
ReviewCount = p47.ReviewCount,
Viewed = p47.Viewed,
MainImage = p47.Files.FirstOrDefault<ProductStorageFile>(f => f.IsPrimary) != null ? p47.Files.FirstOrDefault<ProductStorageFile>(f => f.IsPrimary).FileLocation : (p47.Files.Count > 0 ? p47.Files.FirstOrDefault<ProductStorageFile>().FileLocation : string.Empty),
CategoryId = p47.CategoryId,
BrandId = p47.BrandId,
BrandName = p47.Brand == null ? null : p47.Brand.Name,
CategoryName = p47.Category == null ? null : p47.Category.Name,
Id = p47.Id,
CreatedAt = p47.CreatedAt
};
private static List<Specification> funcMain1(List<SpecificationSDto> p2)
@ -466,20 +491,40 @@ namespace NetinaShop.Domain.Mappers
}
private static List<Specification> funcMain4(List<SpecificationSDto> p7, List<Specification> p8)
private static Brand funcMain4(Never p7, Brand p8, ProductLDto p5)
{
if (p7 == null)
Brand result = p8 ?? new Brand();
result.Name = p5.BrandName;
result.Id = p5.BrandId;
return result;
}
private static ProductCategory funcMain5(Never p9, ProductCategory p10, ProductLDto p5)
{
ProductCategory result = p10 ?? new ProductCategory();
result.Name = p5.CategoryName;
result.Id = p5.CategoryId;
return result;
}
private static List<Specification> funcMain6(List<SpecificationSDto> p11, List<Specification> p12)
{
if (p11 == null)
{
return null;
}
List<Specification> result = new List<Specification>(p7.Count);
List<Specification> result = new List<Specification>(p11.Count);
int i = 0;
int len = p7.Count;
int len = p11.Count;
while (i < len)
{
SpecificationSDto item = p7[i];
SpecificationSDto item = p11[i];
result.Add(item == null ? null : new Specification()
{
Title = item.Title,
@ -497,20 +542,20 @@ namespace NetinaShop.Domain.Mappers
}
private static List<Review> funcMain5(List<ReviewSDto> p9, List<Review> p10)
private static List<Review> funcMain7(List<ReviewSDto> p13, List<Review> p14)
{
if (p9 == null)
if (p13 == null)
{
return null;
}
List<Review> result = new List<Review>(p9.Count);
List<Review> result = new List<Review>(p13.Count);
int i = 0;
int len = p9.Count;
int len = p13.Count;
while (i < len)
{
ReviewSDto item = p9[i];
ReviewSDto item = p13[i];
result.Add(item == null ? null : new Review()
{
Title = item.Title,
@ -528,20 +573,20 @@ namespace NetinaShop.Domain.Mappers
}
private static List<ProductStorageFile> funcMain6(List<StorageFileSDto> p11, List<ProductStorageFile> p12)
private static List<ProductStorageFile> funcMain8(List<StorageFileSDto> p15, List<ProductStorageFile> p16)
{
if (p11 == null)
if (p15 == null)
{
return null;
}
List<ProductStorageFile> result = new List<ProductStorageFile>(p11.Count);
List<ProductStorageFile> result = new List<ProductStorageFile>(p15.Count);
int i = 0;
int len = p11.Count;
int len = p15.Count;
while (i < len)
{
StorageFileSDto item = p11[i];
StorageFileSDto item = p15[i];
result.Add(item == null ? null : new ProductStorageFile()
{
Name = item.Name,
@ -559,20 +604,20 @@ namespace NetinaShop.Domain.Mappers
}
private static List<SpecificationSDto> funcMain7(List<Specification> p18)
private static List<SpecificationSDto> funcMain9(List<Specification> p22)
{
if (p18 == null)
if (p22 == null)
{
return null;
}
List<SpecificationSDto> result = new List<SpecificationSDto>(p18.Count);
List<SpecificationSDto> result = new List<SpecificationSDto>(p22.Count);
int i = 0;
int len = p18.Count;
int len = p22.Count;
while (i < len)
{
Specification item = p18[i];
Specification item = p22[i];
result.Add(item == null ? null : new SpecificationSDto()
{
Title = item.Title,
@ -590,112 +635,20 @@ namespace NetinaShop.Domain.Mappers
}
private static List<ReviewSDto> funcMain8(List<Review> p19)
{
if (p19 == null)
{
return null;
}
List<ReviewSDto> result = new List<ReviewSDto>(p19.Count);
int i = 0;
int len = p19.Count;
while (i < len)
{
Review item = p19[i];
result.Add(item == null ? null : new ReviewSDto()
{
Title = item.Title,
Comment = item.Comment,
Rate = item.Rate,
IsBuyer = item.IsBuyer,
ProductId = item.ProductId,
UserId = item.UserId,
Id = item.Id,
CreatedAt = item.CreatedAt
});
i++;
}
return result;
}
private static List<StorageFileSDto> funcMain9(List<ProductStorageFile> p20)
{
if (p20 == null)
{
return null;
}
List<StorageFileSDto> result = new List<StorageFileSDto>(p20.Count);
int i = 0;
int len = p20.Count;
while (i < len)
{
ProductStorageFile item = p20[i];
result.Add(item == null ? null : new StorageFileSDto()
{
Name = item.Name,
FileLocation = item.FileLocation,
FileName = item.FileName,
IsHeader = item.IsHeader,
IsPrimary = item.IsPrimary,
FileType = item.FileType,
Id = item.Id
});
i++;
}
return result;
}
private static List<SpecificationSDto> funcMain10(List<Specification> p23, List<SpecificationSDto> p24)
private static List<ReviewSDto> funcMain10(List<Review> p23)
{
if (p23 == null)
{
return null;
}
List<SpecificationSDto> result = new List<SpecificationSDto>(p23.Count);
List<ReviewSDto> result = new List<ReviewSDto>(p23.Count);
int i = 0;
int len = p23.Count;
while (i < len)
{
Specification item = p23[i];
result.Add(item == null ? null : new SpecificationSDto()
{
Title = item.Title,
Detail = item.Detail,
Value = item.Value,
IsFeature = item.IsFeature,
ProductId = item.ProductId,
ParentId = item.ParentId == null ? default(Guid) : (Guid)item.ParentId,
Id = item.Id,
CreatedAt = item.CreatedAt
});
i++;
}
return result;
}
private static List<ReviewSDto> funcMain11(List<Review> p25, List<ReviewSDto> p26)
{
if (p25 == null)
{
return null;
}
List<ReviewSDto> result = new List<ReviewSDto>(p25.Count);
int i = 0;
int len = p25.Count;
while (i < len)
{
Review item = p25[i];
Review item = p23[i];
result.Add(item == null ? null : new ReviewSDto()
{
Title = item.Title,
@ -713,20 +666,20 @@ namespace NetinaShop.Domain.Mappers
}
private static List<StorageFileSDto> funcMain12(List<ProductStorageFile> p27, List<StorageFileSDto> p28)
private static List<StorageFileSDto> funcMain11(List<ProductStorageFile> p24)
{
if (p27 == null)
if (p24 == null)
{
return null;
}
List<StorageFileSDto> result = new List<StorageFileSDto>(p27.Count);
List<StorageFileSDto> result = new List<StorageFileSDto>(p24.Count);
int i = 0;
int len = p27.Count;
int len = p24.Count;
while (i < len)
{
ProductStorageFile item = p27[i];
ProductStorageFile item = p24[i];
result.Add(item == null ? null : new StorageFileSDto()
{
Name = item.Name,
@ -743,24 +696,126 @@ namespace NetinaShop.Domain.Mappers
}
private static Brand funcMain13(Never p36, Brand p37, ProductSDto p34)
private static List<SpecificationSDto> funcMain12(List<Specification> p27, List<SpecificationSDto> p28)
{
Brand result = p37 ?? new Brand();
if (p27 == null)
{
return null;
}
List<SpecificationSDto> result = new List<SpecificationSDto>(p27.Count);
result.Name = p34.BrandName;
result.Id = p34.BrandId;
int i = 0;
int len = p27.Count;
while (i < len)
{
Specification item = p27[i];
result.Add(item == null ? null : new SpecificationSDto()
{
Title = item.Title,
Detail = item.Detail,
Value = item.Value,
IsFeature = item.IsFeature,
ProductId = item.ProductId,
ParentId = item.ParentId == null ? default(Guid) : (Guid)item.ParentId,
Id = item.Id,
CreatedAt = item.CreatedAt
});
i++;
}
return result;
}
private static ProductCategory funcMain14(Never p38, ProductCategory p39, ProductSDto p34)
private static List<ReviewSDto> funcMain13(List<Review> p29, List<ReviewSDto> p30)
{
ProductCategory result = p39 ?? new ProductCategory();
if (p29 == null)
{
return null;
}
List<ReviewSDto> result = new List<ReviewSDto>(p29.Count);
result.Name = p34.CategoryName;
result.Id = p34.CategoryId;
int i = 0;
int len = p29.Count;
while (i < len)
{
Review item = p29[i];
result.Add(item == null ? null : new ReviewSDto()
{
Title = item.Title,
Comment = item.Comment,
Rate = item.Rate,
IsBuyer = item.IsBuyer,
ProductId = item.ProductId,
UserId = item.UserId,
Id = item.Id,
CreatedAt = item.CreatedAt
});
i++;
}
return result;
}
private static List<StorageFileSDto> funcMain14(List<ProductStorageFile> p31, List<StorageFileSDto> p32)
{
if (p31 == null)
{
return null;
}
List<StorageFileSDto> result = new List<StorageFileSDto>(p31.Count);
int i = 0;
int len = p31.Count;
while (i < len)
{
ProductStorageFile item = p31[i];
result.Add(item == null ? null : new StorageFileSDto()
{
Name = item.Name,
FileLocation = item.FileLocation,
FileName = item.FileName,
IsHeader = item.IsHeader,
IsPrimary = item.IsPrimary,
FileType = item.FileType,
Id = item.Id
});
i++;
}
return result;
}
private static Brand funcMain15(Never p40, Brand p41, ProductSDto p38)
{
Brand result = p41 ?? new Brand();
result.Name = p38.BrandName;
result.Id = p38.BrandId;
return result;
}
private static ProductCategory funcMain16(Never p42, ProductCategory p43, ProductSDto p38)
{
ProductCategory result = p43 ?? new ProductCategory();
result.Name = p38.CategoryName;
result.Id = p38.CategoryId;
return result;
}
private static bool funcMain17(ProductStorageFile f)
{
return f.IsPrimary;
}
private static bool funcMain18(ProductStorageFile f)
{
return f.IsPrimary;
}
}
}

View File

@ -11,6 +11,12 @@ namespace NetinaShop.Domain.Mappers
{
return p1 == null ? null : new Shipping()
{
Name = p1.Name,
WarehouseName = p1.WarehouseName,
IsExpressShipping = p1.IsExpressShipping,
IsShipBySeller = p1.IsShipBySeller,
IsOriginalWarehouse = p1.IsOriginalWarehouse,
DeliveryCost = p1.DeliveryCost,
Id = p1.Id,
CreatedAt = p1.CreatedAt
};
@ -23,6 +29,12 @@ namespace NetinaShop.Domain.Mappers
}
Shipping result = p3 ?? new Shipping();
result.Name = p2.Name;
result.WarehouseName = p2.WarehouseName;
result.IsExpressShipping = p2.IsExpressShipping;
result.IsShipBySeller = p2.IsShipBySeller;
result.IsOriginalWarehouse = p2.IsOriginalWarehouse;
result.DeliveryCost = p2.DeliveryCost;
result.Id = p2.Id;
result.CreatedAt = p2.CreatedAt;
return result;
@ -32,6 +44,12 @@ namespace NetinaShop.Domain.Mappers
{
return p4 == null ? null : new ShippingSDto()
{
Name = p4.Name,
WarehouseName = p4.WarehouseName,
IsExpressShipping = p4.IsExpressShipping,
IsShipBySeller = p4.IsShipBySeller,
IsOriginalWarehouse = p4.IsOriginalWarehouse,
DeliveryCost = p4.DeliveryCost,
Id = p4.Id,
CreatedAt = p4.CreatedAt
};
@ -44,6 +62,12 @@ namespace NetinaShop.Domain.Mappers
}
ShippingSDto result = p6 ?? new ShippingSDto();
result.Name = p5.Name;
result.WarehouseName = p5.WarehouseName;
result.IsExpressShipping = p5.IsExpressShipping;
result.IsShipBySeller = p5.IsShipBySeller;
result.IsOriginalWarehouse = p5.IsOriginalWarehouse;
result.DeliveryCost = p5.DeliveryCost;
result.Id = p5.Id;
result.CreatedAt = p5.CreatedAt;
return result;
@ -51,6 +75,12 @@ namespace NetinaShop.Domain.Mappers
}
public static Expression<Func<Shipping, ShippingSDto>> ProjectToSDto => p7 => new ShippingSDto()
{
Name = p7.Name,
WarehouseName = p7.WarehouseName,
IsExpressShipping = p7.IsExpressShipping,
IsShipBySeller = p7.IsShipBySeller,
IsOriginalWarehouse = p7.IsOriginalWarehouse,
DeliveryCost = p7.DeliveryCost,
Id = p7.Id,
CreatedAt = p7.CreatedAt
};

View File

@ -17,6 +17,13 @@ public class MapsterRegister : IRegister
.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)
.Map("CategoryName", o => o.Category == null ? null : o.Category.Name)
.Map("BrandName", o => o.Brand == null ? null : o.Brand.Name)
.IgnoreNullValues(false)
.TwoWays();
config.NewConfig<Product, ProductLDto>()
.Map("CategoryName", o => o.Category == null ? null : o.Category.Name)
.Map("BrandName", o => o.Brand == null ? null : o.Brand.Name)
.IgnoreNullValues(false)

View File

@ -12,7 +12,7 @@ public class CreateShippingCommandHandler : IRequestHandler<CreateShippingComman
}
public async Task<ShippingSDto> Handle(CreateShippingCommand request, CancellationToken cancellationToken)
{
var ent = Shipping.Create(request.Title, request.WarehouseName, request.IsFastShipping, request.IsShipBySeller,
var ent = Shipping.Create(request.Name, request.WarehouseName, request.IsExpressShipping, request.IsShipBySeller,
request.IsOriginalWarehouse,request.DeliveryCost);
_repositoryWrapper.SetRepository<Shipping>().Add(ent);
await _repositoryWrapper.SaveChangesAsync(cancellationToken);

View File

@ -15,8 +15,8 @@ public class GetShippingsQueryHandler : IRequestHandler<GetShippingsQuery,List<S
return await _repositoryWrapper
.SetRepository<Shipping>()
.TableNoTracking.OrderByDescending(b => b.CreatedAt)
.Skip(request.Page * 10)
.Take(10)
.Skip(request.Page * 20)
.Take(20)
.Select(ShippingMapper.ProjectToSDto)
.ToListAsync(cancellationToken);
}

View File

@ -17,7 +17,7 @@ public class UpdateShippingCommandHandler : IRequestHandler<UpdateShippingComman
if (ent == null)
throw new AppException("Shipping not found", ApiResultStatusCode.NotFound);
var newEnt = Shipping.Create(request.Title, request.WarehouseName, request.IsFastShipping, request.IsShipBySeller,
var newEnt = Shipping.Create(request.Name, request.WarehouseName, request.IsExpressShipping, request.IsShipBySeller,
request.IsOriginalWarehouse,request.DeliveryCost);
newEnt.Id = ent.Id;
newEnt.CreatedAt = ent.CreatedAt;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,930 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NetinaShop.Repository.Migrations
{
/// <inheritdoc />
public partial class EditShippingName : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Title",
schema: "public",
table: "Shippings",
newName: "Name");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "UserFavoriteProducts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "UserFavoriteProducts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "UserFavoriteProducts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "UserAddresses",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "UserAddresses",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "UserAddresses",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "StorageFiles",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "StorageFiles",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "StorageFiles",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Specifications",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Specifications",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Specifications",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Shippings",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Shippings",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Shippings",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Reviews",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Reviews",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Reviews",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Products",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Products",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Products",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "ProductCategories",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "ProductCategories",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "ProductCategories",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Orders",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Orders",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Orders",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "OrderProducts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "OrderProducts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "OrderProducts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "OrderDeliveries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "OrderDeliveries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "OrderDeliveries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Discounts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Discounts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Discounts",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Brands",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Brands",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Brands",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Blogs",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Blogs",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Blogs",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "BlogCategories",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "BlogCategories",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "BlogCategories",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Name",
schema: "public",
table: "Shippings",
newName: "Title");
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "UserFavoriteProducts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "UserFavoriteProducts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "UserFavoriteProducts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "UserAddresses",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "UserAddresses",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "UserAddresses",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "StorageFiles",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "StorageFiles",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "StorageFiles",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Specifications",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Specifications",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Specifications",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Shippings",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Shippings",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Shippings",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Reviews",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Reviews",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Reviews",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Products",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Products",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Products",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "ProductCategories",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "ProductCategories",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "ProductCategories",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Orders",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Orders",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Orders",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "OrderProducts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "OrderProducts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "OrderProducts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "OrderDeliveries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "OrderDeliveries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "OrderDeliveries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Discounts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Discounts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Discounts",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Brands",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Brands",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Brands",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "Blogs",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "Blogs",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "Blogs",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "RemovedBy",
schema: "public",
table: "BlogCategories",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ModifiedBy",
schema: "public",
table: "BlogCategories",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "CreatedBy",
schema: "public",
table: "BlogCategories",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
}
}
}

View File

@ -143,7 +143,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsRemoved")
@ -156,7 +155,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<int>("ReadingTime")
@ -166,7 +164,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Summery")
@ -198,7 +195,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Description")
@ -212,7 +208,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
@ -223,7 +218,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
@ -241,7 +235,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Description")
@ -258,7 +251,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
@ -273,7 +265,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
@ -301,7 +292,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<long>("DiscountAmount")
@ -343,7 +333,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<long>("PriceCeiling")
@ -356,7 +345,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("StartDate")
@ -387,7 +375,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<double>("DeliveryPrice")
@ -416,7 +403,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("OrderAt")
@ -441,7 +427,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<double>("ServicePrice")
@ -482,7 +467,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<double>("DeliveryCost")
@ -495,7 +479,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("OrderId")
@ -517,7 +500,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("ShippingId")
@ -545,7 +527,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsRemoved")
@ -555,7 +536,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("OrderId")
@ -586,7 +566,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
@ -608,7 +587,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Description")
@ -625,7 +603,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
@ -639,7 +616,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
@ -671,7 +647,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("EnglishName")
@ -698,7 +673,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<double>("PackingCost")
@ -715,7 +689,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<int>("ReviewCount")
@ -762,7 +735,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsBuyer")
@ -778,7 +750,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("ProductId")
@ -791,7 +762,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Title")
@ -820,7 +790,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Detail")
@ -837,7 +806,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid?>("ParentId")
@ -850,7 +818,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Title")
@ -880,7 +847,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Discriminator")
@ -912,7 +878,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
@ -923,7 +888,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
@ -1074,7 +1038,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsRemoved")
@ -1090,7 +1053,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PostalCode")
@ -1109,7 +1071,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
@ -1132,7 +1093,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsRemoved")
@ -1142,7 +1102,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("ProductId")
@ -1152,7 +1111,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("UserId")
@ -1177,7 +1135,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("text");
b.Property<double>("DeliveryCost")
@ -1199,6 +1156,9 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("ModifiedBy")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
@ -1206,11 +1166,6 @@ namespace NetinaShop.Repository.Migrations
.HasColumnType("timestamp without time zone");
b.Property<string>("RemovedBy")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("text");
b.Property<string>("WarehouseName")