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 dotnet-client-libraries/Firebase/Firebase/Models/Shoe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public class Shoe

public required decimal Price { get; set; }

public Uri ImageUri { get; set; } = default!;
public Uri? ImageUri { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private static Shoe ConvertDocumentToModel(ShoeDocument shoeDocument)
Name = shoeDocument.Name,
Brand = shoeDocument.Brand,
Price = decimal.Parse(shoeDocument.Price),
ImageUri = new Uri(shoeDocument.ImageUri)
ImageUri = string.IsNullOrEmpty(shoeDocument.ImageUri) ? null : new Uri(shoeDocument.ImageUri)
};
}

Expand All @@ -54,7 +54,7 @@ private static ShoeDocument ConvertModelToDocument(Shoe shoe)
Name = shoe.Name,
Brand = shoe.Brand,
Price = shoe.Price.ToString(),
ImageUri = shoe.ImageUri.ToString()
ImageUri = shoe.ImageUri?.ToString() ?? string.Empty
};
}
}
Loading