public void SaveObject(IFileTransmissionObject obj) {
if (obj == null) {
throw new ArgumentNullException("obj");
}
if (obj.LocalPath == null) {
throw new ArgumentNullException("obj.LocalPath");
}
if (string.IsNullOrEmpty(obj.LocalPath)) {
throw new ArgumentException("empty string", "obj.LocalPath");
}
if (obj.RemoteObjectId == null) {
throw new ArgumentNullException("obj.RemoteObjectId");
}
if (string.IsNullOrEmpty(obj.RemoteObjectId)) {
throw new ArgumentException("empty string", "obj.RemoteObjectId");
}
if (!(obj is FileTransmissionObject)) {
throw new ArgumentException("require FileTransmissionObject type", "obj");
}
using (var tran = this.engine.GetTransaction()) {
tran.Insert<string, DbCustomSerializer<FileTransmissionObject>>(FileTransmissionObjectsTable, obj.RemoteObjectId, obj as FileTransmissionObject);
tran.Commit();
}
}