SaveCopy() 공개 메소드

Saves a copy of the instance information to the database. May Create or Update the instance depending on whether it has a valid ID.
If within a SessionScope the operation is going to be on hold until NHibernate (or you) decides to flush the session.
public SaveCopy ( ) : object
리턴 object
예제 #1
0
 /// <summary>
 /// Saves a copy of instance to the database
 /// </summary>
 /// <param name="instance">The transient instance to be copied</param>
 /// <returns>The saved ActiveRecord instance</returns>
 public static object SaveCopy(object instance)
 {
     return(ActiveRecordBase.SaveCopy(instance));
 }
예제 #2
0
 /// <summary>
 /// Saves a copy of the instance to the database. If the primary key is unitialized
 /// it creates the instance on the database. Otherwise it updates it.
 /// <para>
 /// If the primary key is assigned, then you must invoke <see cref="Create"/>
 /// or <see cref="Update"/> instead.
 /// </para>
 /// </summary>
 /// <param name="instance">The transient instance to be saved</param>
 /// <returns>The saved ActiveRecord instance.</returns>
 protected internal static T SaveCopy(T instance)
 {
     return((T)ActiveRecordBase.SaveCopy(instance));
 }