Getting the entity
IEntity entity = await _connector.Client.Entities.GetAsync(long.Parse(assetId));
assetId can be a string or a long. The string is mostly used when IDs look like an alphanumeric hash. If we want an image with asset Id of 99551 then use long.
Getting a relationship with an entity
IRelation relation = entity.GetRelation("AssetTypeToAsset");
IList<long> values = relation.GetIds();
//if (values.Count == 0) then we know there is no value set, otherwise there is already a value set for that relation
Setting up a related value
IEntity imageAssetEntity = await _connector.Client.Entities.GetAsync("M.AssetType.Custom");
IChildToOneParentRelation assetEntityRelation = await entity.GetRelationAsync<IChildToOneParentRelation>("AssetTypeToAsset");
assetEntityRelation.Parent = imageAssetEntity.Id.Value;
//This will set up the selected asset entity's AssetType as Custom
Set a property for an entity
string alt = item["Alt"] ?? "";
ICultureInsensitiveProperty altProperty = entity.GetProperty<ICultureInsensitiveProperty>("Alt");
altProperty.SetValue(alt);
//This will get the Alt field value of an item from sitecore and update an asset with that value in the Alt property