private void SetDatabaseVersion() { var systemInfo = SystemInfo.FirstOrDefault() ?? new SystemInfoEntity(); systemInfo.DatabaseVersion = DatabaseVersion; AttachCopy(systemInfo); SaveChanges(); }
public static (string ExecutablePath, string CommandLine) GetCommandLine(this Process thisValue) { if (!IsAwaitable(thisValue)) { return(null, null); } SystemInfoRequest request = new SystemInfoRequest(SystemInfoType.Win32_Process) { SelectExpression = "ProcessId, ExecutablePath, CommandLine", Filter = e => Convert.ToInt32(e["ProcessId"]) == thisValue.Id }; ManagementObject mo = SystemInfo.FirstOrDefault(request); return(mo == null ? (null, null) : ((string)mo["ExecutablePath"], (string)mo["CommandLine"])); }