Beispiel #1
0
        private DeviceInfoViewModel Copy(Guid pId)
        {
            var itemCopy = _deviceInfo.Clone() as DeviceInfo;

            if (itemCopy != null)
            {
                itemCopy.parentId    = pId;
                itemCopy.DeviceGroup = DeviceContext.Instance.DeviceGroups.Find(pId);
            }
            DeviceContext.Instance.DeviceInfos.AddOrUpdate(itemCopy);
            DeviceContext.Instance.SaveChanges();
            return(new DeviceInfoViewModel(itemCopy));
        }