Open Closed

LastModifiedId is not updating from update method in database getting null in lastmodifiedID column #4671


User avatar
0
aliya created
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

13 Answer(s)
  • User Avatar
    0
    salih created
    Support Team .NET Developer

    Hi, can you share the project version and your entity class?

  • User Avatar
    0
    aliya created

    Project version net6.0 entity class--- for all entities its not working not any particular entity

  • User Avatar
    0
    salih created
    Support Team .NET Developer

    What is the base class of your classes?

  • User Avatar
    0
    aliya created

    FullAuditedAggregateRoot<Guid>

  • User Avatar
    0
    salih created
    Support Team .NET Developer

    Can you share the bas class of dbcontext?

  • User Avatar
    0
    salih created
    Support Team .NET Developer

    Is the LastModificationTime column null or data?

  • User Avatar
    0
    aliya created
    using System;
    using Volo.Abp.Auditing;
    
    namespace Volo.Abp.Domain.Entities.Auditing;
    
    /// <summary>
    /// Implements <see cref="IFullAuditedObject"/> to be a base class for full-audited aggregate roots.
    /// </summary>
    [Serializable]
    public abstract class FullAuditedAggregateRoot : AuditedAggregateRoot, IFullAuditedObject
    {
        /// <inheritdoc />
        public virtual bool IsDeleted { get; set; }
    
        /// <inheritdoc />
        public virtual Guid? DeleterId { get; set; }
    
        /// <inheritdoc />
        public virtual DateTime? DeletionTime { get; set; }
    }
    
    /// <summary>
    /// Implements <see cref="IFullAuditedObject"/> to be a base class for full-audited aggregate roots.
    /// </summary>
    /// <typeparam name="TKey">Type of the primary key of the entity</typeparam>
    [Serializable]
    public abstract class FullAuditedAggregateRoot<TKey> : AuditedAggregateRoot<TKey>, IFullAuditedObject
    {
        /// <inheritdoc />
        public virtual bool IsDeleted { get; set; }
    
        /// <inheritdoc />
        public virtual Guid? DeleterId { get; set; }
    
        /// <inheritdoc />
        public virtual DateTime? DeletionTime { get; set; }
    
        protected FullAuditedAggregateRoot()
        {
    
        }
    
        protected FullAuditedAggregateRoot(TKey id)
        : base(id)
        {
    
        }
    }
    
  • User Avatar
    0
    aliya created

    LastModificationTime is updating that is working as expected

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    How can we reproduce this in a template project?

  • User Avatar
    0
    aliya created

    Hi Could we connect for this issue on call

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I still need to reproduce the problem locally, Can you share some steps and code?

  • User Avatar
    0
    aliya created
    1. create a entity in Database.
    2. try to insert record in database.
    3. update that record by updating lastmodifierId.

    var operation = await _operationRepository.GetAsync(id); operation.LastModificationTime = DateTime.UtcNow; operation.LastModifierId = await _authorizationHelper.GetCurrentUserId(); ObjectMapper.Map(input, operation); operation = await _operationRepository.UpdateAsync(operation, autoSave: true); return ObjectMapper.Map<Operation, OperationDto>(operation);

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Do you mean the LastModifierId of operation is null after _operationRepository.UpdateAsync(operation, autoSave: true);?

    Can you share a template project? liming.ma@volosoft.com

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09