private static void SetNodeRow(DataRow row, NodeHeadData node, MsSqlDataProvider dataProvider) { row["NodeId"] = node.NodeId; row["NodeTypeId"] = node.NodeTypeId; row["CreatingInProgress"] = node.CreatingInProgress ? Yes : No; row["IsDeleted"] = node.IsDeleted ? Yes : No; row["IsInherited"] = (byte)0; row["ParentNodeId"] = node.ParentNodeId; row["Name"] = node.Name; row["Path"] = node.Path; row["Index"] = node.Index; row["Locked"] = node.Locked ? Yes : No; row["ETag"] = node.ETag ?? string.Empty; row["LockType"] = node.LockType; row["LockTimeout"] = node.LockTimeout; row["LockDate"] = AlignDateTime(node.LockDate, dataProvider); row["LockToken"] = node.LockToken ?? string.Empty; row["LastLockUpdate"] = AlignDateTime(node.LastLockUpdate, dataProvider); row["LastMinorVersionId"] = node.LastMinorVersionId; row["LastMajorVersionId"] = node.LastMajorVersionId; row["CreationDate"] = AlignDateTime(node.CreationDate, dataProvider); row["CreatedById"] = node.CreatedById; row["ModificationDate"] = AlignDateTime(node.ModificationDate, dataProvider); row["ModifiedById"] = node.ModifiedById; row["IsSystem"] = node.IsSystem ? Yes : No; row["OwnerId"] = node.OwnerId; row["SavingState"] = node.SavingState; }
public Task <NodeHeadData> GetNodeHeadDataAsync(int nodeId) { lock (DB) { var nodeDoc = DB.Nodes.FirstOrDefault(x => x.NodeId == nodeId); if (nodeDoc == null) { return(Task.FromResult((NodeHeadData)null)); } var result = new NodeHeadData { NodeId = nodeDoc.NodeId, NodeTypeId = nodeDoc.NodeTypeId, ContentListTypeId = nodeDoc.ContentListTypeId, ContentListId = nodeDoc.ContentListId, CreatingInProgress = nodeDoc.CreatingInProgress, IsDeleted = nodeDoc.IsDeleted, ParentNodeId = nodeDoc.ParentNodeId, Name = nodeDoc.Name, DisplayName = nodeDoc.DisplayName, Path = nodeDoc.Path, Index = nodeDoc.Index, Locked = nodeDoc.Locked, LockedById = nodeDoc.LockedById, ETag = nodeDoc.ETag, LockType = nodeDoc.LockType, LockTimeout = nodeDoc.LockTimeout, LockDate = nodeDoc.LockDate, LockToken = nodeDoc.LockToken, LastLockUpdate = nodeDoc.LastLockUpdate, LastMinorVersionId = nodeDoc.LastMinorVersionId, LastMajorVersionId = nodeDoc.LastMajorVersionId, CreationDate = nodeDoc.CreationDate, CreatedById = nodeDoc.CreatedById, ModificationDate = nodeDoc.ModificationDate, ModifiedById = nodeDoc.ModifiedById, IsSystem = nodeDoc.IsSystem, OwnerId = nodeDoc.OwnerId, SavingState = nodeDoc.SavingState, Timestamp = nodeDoc.Timestamp, }; return(Task.FromResult(result)); } }