aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Frederiksen <mikk9996@edu.easj.dk>2017-05-14 20:18:57 +0200
committerMikkel Frederiksen <mikk9996@edu.easj.dk>2017-05-14 20:18:57 +0200
commit82cfa39dd0abdf1d25255bd3d9f6fbb35477a37c (patch)
treec9e3ef3c6422b0d71bc08b84c1eda3e0f867fd07
parent4958bbf115a9a06267fc8df6490c91e69b02cb68 (diff)
made the ToString method in Apartment.cs to an interpolated string
-rw-r--r--ApartmentManager/ApartmentManager/Model/Apartment.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/ApartmentManager/ApartmentManager/Model/Apartment.cs b/ApartmentManager/ApartmentManager/Model/Apartment.cs
index c5754a9..92f1501 100644
--- a/ApartmentManager/ApartmentManager/Model/Apartment.cs
+++ b/ApartmentManager/ApartmentManager/Model/Apartment.cs
@@ -30,11 +30,19 @@ namespace ApartmentManager.Model
}
+ //public override string ToString()
+ //{
+ // return string.Format(
+ // "Apartment No: {0} Size: {1} NoOfRooms: {2} MonthlyCharge: {3} Floor: {4} Address: {5}",
+ // ApartmentNumber, Size, NumberOfRooms, MonthlyCharge, Floor, Address);
+ //}
+
public override string ToString()
{
return string.Format(
- "Apartment No: {0} Size: {1} NoOfRooms: {2} MonthlyCharge: {3} Floor: {4} Address: {5}",
- ApartmentNumber, Size, NumberOfRooms, MonthlyCharge, Floor, Address);
+ $"Apartment No: {ApartmentNumber} Size: {Size} NoOfRooms: {NumberOfRooms}" +
+ $" MonthlyCharge: {MonthlyCharge} Floor: {Floor} Address {Address}"
+ );
}
}
}