Skip to content

Commit

Permalink
(#438) events: udpate document infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintAngeLs committed Oct 27, 2024
1 parent d7cd309 commit d2eefad
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand All @@ -17,6 +17,8 @@ public class AddressDocument
public string City { get; set; }
public string ZipCode { get; set; }
public string Country { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }

public static AddressDocument FromEntity(Address address)
{
Expand All @@ -28,13 +30,15 @@ public static AddressDocument FromEntity(Address address)
ApartmentNumber = address.ApartmentNumber,
City = address.City,
ZipCode = address.ZipCode,
Country = address.Country
Country = address.Country,
Latitude = address.Latitude,
Longitude = address.Longitude
};
}

public Address ToEntity()
{
return new Address(BuildingName, Street, BuildingNumber, ApartmentNumber, City, ZipCode, Country);
return new Address(BuildingName, Street, BuildingNumber, ApartmentNumber, City, ZipCode, Country, Latitude, Longitude);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ public static AddressDto AsDto(this Address address)
ApartmentNumber = address.ApartmentNumber,
City = address.City,
ZipCode = address.ZipCode,
Country = address.Country
Country = address.Country,
Latitude = address.Latitude,
Longitude = address.Longitude
};
}


public static EventSettingsDto AsDto(this EventSettings settings)
{
return new EventSettingsDto(settings);
Expand Down Expand Up @@ -181,8 +184,18 @@ public static AddressDto AsDto(this AddressDocument document)
};

public static Address AsEntity(this AddressDocument document)
=> new (document.BuildingName, document.Street, document.BuildingNumber,
document.ApartmentNumber, document.City, document.ZipCode, document.Country);
=> new Address(
document.BuildingName,
document.Street,
document.BuildingNumber,
document.ApartmentNumber,
document.City,
document.ZipCode,
document.Country,
document.Latitude,
document.Longitude
);


public static OrganizerDto AsDto(this OrganizerDocument document)
=> new ()
Expand Down

0 comments on commit d2eefad

Please sign in to comment.