Activities of "Karunakar"

  • ABP Framework version: latest
  • UI Type: Angular
  • Database System: EF Core (MySQL.)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace: While trying to delete a record from context getting System.InvalidOperationException : The property 'Cusotmer.ExtraProperties' could not be found. Ensure that the property exists and has been included in the model.
  • Steps to reproduce the issue:
    1. Create and Entity by using AggregateRoot<Customer, Guid> and also have ISoftDelete interface.
    1. While model creation we igonred ExtraProperties and dont want this property in our table.
    1. try to delete(set isDelete=true) a record based on ISoftDelete by DeleteAsync method from repository using IRepository<> interface.
    1. Will get Exception System.InvalidOperationException : The property 'Cusotmer.ExtraProperties' could not be found. Ensure that the property exists and has been included in the model.
    1. We need the IsoftDelete needs to update the record filed IsDelete=0 without expecting the property ExtraProperties.

Note : While deleting we are using IHasDelettionTime interface for entity so that it will updating the DeletionTime filed but we need DeletorId like CreatorId while deleting the record to identity who deleted the record. *

private static void ConfigureVendor(ModelBuilder builder)
 {
     builder.Entity<Vendor>(b =>
     {
         // Get the entity type
         var entityType = typeof(Vendor);
         // Retrieve the Table attribute from the entity type
         var tableAttribute = entityType.GetCustomAttributes(typeof(TableAttribute), false)
                                        .Cast<TableAttribute>()
                                        .FirstOrDefault();

         // Extract the table name
         var tableName = tableAttribute?.Name ?? entityType.Name;

         //Configure table & schema name
         b.ToTable(tableName, VendorManagementDbProperties.DbSchema);

         b.ConfigureByConvention();
         b.Ignore(q => q.ExtraProperties);
         b.Ignore(q => q.Id);

         // Primary Key Configuration
         b.HasKey(v => v.VendorId);

         // Properties Configuration
         b.Property(v => v.FirstName)
             .HasMaxLength(VendorConsts.FirstNameLength)
             .IsRequired();

         b.Property(v => v.LastName)
             .HasMaxLength(VendorConsts.LastNameLength)
             .IsRequired();   
          
         b.Property(v => v.BillingAccountNumber)
             .HasMaxLength(VendorConsts.BillingAccountNumberLength);

         b.Property(v => v.Is1099)
             .IsRequired().HasDefaultValue(false);

         b.Property(v => v.IsW9OnFile)
             .IsRequired().HasDefaultValue(false);

         b.Property(v => v.Active)
             .IsRequired().HasDefaultValue(true);

         b.Property(q => q.CreatorId)
             .IsRequired();

         b.Property(q => q.CreationTime).HasDefaultValueSql("CURRENT_TIMESTAMP")
             .IsRequired();

         b.Property(q => q.IsDeleted)
             .HasDefaultValue(false);

         b.HasOne(v => v.AchInformation)
             .WithMany()  // Assuming a one-to-many relationship with AchInformation
             .HasForeignKey(v => v.ACHInfoId)
             .OnDelete(DeleteBehavior.SetNull);

         // Store the enum value as an integer in the database
         b.Property(v => v.TypeOfVendorId)
             .HasConversion<int>(); // This ensures EF Core treats the enum as an integer value in the database

     });
 }

this is my Entity

[Table("Vendor")]
public class Vendor : AggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator, IMultiTenant, ISoftDelete, IHasDeletionTime
{
    public Vendor()
    {
        Active = true;
        Is1099 = false;
        IsW9OnFile = false;
        IsDeleted = false;
    }
  
    [Key]
    public Guid VendorId { get; set; }
    [Required]
    [StringLength(VendorConsts.FirstNameLength, MinimumLength = VendorConsts.MinLength)]
    public string FirstName { get; set; }

    [Required]
    [StringLength(VendorConsts.LastNameLength, MinimumLength = VendorConsts.MinLength)]
    public string LastName { get; set; }

