Castle.ActiveRecord.ActiveRecordBase.SaveCopyAndFlush C# (CSharp) Method

SaveCopyAndFlush() protected static method

Saves a copy of the instance to the database and flushes the session. If the primary key is unitialized it creates the instance on the database. Otherwise it updates it.

If the primary key is assigned, then you must invoke Create() or Update() instead.

protected static SaveCopyAndFlush ( object instance ) : object
instance object The transient instance to be saved
return object
        protected internal static object SaveCopyAndFlush(object instance)
        {
            return InternalSaveCopy(instance, true);
        }

Same methods

ActiveRecordBase::SaveCopyAndFlush ( ) : object

Usage Example

Esempio n. 1
0
 /// <summary>
 /// Saves a copy of the instance to the database and flushes the session. If the primary key is uninitialized
 /// it creates the instance in the database. Otherwise it updates it.
 /// <para>
 /// If the primary key is assigned, then you must invoke <see cref="Create(object)"/>
 /// or <see cref="Update(object)"/> instead.
 /// </para>
 /// </summary>
 /// <param name="instance">The transient instance to be copied</param>
 /// <returns>The saved ActiveRecord instance</returns>
 public static object SaveCopyAndFlush(object instance)
 {
     return(ActiveRecordBase.SaveCopyAndFlush(instance));
 }