Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed Id property to Identifier for AzureTable #669

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BaGet.Azure/Table/PackageEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PackageEntity()
{
}

public string Id { get; set; }
public string Identifier { get; set; }
public string NormalizedVersion { get; set; }
public string OriginalVersion { get; set; }
public string Authors { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/BaGet.Azure/Table/TableOperationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public TableOperation AddPackage(Package package)
PartitionKey = package.Id.ToLowerInvariant(),
RowKey = normalizedVersion.ToLowerInvariant(),

Id = package.Id,
Identifier = package.Id,
NormalizedVersion = normalizedVersion,
OriginalVersion = version.ToFullString(),
Authors = JsonConvert.SerializeObject(package.Authors),
Expand Down
2 changes: 1 addition & 1 deletion src/BaGet.Azure/Table/TablePackageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private Package AsPackage(PackageEntity entity)

return new Package
{
Id = entity.Id,
Id = entity.Identifier,
NormalizedVersionString = entity.NormalizedVersion,
OriginalVersionString = entity.OriginalVersion,

Expand Down
10 changes: 5 additions & 5 deletions src/BaGet.Azure/Table/TableSearchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ string GenerateIsFalse(string propertyName)
private string ToAutocompleteResult(IReadOnlyList<PackageEntity> packages)
{
// TODO: This should find the latest version and return its package Id.
return packages.Last().Id;
return packages.Last().Identifier;
}

private SearchResult ToSearchResult(IReadOnlyList<PackageEntity> packages)
Expand All @@ -218,7 +218,7 @@ private SearchResult ToSearchResult(IReadOnlyList<PackageEntity> packages)
totalDownloads += package.Downloads;
versions.Add(new SearchResultVersion
{
RegistrationLeafUrl = _url.GetRegistrationLeafUrl(package.Id, version),
RegistrationLeafUrl = _url.GetRegistrationLeafUrl(package.Identifier, version),
Version = package.NormalizedVersion,
Downloads = package.Downloads,
});
Expand All @@ -231,19 +231,19 @@ private SearchResult ToSearchResult(IReadOnlyList<PackageEntity> packages)
}

var iconUrl = latest.HasEmbeddedIcon
? _url.GetPackageIconDownloadUrl(latest.Id, latestVersion)
? _url.GetPackageIconDownloadUrl(latest.Identifier, latestVersion)
: latest.IconUrl;

return new SearchResult
{
PackageId = latest.Id,
PackageId = latest.Identifier,
Version = latest.NormalizedVersion,
Description = latest.Description,
Authors = JsonConvert.DeserializeObject<string[]>(latest.Authors),
IconUrl = iconUrl,
LicenseUrl = latest.LicenseUrl,
ProjectUrl = latest.ProjectUrl,
RegistrationIndexUrl = _url.GetRegistrationIndexUrl(latest.Id),
RegistrationIndexUrl = _url.GetRegistrationIndexUrl(latest.Identifier),
Summary = latest.Summary,
Tags = JsonConvert.DeserializeObject<string[]>(latest.Tags),
Title = latest.Title,
Expand Down