/// <summary> /// This method adds the component to the database /// Overwrites the component if a component with the uid already exists. /// </summary> /// <param name="component">The component to add</param> /// <returns></returns> public async Task CreateNewComponent(HardwareComponent component) { if (Components != null) { if (!Components.ContainsKey(component.componentUid)) { Components.Add(component.componentUid, component); await Model.AddComponent(component); } else { Components.Remove(component.componentUid); Components.Add(component.componentUid, component); await Model.UpdateHardwareComponent(component); } } else { Components = new Dictionary <string, HardwareComponent> { { component.componentUid, component } }; await Model.AddComponent(component); } }
public async Task UpdateComponent(HardwareComponent component) { throw new NotImplementedException(); }