예제 #1
0
        /// <summary>
        /// Gets the EDMX Document ProjectItem as a EdmxDocument type.
        /// </summary>
        /// <param name="edmxProjectItem">EDMX Document ProjectItem source.</param>
        /// <returns></returns>
        public static EdmxDocument GetEdmxDocument(ProjectItem edmxProjectItem)
        {
            // Get EDMX full file path (key for dictionary)
            string edmxFilePath = edmxProjectItem.Properties.Item(Resources.ProjectItem_FullPath).Value.ToString();

            if (EdmxHelper.EdmxDocuments.ContainsKey(edmxFilePath) == false)
            {
                // Load EDMX Document and add it to dictionary
                EdmxHelper.EdmxDocuments.Add(edmxFilePath, EdmxDocument.LoadEdmx(edmxFilePath));
            }

            // Return EDMX Document
            return(EdmxHelper.EdmxDocuments[edmxFilePath]);
        }
예제 #2
0
 /// <summary>
 /// Gets the Entity Type nodes from an EDMX Document.
 /// </summary>
 /// <param name="edmxDocument">EDMX Document source.</param>
 /// <returns></returns>
 public static IEnumerable <XElement> GetEntityTypeNodes(EdmxDocument edmxDocument)
 {
     return(edmxDocument.DescendantsCSDL(EdmxNodes.EntityType));
 }
예제 #3
0
 /// <summary>
 /// Gets the Association nodes from an EDMX Document.
 /// </summary>
 /// <param name="edmxDocument">EDMX Document source.</param>
 /// <returns></returns>
 public static IEnumerable <XElement> GetAssociationNodes(EdmxDocument edmxDocument)
 {
     return(edmxDocument.DescendantsCSDL(EdmxNodes.Association));
 }
예제 #4
0
 /// <summary>
 /// Gets the Navigation Property nodes from an EDMX Document.
 /// </summary>
 /// <param name="edmxDocument">EDMX Document source.</param>
 /// <returns></returns>
 public static IEnumerable <XElement> GetNavigationPropertyNodes(EdmxDocument edmxDocument)
 {
     return(edmxDocument.DescendantsCSDL(EdmxNodes.NavigationProperty));
 }