update
This commit is contained in:
586
docs/model.ndm2
586
docs/model.ndm2
@@ -25157,191 +25157,6 @@
|
||||
"dataCompressions": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"objectType": "Table_MSSQL",
|
||||
"name": "GetAllUserCartsByFilterResponseModel",
|
||||
"comment": "مدل خروجی آدرس کاربر بر مبنای فیلتر",
|
||||
"owner": "",
|
||||
"isChangeTracking": false,
|
||||
"isTrackColumnsUpdated": false,
|
||||
"oldName": "GetAllUserCartsByFilterResponseModel",
|
||||
"isSystemTable": false,
|
||||
"createTime": "",
|
||||
"modifyTime": "",
|
||||
"objectID": 1174,
|
||||
"numberOfRows": 0,
|
||||
"identityCurrent": 0,
|
||||
"dataLength": 0,
|
||||
"indexLength": 0,
|
||||
"fields": [
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "Id",
|
||||
"type": "bigint",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "sys",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "Id",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": true,
|
||||
"isExistingField": false,
|
||||
"identitySeed": -2147483648,
|
||||
"identityIncrement": -2147483648,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "ProductId",
|
||||
"type": "bigint",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "ProductId",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "UserId",
|
||||
"type": "bigint",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "UserId",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "Count",
|
||||
"type": "int",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "Count",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
}
|
||||
],
|
||||
"indexes": [],
|
||||
"primaryKey": {
|
||||
"objectType": "PrimaryKey_MSSQL",
|
||||
"name": "_copy_84",
|
||||
"fields": [
|
||||
"Id"
|
||||
],
|
||||
"fillFactor": 0,
|
||||
"oldName": "",
|
||||
"isClustered": false,
|
||||
"isPadded": false,
|
||||
"noRecomputeStatistics": false,
|
||||
"ignoreDuplicatedKeyValues": false,
|
||||
"allowRowLocks": false,
|
||||
"allowPageLocks": false,
|
||||
"storage": {
|
||||
"objectType": "Storage_MSSQL",
|
||||
"name": "",
|
||||
"oldName": "",
|
||||
"storageType": "Default",
|
||||
"filegroup": "",
|
||||
"textImageFilegroup": "",
|
||||
"filestreamFilegroup": "",
|
||||
"partitionScheme": "",
|
||||
"partitionColumn": "",
|
||||
"filestreamPartitionScheme": "",
|
||||
"dataCompressions": []
|
||||
}
|
||||
},
|
||||
"foreignKeys": [],
|
||||
"uniques": [],
|
||||
"checks": [],
|
||||
"triggers": [],
|
||||
"storage": {
|
||||
"objectType": "Storage_MSSQL",
|
||||
"name": "",
|
||||
"oldName": "",
|
||||
"storageType": "Default",
|
||||
"filegroup": "",
|
||||
"textImageFilegroup": "",
|
||||
"filestreamFilegroup": "",
|
||||
"partitionScheme": "",
|
||||
"partitionColumn": "",
|
||||
"filestreamPartitionScheme": "",
|
||||
"dataCompressions": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"objectType": "Table_MSSQL",
|
||||
"name": "ProductGallerysService",
|
||||
@@ -49481,6 +49296,401 @@
|
||||
"filestreamPartitionScheme": "",
|
||||
"dataCompressions": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"objectType": "Table_MSSQL",
|
||||
"name": "GetAllUserCartsByFilterResponseModel",
|
||||
"comment": "مدل خروجی آدرس کاربر بر مبنای فیلتر",
|
||||
"owner": "",
|
||||
"isChangeTracking": false,
|
||||
"isTrackColumnsUpdated": false,
|
||||
"oldName": "GetAllUserCartsByFilterResponseModel",
|
||||
"isSystemTable": false,
|
||||
"createTime": "",
|
||||
"modifyTime": "",
|
||||
"objectID": 1174,
|
||||
"numberOfRows": 0,
|
||||
"identityCurrent": 0,
|
||||
"dataLength": 0,
|
||||
"indexLength": 0,
|
||||
"fields": [
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "Id",
|
||||
"type": "bigint",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "sys",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "Id",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": true,
|
||||
"isExistingField": false,
|
||||
"identitySeed": -2147483648,
|
||||
"identityIncrement": -2147483648,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "ProductId",
|
||||
"type": "bigint",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "ProductId",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "UserId",
|
||||
"type": "bigint",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "UserId",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "Count",
|
||||
"type": "int",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "Count",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "ProductTitle",
|
||||
"type": "nvarchar",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "sys",
|
||||
"userDefinedType": "",
|
||||
"collate": "SQL_Latin1_General_CP1_CI_AS",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "ProductTitle",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "ProductShortInfomation",
|
||||
"type": "nvarchar",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "sys",
|
||||
"userDefinedType": "",
|
||||
"collate": "SQL_Latin1_General_CP1_CI_AS",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "ProductShortInfomation",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "ProductPrice",
|
||||
"type": "bigint",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "sys",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "ProductPrice",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "ProductDiscount",
|
||||
"type": "int",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "sys",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "ProductDiscount",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "ProductThumbnailPath",
|
||||
"type": "nvarchar",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "sys",
|
||||
"userDefinedType": "",
|
||||
"collate": "SQL_Latin1_General_CP1_CI_AS",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "ProductThumbnailPath",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "Count",
|
||||
"type": "int",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "Count",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
},
|
||||
{
|
||||
"objectType": "TableField_MSSQL",
|
||||
"name": "Created",
|
||||
"type": "datetime2",
|
||||
"size": -2147483648,
|
||||
"isNullable": "No",
|
||||
"scale": -2147483648,
|
||||
"comment": "",
|
||||
"computedExpression": "",
|
||||
"defaultValue": "",
|
||||
"defaultValueType": "None",
|
||||
"schema": "",
|
||||
"userDefinedType": "",
|
||||
"collate": "",
|
||||
"isWithValues": false,
|
||||
"isFilestream": false,
|
||||
"isColumnSet": false,
|
||||
"isPersisted": false,
|
||||
"isSparse": false,
|
||||
"isRowGUIDColumn": false,
|
||||
"oldName": "Created",
|
||||
"computedBaseType": "",
|
||||
"isDefaultConstraint": false,
|
||||
"defaultConstraint": "",
|
||||
"isIdentity": false,
|
||||
"isExistingField": false,
|
||||
"identitySeed": 0,
|
||||
"identityIncrement": 0,
|
||||
"identityIsNotForReplication": false
|
||||
}
|
||||
],
|
||||
"indexes": [],
|
||||
"primaryKey": {
|
||||
"objectType": "PrimaryKey_MSSQL",
|
||||
"name": "_copy_84",
|
||||
"fields": [
|
||||
"Id"
|
||||
],
|
||||
"fillFactor": 0,
|
||||
"oldName": "",
|
||||
"isClustered": false,
|
||||
"isPadded": false,
|
||||
"noRecomputeStatistics": false,
|
||||
"ignoreDuplicatedKeyValues": false,
|
||||
"allowRowLocks": false,
|
||||
"allowPageLocks": false,
|
||||
"storage": {
|
||||
"objectType": "Storage_MSSQL",
|
||||
"name": "",
|
||||
"oldName": "",
|
||||
"storageType": "Default",
|
||||
"filegroup": "",
|
||||
"textImageFilegroup": "",
|
||||
"filestreamFilegroup": "",
|
||||
"partitionScheme": "",
|
||||
"partitionColumn": "",
|
||||
"filestreamPartitionScheme": "",
|
||||
"dataCompressions": []
|
||||
}
|
||||
},
|
||||
"foreignKeys": [],
|
||||
"uniques": [],
|
||||
"checks": [],
|
||||
"triggers": [],
|
||||
"storage": {
|
||||
"objectType": "Storage_MSSQL",
|
||||
"name": "",
|
||||
"oldName": "",
|
||||
"storageType": "Default",
|
||||
"filegroup": "",
|
||||
"textImageFilegroup": "",
|
||||
"filestreamFilegroup": "",
|
||||
"partitionScheme": "",
|
||||
"partitionColumn": "",
|
||||
"filestreamPartitionScheme": "",
|
||||
"dataCompressions": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"views": []
|
||||
@@ -51396,7 +51606,7 @@
|
||||
"schemaName": "CMS",
|
||||
"tableName": "CreateNewUserCartsRequest",
|
||||
"x": 14970,
|
||||
"y": 13550,
|
||||
"y": 13704,
|
||||
"width": 400,
|
||||
"height": 156,
|
||||
"isBold": false,
|
||||
@@ -51542,7 +51752,7 @@
|
||||
"x": 15120,
|
||||
"y": 13280,
|
||||
"width": 400,
|
||||
"height": 156,
|
||||
"height": 334,
|
||||
"isBold": false,
|
||||
"titleColor": {
|
||||
"r": 200,
|
||||
@@ -57801,7 +58011,7 @@
|
||||
},
|
||||
{
|
||||
"x": 15170,
|
||||
"y": 13535
|
||||
"y": 13689
|
||||
}
|
||||
],
|
||||
"label": {
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CreateNewCategoryCommandHandler : IRequestHandler<CreateNewCategory
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var entity = request.Adapt<Category>();
|
||||
await _context.Categories.AddAsync(entity, cancellationToken);
|
||||
await _context.Categorys.AddAsync(entity, cancellationToken);
|
||||
entity.AddDomainEvent(new CreateNewCategoryEvent(entity));
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
return entity.Adapt<CreateNewCategoryResponseDto>();
|
||||
|
||||
@@ -11,10 +11,10 @@ public class DeleteCategoryCommandHandler : IRequestHandler<DeleteCategoryComman
|
||||
|
||||
public async Task<Unit> Handle(DeleteCategoryCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var entity = await _context.Categories
|
||||
var entity = await _context.Categorys
|
||||
.FirstOrDefaultAsync(x => x.Id == request.Id, cancellationToken) ?? throw new NotFoundException(nameof(Category), request.Id);
|
||||
entity.IsDeleted = true;
|
||||
_context.Categories.Update(entity);
|
||||
_context.Categorys.Update(entity);
|
||||
entity.AddDomainEvent(new DeleteCategoryEvent(entity));
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
return Unit.Value;
|
||||
|
||||
@@ -11,10 +11,10 @@ public class UpdateCategoryCommandHandler : IRequestHandler<UpdateCategoryComman
|
||||
|
||||
public async Task<Unit> Handle(UpdateCategoryCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var entity = await _context.Categories
|
||||
var entity = await _context.Categorys
|
||||
.FirstOrDefaultAsync(x => x.Id == request.Id, cancellationToken) ?? throw new NotFoundException(nameof(Category), request.Id);
|
||||
request.Adapt(entity);
|
||||
_context.Categories.Update(entity);
|
||||
_context.Categorys.Update(entity);
|
||||
entity.AddDomainEvent(new UpdateCategoryEvent(entity));
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
return Unit.Value;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GetAllCategoryByFilterQueryHandler : IRequestHandler<GetAllCategory
|
||||
|
||||
public async Task<GetAllCategoryByFilterResponseDto> Handle(GetAllCategoryByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var query = _context.Categories
|
||||
var query = _context.Categorys
|
||||
.ApplyOrder(sortBy: request.SortBy)
|
||||
.AsNoTracking()
|
||||
.AsQueryable();
|
||||
|
||||
@@ -11,7 +11,7 @@ public class GetCategoryQueryHandler : IRequestHandler<GetCategoryQuery, GetCate
|
||||
public async Task<GetCategoryResponseDto> Handle(GetCategoryQuery request,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var response = await _context.Categories
|
||||
var response = await _context.Categorys
|
||||
.AsNoTracking()
|
||||
.Where(x => x.Id == request.Id)
|
||||
.ProjectToType<GetCategoryResponseDto>()
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CategoryConfiguration : IEntityTypeConfiguration<Category>
|
||||
|
||||
builder
|
||||
.HasOne(entity => entity.Parent)
|
||||
.WithMany(entity => entity.Categories)
|
||||
.WithMany(entity => entity.Categorys)
|
||||
.HasForeignKey(entity => entity.ParentId)
|
||||
.IsRequired(false);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.0.119</Version>
|
||||
<Version>0.0.121</Version>
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
@@ -40,6 +40,7 @@
|
||||
<Protobuf Include="Protos\contract.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\usercontract.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\pruductcategory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\category.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\tag.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<Protobuf Include="Protos\pruducttag.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Category;
|
||||
|
||||
namespace CMSMicroservice.Protobuf.Validator.Category;
|
||||
|
||||
public class CreateNewCategoryRequestValidator : AbstractValidator<CreateNewCategoryRequest>
|
||||
|
||||
Reference in New Issue
Block a user