public RepositoryKey(IRepository repository, ObjectKey key) : base(key.RecordId, $"{repository.Name}:{key.FullKey}") { if (key == null) { throw new ArgumentNullException(nameof(key)); } Repository = repository; }
private SimpleKey(string repository, ObjectKey objectKey) : base(objectKey.RecordId, repository + ":" + objectKey.FullKey) { if (string.IsNullOrEmpty(repository)) { throw new ArgumentException("Value cannot be null or empty.", nameof(repository)); } ObjectKey = objectKey; }
public static SimpleKey GenerateKey(string repository, string objectName) { if (string.IsNullOrEmpty(repository)) { throw new ArgumentException("Value cannot be null or empty.", nameof(repository)); } if (string.IsNullOrEmpty(objectName)) { throw new ArgumentException("Value cannot be null or empty.", nameof(objectName)); } var objectKey = new ObjectKey(objectName); return(new SimpleKey(repository, objectKey)); }