On Fri, Mar 28, 2008 at 2:58 PM, Ray Houston <ray.h...@gmail.com> wrote:
> You could do a ISession.Evict(entity) and then change the ID, then
> save it. It should insert a new record.
On Fri, Mar 28, 2008 at 2:53 PM, James Gregory <jagreg...@gmail.com> wrote:
There is always the BinaryFormatter cloning technique... but you’d still have to worry about managing your Ids
HTH,
Andrew
public T CloneObject<T>(T source) {
if (source == null) {
return default(T);
}
T value;
using (MemoryStream stream = new MemoryStream()) {
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, source);
stream.Seek(0, SeekOrigin.Begin);
value = (T) formatter.Deserialize(stream);
}
return value;
<br