Skip to content

Add metadata to resources #47

@hahn-kev

Description

@hahn-kev

Right now our RemoteResources only track the remoteId of the file in question.

public class RemoteResource: IObjectBase<RemoteResource>
{
public Guid Id { get; init; }
public DateTimeOffset? DeletedAt { get; set; }
/// <summary>
/// will be null when the resource has not been uploaded yet
/// </summary>
public string? RemoteId { get; set; }
public Guid[] GetReferences()
{
return [];
}
public void RemoveReference(Guid id, CommitBase commit)
{
}
public IObjectBase Copy()
{
return new RemoteResource
{
Id = Id,
RemoteId = RemoteId,
DeletedAt = DeletedAt
};
}
}

we would like to track metadata aswell, this could include stuff like author, copyright etc. For storing the data I think it should be unopinionated and just store a blob of json. We should use either a JsonDocument or JsonNode, I'm not sure which would be ideal, you can read about it here. https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/use-dom#json-dom-choices
Note that JsonDocument is IDisposable and would need to be disposed when done, that may not be possible to manage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions