/// <summary>
        /// Creates the resources by name for the model.
        /// </summary>
        /// <param name="resourceModel"></param>
        /// <returns></returns>
        private Dictionary <FullName, ProfileResourceContentTypes> CreateResourceByName(ResourceModel resourceModel)
        {
            var resourceElts = _profileDefinition.Elements("Resource");

            var resources = new Dictionary <FullName, ProfileResourceContentTypes>();

            resourceElts.ForEach(
                resourceElt =>
            {
                string resourceName = resourceElt.AttributeValue("name");

                string logicalName = resourceElt.Attributes()
                                     .SingleOrDefault(x => x.Name == "logicalSchema")
                                     ?.Value ?? EdFiConventions.LogicalName;

                var physicalName = resourceModel.SchemaNameMapProvider
                                   ?.GetSchemaMapByLogicalName(logicalName)
                                   .PhysicalName
                                   ?? EdFiConventions.PhysicalSchemaName;

                // Use the direct/default resource selector on the resource model because we need the main resource, not the contextual one
                var fullName       = new FullName(physicalName, resourceName);
                var sourceResource = ResourceModel.DefaultResourceSelector.GetByName(fullName);

                resources[fullName] = new ProfileResourceContentTypes(sourceResource, resourceElt);
            });

            return(resources);
        }
        public Resource GetResourceByName(FullName resourceName)
        {
            ProfileResourceContentTypes types =
                ResourceByName.FirstOrDefault(
                    resourceEntry => resourceEntry.Key == resourceName)
                .Value;

            return(types.Readable ?? types.Writable);
        }