We are migration Entity from 3.1 to 6.0 . A shadow property was defined in 3.1 which we cannot create in 6.0. so We removed that property but while calling DB with this entity it was creating a shadow FK index on modelcreating() runtime even though we don't have the property exists anywhere in solution.

Getting below error if we keep 2 properties: 'ClaimAmountTransaction.BankReferenceNumber' and 'ClaimAmountTransaction.PaymentTransactionReferenceNumber' are both mapped to column 'BNK_REF_NBR' in 'Claim.CLAIM_AMOUNT_TRANSACTION', but the properties are contained within the same hierarchy. All properties on an entity type must be mapped to unique different columns.

After removing the shadow property getting below error : "Invalid column name PaymentTransactionReferenceNumber".

Thanks for your help. Its really appreciated. Please feel free to reach out for anything needed. Repository code , where it was trying to quering PaymentTrnsRefNbr instead of BNKrefnbr. public async Task<ListResult> GetClaimAmountTransactionsAsync(ClaimAmountTransationSearchCriteria criteria) { ListResult result = new ListResult(); result.Items = await _context.ClaimAmountTransactions .ConditionalWhere(() => criteria.claimid.HasValue, e => e.ClmId == criteria.claimid.Value) .ConditionalWhere(()=>!string.IsNullOrEmpty(criteria.debitrefnbr),e=>e.BnkRefNbr==criteria.debitrefnbr)

                    .ConditionalWhere(()=>criteria.claimamttransid.HasValue,e=>e.ClmAmntTrnsId==criteria.claimamttransid.Value)
                      .Include(e => e.Payment)
                      .ToListAsync();


         return result;
        }
Context :       entity.Property(e => e.AdjConvFnlPayAmt)
                .HasColumnType("numeric(13, 3)")
                .HasColumnName("ADJ_CONV_FNL_PAY_AMT");
            entity.Property(e => e.AdjFnlPayAmt)
                .HasColumnType("numeric(13, 3)")
                .HasColumnName("ADJ_FNL_PAY_AMT");
            entity.Property(e => e.BnkRefNbr)
                .HasMaxLength(16)
                .HasColumnName("BNK_REF_NBR");
            entity.Property(e => e.CitiRejInd).HasColumnName("CITI_REJ_IND");
    
Claim Amount transaction model class :
    public decimal? ConvFnlPayAmt { get; set; }

    public string? BnkRefNbr { get; set; }
    public string? PaymentTrnsRefNbr { get; set; }

I tried few approaches but it was not working as expected. We want to remove the shadow property or if we can create how we can create it in 6.0

0

There are 0 best solutions below