Exemplo n.º 1
0
 /// <summary>
 /// <see cref="IRepository{TEntity}"/>
 /// </summary>
 /// <param name="item"></param>
 public virtual void Modify(TEntity item)
 {
     if (item != null)
     {
         _unitOfWork.SetModified(item);
     }
 }
Exemplo n.º 2
0
 public virtual void Update(TEntity item)
 {
     if (item != null)
     {
         //this operation also attach item in object state manager
         _unitOfWork.SetModified(item);
     }
     else
     {
         //LoggerFactory.CreateLogger().Info(string.Format(Messages.info_CannotModifyNullEntity, typeof(TEntity)));
     }
 }
Exemplo n.º 3
0
 public virtual void Modify(TEntity item, int userId)
 {
     if (item != (TEntity)null)
     {
         _UnitOfWork.SetModified <TEntity, TId>(item);
     }
     else
     {
         LoggerFactory.CreateLog()
         .LogInfo("Messages.info_CannotRemoveNullEntity", typeof(TEntity).ToString());
     }
 }
Exemplo n.º 4
0
 public virtual void Update(T entity)
 {
     if (entity != (T)null)
     {
         _UnitOfWork.SetModified(entity);
     }
 }
Exemplo n.º 5
0
 public virtual void Modify(T item)
 {
     if (item != (T)null)
     {
         _unitOfWork.SetModified(item);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// <see cref="Domain.Core.IRepository{TEntity}"/>
 /// </summary>
 /// <param name="item"><see cref="Domain.Core.IRepository{TEntity}"/></param>
 public virtual void SetModified(TEntity item)
 {
     if (item == (TEntity)null)
     {
         throw new ArgumentNullException(typeof(TEntity).ToString(), Messages.CannotRemoveNullEntity);
     }
     unitOfWork.SetModified(item);
 }
Exemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 public virtual void Update(T item)
 {
     if (item != null)
     {
         unitOfWork.SetModified(item);
         unitOfWork.Commit();
     }
 }
Exemplo n.º 8
0
        public virtual void Modify(TEntity item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            _unitOfWork.SetModified(item);
        }
Exemplo n.º 9
0
        public void Update(T entity)
        {
            if (entity == null)
            {
                return;
            }
            _unitOfWork.SetModified(entity);

            _unitOfWork.Commit();
        }
Exemplo n.º 10
0
 public virtual void Modify(TEntity item)
 {
     if (item != (TEntity)null)
     {
         _UnitOfWork.SetModified(item);
     }
     else
     {
         ExceptionManager.GenerarAppExcepcionGeneral(Messages.info_CannotModifyNullEntity);
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// <see cref="MyCompany.Common.Data.Seedwork.IRepository{TValueObject}"/>
 /// </summary>
 /// <param name="item"><see cref="MyCompany.Common.Data.Seedwork.IRepository{TValueObject}"/></param>
 public virtual void Modify(TEntity item)
 {
     if (item != (TEntity)null)
     {
         _UnitOfWork.SetModified(item);
     }
     else
     {
         TraceManager.TraceInfo(Messages.info_CannotRemoveNullEntity, typeof(TEntity).ToString());
     }
 }
Exemplo n.º 12
0
 public void Modify(T item)
 {
     if (item != (T)null)
     {
         _unitOfWork.SetModified <T>(item);
     }
     else
     {
         LoggerFactory.CreateLog().LogInfo(Message.info_CannotModifyNullEntity, typeof(T).ToString());
     }
 }
Exemplo n.º 13
0
 public virtual void Modify(TEntity item)
 {
     if (item != (TEntity)null)
     {
         _UnitOfWork.SetModified(item);
     }
     else
     {
         _logger.LogInformation(LocalizationFactory.CreateLocalResources().GetStringResource(LocalizationKeys.Infrastructure.info_CannotModifyNullEntity), typeof(TEntity).ToString());
     }
 }
Exemplo n.º 14
0
 /// <summary>
 ///    <see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}" />
 /// </summary>
 /// <param name="item">
 ///    <see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}" />
 /// </param>
 public virtual void Modify(TEntity item)
 {
     if (item != (TEntity)null)
     {
         _unitOfWork.SetModified(item);
     }
     else
     {
         LoggerFactory.CreateLog().LogInfo(Messages.info_CannotRemoveNullEntity, typeof(TEntity).ToString());
     }
 }
Exemplo n.º 15
0
 /// <summary>
 /// <see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}"/>
 /// </summary>
 /// <param name="item"><see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}"/></param>
 public virtual void Modify(TEntity item)
 {
     if (item != (TEntity)null)
     {
         _UnitOfWork.SetModified(item);
     }
     else
     {
         LoggerFactory.CreateLog()
         .LogInfo(Messages.info_NaoPodeRemoverEntidadeNula, typeof(TEntity).ToString());
     }
 }
        /// <summary>
        /// <see cref="Acv2.SharedKernel.Interfaces.ISharedRepository{TValueObject}"/>
        /// </summary>
        /// <param name="entity"><see cref="Acv2.SharedKernel.Interfaces.ISharedRepository{TValueObject}"/></param>
        public void Modify(TEntity entity)
        {
            if (entity != (TEntity)null)
            {
                _UnitOfWork.SetModified(entity);
            }

            else
            {
                LoggerFactory.CreateLog()
                .LogInfo(Messages.info_CannotRemoveNullEntity, typeof(TEntity).ToString());
            }
        }
Exemplo n.º 17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 public virtual void Modify(T item)
 {
     if (item != (T)null)
     {
         //_UnitOfWork.Attach(item);
         _UnitOfWork.SetModified(item);
     }
     else
     {
         LoggerFactory.CreateLog()
         .LogInfo("Message.info_CannotRemoveNullEntity", typeof(T).ToString());
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// <see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}"/>
 /// </summary>
 /// <param name="item"><see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}"/></param>
 public virtual void Modify(TEntity item)
 {
     if (item != (TEntity)null)
     {
         _UnitOfWork.SetModified(item);
         _UnitOfWork.Commit();
     }
     else
     {
         //LoggerFactory.CreateLog()
         //          .LogInfo(Messages.info_CannotModifyNullEntity, typeof(TEntity).ToString());
     }
 }
        public virtual async Task <TEntity> SaveAsync(TEntity entity)
        {
            if (entity.IsTransient())
            {
                await GetSet().AddAsync(entity);
            }
            else
            {
                unitOfWork.SetModified(entity);
            }

            return(await GetAsync(entity.Id));
        }
Exemplo n.º 20
0
 /// <summary>
 /// <see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}"/>
 /// </summary>
 /// <param name="item"><see cref="Microsoft.Samples.NLayerApp.Domain.Seedwork.IRepository{TValueObject}"/></param>
 public virtual void Modify(TEntity item)
 {
     if (item != (TEntity)null)
     {
         _UnitOfWork.Attach(item);
         _UnitOfWork.SetModified(item);
     }
     else
     {
         LoggerFactory.CreateLog()
         .LogInfo("entity is null", typeof(TEntity).ToString());
     }
 }
Exemplo n.º 21
0
        public void Salvar(TEntity entity)
        {
            if (entity.Id == default)
            {
                GetSet().Add(entity);
            }
            else
            {
                UnitOfWork.SetModified(entity);
            }

            UnitOfWork.Commit();
        }
Exemplo n.º 22
0
 public virtual void Update(TEntity item)
 {
     //this operation also attach item in object state manager
     _unitOfWork.SetModified(item);
 }
Exemplo n.º 23
0
 public virtual void Alterar(TEntity item)
 {
     unitOfWork.SetModified <TEntity>(item);
 }