From 82cfa39dd0abdf1d25255bd3d9f6fbb35477a37c Mon Sep 17 00:00:00 2001 From: Mikkel Frederiksen Date: Sun, 14 May 2017 20:18:57 +0200 Subject: made the ToString method in Apartment.cs to an interpolated string --- ApartmentManager/ApartmentManager/Model/Apartment.cs | 12 ++++++++++-- 1 file 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}" + ); } } } -- cgit v1.2.3