public static Room AddTherapyPlace(this Room room, TherapyPlace newTherapyPlace) { var newTherapyPlaceList = room.TherapyPlaces.Append(newTherapyPlace); return(new Room(room.Id, room.Name, newTherapyPlaceList, room.DisplayedColor)); }
public static Room UpdateTherapyPlace(this Room room, TherapyPlace updatedTherapyPlace) { var oldTherapyPlaceList = room.TherapyPlaces.ToList(); var newTherapyPlaceList = new List <TherapyPlace>(); foreach (var therapyPlace in oldTherapyPlaceList) { if (therapyPlace.Id != updatedTherapyPlace.Id) { newTherapyPlaceList.Add(therapyPlace); } else { newTherapyPlaceList.Add(updatedTherapyPlace); } } return(new Room(room.Id, room.Name, newTherapyPlaceList, room.DisplayedColor)); }
public static TherapyPlace SetNewType(this TherapyPlace therapyPlace, Guid newTherapyPlaceTypeId) { return(new TherapyPlace(therapyPlace.Id, newTherapyPlaceTypeId, therapyPlace.Name)); }
public static TherapyPlace SetNewName(this TherapyPlace therapyPlace, string newName) { return(new TherapyPlace(therapyPlace.Id, therapyPlace.TypeId, newName)); }