    [StringLength(VendorConsts.VendorNameLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? VendorName { get; set; }

   // public virtual int? TypeOfVendorId { get; set; }

    //Navigation Property to the VendorId entity
    [ForeignKey("TypeOfVendorId")]
    public virtual TypeOfVendors TypeOfVendorId { get; set; }  // Navigation property

    [StringLength(VendorConsts.DbaFsoNameLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? DbaFsoName { get; set; }

    [StringLength(VendorConsts.PayToNameLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? PayToName { get; set; }

    [StringLength(VendorConsts.VendorNumberLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? VendorNumber { get; set; }

    [StringLength(VendorConsts.SSN_FederalTaxIdLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? SSN_FederalTaxId { get; set; }

    [Required]
    public int TaxType { get; set; }

    [StringLength(VendorConsts.BillingAccountNumberLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? BillingAccountNumber { get; set; }

    public virtual Guid? PaymentTerm { get; set; }

    [Required]
    public bool Is1099 { get; set; }

    [Required]
    public bool IsW9OnFile { get; set; }

    public virtual int? TypeOf1099 { get; set; }

    public virtual Guid? ACHInfoId { get; set; }

    // Navigation Property to the VendorId entity
    [ForeignKey("ACHInfoId")]
    public virtual ACHInfo AchInformation { get; set; }  // Navigation property

    public bool Active { get; set; }

    public virtual Guid? DefaultJobIdProjectDivision { get; set; }

    public virtual Guid? DefaultGlAccount { get; set; }

    public virtual Guid? DefaultLineNumber { get; set; }

    public virtual Guid? DefaultSeries { get; set; }

    public virtual Guid? DefaultLocation { get; set; }

    public virtual Guid? DefaultSet { get; set; }

    public virtual Guid? DefaultInsRef { get; set; }

    public virtual Guid? DefaultFF1 { get; set; }

    public virtual Guid? DefaultFF2 { get; set; }

    public virtual Guid? DefaultFF3 { get; set; }

    public virtual Guid? DefaultFF4 { get; set; }

    public virtual Guid? Notes { get; set; }

    public virtual int? Currency { get; set; }

    public virtual Guid? AdvanceAccount { get; set; }

    public virtual Guid? PcardAdvanceAccount { get; set; }

    [StringLength(VendorConsts.StudioVendorNumberLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? StudioVendorNumber { get; set; }

    [StringLength(VendorConsts.CustomerNumberLength, MinimumLength = VendorConsts.MinLength)]
    public virtual string? CustomerNumber { get; set; }

    public virtual int? BusinessCategory { get; set; }

    [Required]
    public int Ethnicity { get; set; }
  
    [Required]
    public virtual bool IsThirdPartyVendor { get; set; }

    public virtual Guid? TenantId { get; set; }

    public virtual Guid CreatorId { get; set; }

    [Column(TypeName = "datetime")]
    public virtual DateTime CreationTime { get; set; }

    public bool IsDeleted { get; set; }

    public virtual Guid? DeletedByUser { get; set; }

    [Column(TypeName = "datetime")]
    public virtual DateTime? DeletionTime { get; set; }

    public Vendor(
        Guid vendorId, string firstName, string lastName, string? vendorName, TypeOfVendors typeOfVendorId,
        string? dbaFsoName, string? payToName, string? vendorNumber, string? sSN_FederalTaxId,
        int taxType, string? billingAccountNumber, Guid? paymentTerm,
        bool is1099, bool isW9OnFile, int? typeOf1099, Guid? aCHInfoId,
        bool active, Guid? defaultJobIdProjectDivision, Guid? defaultGlAccount,
        Guid? defaultLineNumber, Guid? defaultSeries, Guid? defaultLocation,
        Guid? defaultSet, Guid? defaultInsRef, Guid? defaultFF1, Guid? defaultFF2,
        Guid? defaultFF3, Guid? defaultFF4, Guid? notes, int? currency,
        Guid? advanceAccount, Guid? pcardAdvanceAccount, string? studioVendorNumber,
        string? customerNumber, int? businessCategory, int ethnicity,
        bool isThirdPartyVendor, Guid? tenantId, Guid creatorId,
        DateTime createDateTime, bool isDeleted, Guid? deletedByUser, DateTime? deletionTime)
    {
        VendorId = vendorId;
        FirstName = firstName;
        LastName = lastName;
        VendorName = vendorName;
        TypeOfVendorId = typeOfVendorId;
        DbaFsoName = dbaFsoName;
        PayToName = payToName;
        VendorNumber = vendorNumber;
        SSN_FederalTaxId = sSN_FederalTaxId;
        TaxType = taxType;
        BillingAccountNumber = billingAccountNumber;
        PaymentTerm = paymentTerm;
        Is1099 = is1099;
        IsW9OnFile = isW9OnFile;
        TypeOf1099 = typeOf1099;
        ACHInfoId = aCHInfoId;
        Active = active;
        DefaultJobIdProjectDivision = defaultJobIdProjectDivision;
        DefaultGlAccount = defaultGlAccount;
        DefaultLineNumber = defaultLineNumber;
        DefaultSeries = defaultSeries;
        DefaultLocation = defaultLocation;
        DefaultSet = defaultSet;
        DefaultInsRef = defaultInsRef;
        DefaultFF1 = defaultFF1;
        DefaultFF2 = defaultFF2;
        DefaultFF3 = defaultFF3;
        DefaultFF4 = defaultFF4;
        Notes = notes;
        Currency = currency;
        AdvanceAccount = advanceAccount;
        PcardAdvanceAccount = pcardAdvanceAccount;
        StudioVendorNumber = studioVendorNumber;
        CustomerNumber = customerNumber;
        BusinessCategory= businessCategory;
        Ethnicity = ethnicity;
        IsThirdPartyVendor = isThirdPartyVendor;
        TenantId = tenantId;
        CreatorId = creatorId;
        CreationTime = createDateTime;
        IsDeleted = isDeleted;
        DeletedByUser = deletedByUser;
        DeletionTime = deletionTime;
    }
}
public enum TypeOfVendors
{
    Standard,
    CreditCard,
    Pcard,
    Pc,
    TaxAgency,
    PayrollCompany,
    ShippingPartner,
    Pdecm,
    Director,
    SalesRep,
    Messenger,
    CarService,
    Phones,
    Bidder,
    ExecutiveProducer,
    DirectorOfPhotography,
    Producer

}

I will try by applying the above changes but what about DeletorId to update in DB for delete.

Hi Liangshiwei, I have tried with above code but the entire record is deleted instead softdelete(IsDelete=0).

 private readonly IVendorRepository _VendorRepository;
 public async Task DeleteAsync(Guid id)
 {
     await _VendorRepository.DeleteAsync(x=>x.VendorId == id);
 }

 public interface IVendorRepository : IRepository<Vendor, Guid>, ITransientDependency
 {
 }

Provide us with the following info: 🧐 Hint: If you are using the ABP Studio, you can see all the information about your solution from the configuration window, which opens when you right-click on the solution and click on the Solution Configuration button.

  • ABP Framework version: latest
  • UI Type: Angular
  • Database System: EF Core (MySQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes(micro services architecture with separate modules)
  • Exception message and full stack trace: Forbidden
  • Steps to reproduce the issue: While calling the remote api from another api appservice to appservice getting forbidden error.
  • I have a vendor enity with crud operations service in vendormodule and that is having list of addresses this address entity crud operations are in coreaccounting module.
  • after saving the vendor i need to save list of addresses belongs to this vendor while calling the address service saveall method in coreaccouning module getting forbidden error all the configgurations are made correctly.

Hi LiangShiwei,

In which project I need to install this package Vendor or CoreAccounting? I am calling method from vendor to core accounting. Also we have module and service projects separate, should I need to install in service or module?

added in both module and service projects but getting same error

Showing 11 to 20 of 26 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.2.0-preview. Updated on February 16, 2026, 07:42
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.