Open Closed

Power tools generate a new Product Id while already exist during Regenerate #9741


0
TOGIT created

Related version : ASP.NET CORE MVC & jQuery 9.2.1

When I use power tools 2.7.1 while regenerate a Master-Detail Page, the following error appears:

Error CS0102 The type 'CreateOrEditProductVariantDto' already contains a definition for 'ProductId' OHB2B.Application.Shared D:\OH\ohb2b-test\src\OHB2B.Application.Shared\ProductVariants\Dtos\CreateOrEditProductVariantDto.cs 19 Active

public class CreateOrEditProductVariantDto : EntityDto<long?>
{

    [Required]
    [StringLength(ProductVariantConsts.MaxNameLength, MinimumLength = ProductVariantConsts.MinNameLength)]
    public string Name { get; set; }		

    public int? Code { get; set; }		

    public long? ProductId { get; set; }

    public long? ProductId { get; set; }

    public long RegionId { get; set; }		 

}

After manual correction

public class CreateOrEditProductVariantDto : EntityDto<long?>
{

    [Required]
    [StringLength(ProductVariantConsts.MaxNameLength, MinimumLength = ProductVariantConsts.MinNameLength)]
    public string Name { get; set; }		

    public int? Code { get; set; }		

    public long? ProductId { get; set; } 

    public long RegionId { get; set; }		

}

Note: this issue is not specifc for Master-Detail Page it also happen before when regenerate a single entity.


1 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @TOGIT

    To reproduce this problem, could you share json file(s) for this code generation ? You can find it under aspnet-core\AspNetZeroRadTool folder of your solution.