| | | 1 | | using Snacks.Domain.Abstractions; |
| | | 2 | | |
| | | 3 | | namespace Snacks.Domain.Models; |
| | | 4 | | |
| | | 5 | | public class Address : IAddress |
| | | 6 | | { |
| | 252 | 7 | | public int Id { get; set;} = 0; |
| | 236 | 8 | | public string? Street { get; set; } = null; |
| | 228 | 9 | | public string? HouseNr { get; set; } = null; |
| | 230 | 10 | | public string? City { get; set; } = null; |
| | 228 | 11 | | public string? Zip { get; set; } = null; |
| | 228 | 12 | | public int CountryId { get; set; } = 0; |
| | 228 | 13 | | public double CoordinateLongitude { get; set; } = 0.0; |
| | 228 | 14 | | public double CoordinateLatitude { get; set; } = 0.0; |
| | | 15 | | |
| | 132 | 16 | | public Address() { } |
| | 60 | 17 | | public Address(int id, string street, string houseNr, string city, string zip, int countryId, double coordinateLongi |
| | 60 | 18 | | { |
| | 60 | 19 | | Id = id; |
| | 60 | 20 | | Street = street; |
| | 60 | 21 | | HouseNr = houseNr; |
| | 60 | 22 | | City = city; |
| | 60 | 23 | | Zip = zip; |
| | 60 | 24 | | CountryId = countryId; |
| | 60 | 25 | | CoordinateLongitude = coordinateLongitude; |
| | 60 | 26 | | CoordinateLatitude = coordinateLatitude; |
| | 60 | 27 | | } |
| | | 28 | | public override string ToString() |
| | 2 | 29 | | { |
| | 2 | 30 | | return $"Address(id:{Id}, Street:{Street}, HouseNr:{HouseNr}, City:{City}, Zip:{Zip}, CountryId:{CountryId}, Coo |
| | 2 | 31 | | } |
| | | 32 | | |
| | | 33 | | public int CompareTo(IAddress? other) |
| | 2 | 34 | | { |
| | 2 | 35 | | if (other == null) return 1; |
| | 2 | 36 | | return this.Id.CompareTo(other.Id); |
| | 2 | 37 | | } |
| | | 38 | | } |