blob: 677055414fbaffbadf046d76dff1d7e35b6cc474 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tango.BL.Entities
{
public partial class HardwareVersion
{
public override HardwareVersion Clone()
{
var cloned = base.Clone();
cloned.HardwareMotors = HardwareMotors.Select(x => x.Clone()).ToObservableCollection();
cloned.HardwareDancers = HardwareDancers.Select(x => x.Clone()).ToObservableCollection();
cloned.HardwarePidControls = HardwarePidControls.Select(x => x.Clone()).ToObservableCollection();
cloned.HardwareWinders = HardwareWinders.Select(x => x.Clone()).ToObservableCollection();
cloned.HardwareSpeedSensors = HardwareSpeedSensors.Select(x => x.Clone()).ToObservableCollection();
cloned.HardwareBlowers = HardwareBlowers.Select(x => x.Clone()).ToObservableCollection();
cloned.HardwareBreakSensors = HardwareBreakSensors.Select(x => x.Clone()).ToObservableCollection();
return cloned;
}
public override void Delete(ObservablesContext context)
{
HardwareDancers.ToList().ForEach(x => x.DefferedDelete(context));
HardwareMotors.ToList().ForEach(x => x.DefferedDelete(context));
HardwarePidControls.ToList().ForEach(x => x.DefferedDelete(context));
HardwareWinders.ToList().ForEach(x => x.DefferedDelete(context));
HardwareSpeedSensors.ToList().ForEach(x => x.DefferedDelete(context));
HardwareBlowers.ToList().ForEach(x => x.DefferedDelete(context));
HardwareBreakSensors.ToList().ForEach(x => x.DefferedDelete(context));
base.Delete(context);
}
}
}
|