コード例 #1
0
        /// <summary>
        /// Updates an existing item in the database.
        /// </summary>
        /// <param name="entity">
        /// The entity.
        /// </param>
        protected override void PersistUpdatedItem(IPayment entity)
        {
            ((Entity)entity).UpdatingEntity();

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

            Database.Update(dto);

            entity.ResetDirtyProperties();
        }
コード例 #2
0
        /// <summary>
        /// Saves a new item to the database.
        /// </summary>
        /// <param name="entity">
        /// The entity.
        /// </param>
        protected override void PersistNewItem(IPayment entity)
        {
            ((Entity)entity).AddingEntity();

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

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