Code clean up
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
@@ -43,7 +42,7 @@ public partial class EquipmentViewModel : ViewModelBase
|
||||
Image = new ImageViewModel(equipment.Image ?? new Image());
|
||||
Properties = new ObservableCollection<PropertyViewModel>(equipment.Properties.Select(e => new PropertyViewModel(e)));
|
||||
|
||||
List<DateTime[]> times = (equipment.Inspections.Select(e => new InspectionViewModel(e)))
|
||||
var times = equipment.Inspections.Select(e => new InspectionViewModel(e))
|
||||
.Select(e => e.GetNearestDates())
|
||||
.ToList();
|
||||
|
||||
@@ -62,12 +61,12 @@ public partial class EquipmentViewModel : ViewModelBase
|
||||
|
||||
public Equipment GetEquipment()
|
||||
{
|
||||
return new Equipment()
|
||||
return new Equipment
|
||||
{
|
||||
Name = Name,
|
||||
Description = Description,
|
||||
Image = Image?.GetImage(),
|
||||
Inspections = Inspections.Select(e => e.GetInspection()).ToList(),
|
||||
Inspections = Inspections.Select(e => e.GetInspection()).ToList()
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user