CmisSync.Lib.Storage.Database.MetaDataStorage.GetObjectByRemoteId C# (CSharp) Méthode

GetObjectByRemoteId() public méthode

Gets the object by remote identifier.
public GetObjectByRemoteId ( string id ) : IMappedObject
id string /// CMIS Object Id. ///
Résultat IMappedObject
        public IMappedObject GetObjectByRemoteId(string id) {
            using(var tran = this.engine.GetTransaction()) {
                DbCustomSerializer<MappedObject> value = tran.Select<string, DbCustomSerializer<MappedObject>>(MappedObjectsTable, id).Value;
                if (value != null) {
                    MappedObject data = value.Get;

                    if (data == null) {
                        return null;
                    }

                    return new MappedObject(data);
                }

                return null;
            }
        }

Usage Example

 public void GetObjectByIdWithNotExistingIdMustReturnNull([Values(true, false)]bool withValidation) {
     var storage = new MetaDataStorage(this.engine, this.matcher, withValidation);
     Assert.That(storage.GetObjectByRemoteId("DOESNOTEXIST"), Is.Null);
 }
All Usage Examples Of CmisSync.Lib.Storage.Database.MetaDataStorage::GetObjectByRemoteId