示例#1
0
        /// <summary>
        /// The persist updated item.
        /// </summary>
        /// <param name="entity">
        /// The entity.
        /// </param>
        protected override void PersistUpdatedItem(ICustomer entity)
        {
            ((Entity)entity).UpdatingEntity();

            var factory = new CustomerFactory();
            var dto     = factory.BuildDto(entity);

            Database.Update(dto);

            entity.ResetDirtyProperties();
        }
        /// <summary>
        /// The persist updated item.
        /// </summary>
        /// <param name="entity">
        /// The entity.
        /// </param>
        protected override void PersistUpdatedItem(ICustomer entity)
        {
            ((Entity)entity).UpdatingEntity();

            var factory = new CustomerFactory();
            var dto     = factory.BuildDto(entity);

            Database.Update(dto);

            entity.ResetDirtyProperties();

            // customer context cache
            RuntimeCache.ClearCacheItem(Cache.CacheKeys.CustomerCacheKey(entity.Key));
        }
示例#3
0
        /// <summary>
        /// The persist new item.
        /// </summary>
        /// <param name="entity">
        /// The entity.
        /// </param>
        protected override void PersistNewItem(ICustomer entity)
        {
            ((Customer)entity).AddingEntity();

            var factory = new CustomerFactory();
            var dto     = factory.BuildDto(entity);

            Database.Insert(dto);
            entity.Key = dto.Key;

            Database.Insert(dto.CustomerIndexDto);
            ((Customer)entity).ExamineId = dto.CustomerIndexDto.Id;

            entity.ResetDirtyProperties();
        }
        /// <summary>
        /// The persist new item.
        /// </summary>
        /// <param name="entity">
        /// The entity.
        /// </param>
        protected override void PersistNewItem(ICustomer entity)
        {
            ((Customer)entity).AddingEntity();

            var factory = new CustomerFactory();
            var dto     = factory.BuildDto(entity);

            Database.Insert(dto);
            entity.Key = dto.Key;

            Database.Insert(dto.CustomerIndexDto);
            ((Customer)entity).ExamineId = dto.CustomerIndexDto.Id;

            entity.ResetDirtyProperties();

            // customer context cache
            RuntimeCache.ClearCacheItem(Cache.CacheKeys.CustomerCacheKey(entity.Key));
        }