Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/LinkAce.NET/Entites/Link.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Link
/// <summary>
/// Gets or sets the tags associated with the link.
/// </summary>
public string[]? Tags { get; set; }
public Tag[]? Tags { get; set; }
/// <summary>
/// Gets or sets the title of the link.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions src/LinkAce.NET/Entites/Pivot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using JetBrains.Annotations;

namespace LinkAce.NET.Entites;

[PublicAPI]
public class Pivot
{
public int LinkId { get; set; }
public int TagId { get; set; }
}
21 changes: 21 additions & 0 deletions src/LinkAce.NET/Entites/Tag.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using JetBrains.Annotations;

namespace LinkAce.NET.Entites;

[PublicAPI]
public class Tag
{
public DateTime CreatedAt { get; set; }
public DateTime? DeletedAt { get; set; }
public int Id { get; set; }
public bool IsPrivate { get; set; }
public string Name { get; set; }
public Pivot Pivot { get; set; }
public DateTime UpdatedAt { get; set; }
public int UserId { get; set; }

public static implicit operator Tag(string v)
{
return new Tag { Name = v };
}
}
9 changes: 9 additions & 0 deletions src/LinkAce.NET/Extensions/StringArrayExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using LinkAce.NET.Entites;

namespace LinkAce.NET.Extensions;

public static class StringArrayExtensions
{
public static Tag[] ToTagArray(this string[] tags)
=> tags.Select(t => new Tag { Name = t }).ToArray();
}