<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MetadataWorkspace in Entity Framework</title>
	<atom:link href="http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/</link>
	<description>Taking something that can&#039;t be done, and then doing it.</description>
	<lastBuildDate>Wed, 08 Feb 2012 15:02:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Claude</title>
		<link>http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/#comment-5439</link>
		<dc:creator>Claude</dc:creator>
		<pubDate>Wed, 23 Mar 2011 14:51:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/#comment-5439</guid>
		<description>Thanks a lot for this very nice blog. It helped a lot.
Metadata access is not that easy. 
When you want to find the PrimaryColumns of the ConceptualModel:
        /// 
        /// Returns the name of the primary key property of the entity. 
        /// 
        /// If there is no primary property, it returns null.
        /// If there is more than one primary key property, it returns null.
        /// 
        /// 
        /// The type of the entity
        /// The name of the primary-Key property
        public static string GetPrimaryKeyProperty()
        {
            var items = Worksapce.GetItems(DataSpace.CSpace);
            var itemX = items.Where(x =&gt; x.Name == typeof(T).Name).Single();
            if (itemX.KeyMembers.Count != 1)
            {
                return null;
            }
            return itemX.KeyMembers.Single().Name;
        }

If you want to learn the entity framework, see: www.testmaster.ch/EntityFramework.test</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this very nice blog. It helped a lot.<br />
Metadata access is not that easy.<br />
When you want to find the PrimaryColumns of the ConceptualModel:<br />
        ///<br />
        /// Returns the name of the primary key property of the entity.<br />
        ///<br />
        /// If there is no primary property, it returns null.<br />
        /// If there is more than one primary key property, it returns null.<br />
        ///<br />
        ///<br />
        /// The type of the entity<br />
        /// The name of the primary-Key property<br />
        public static string GetPrimaryKeyProperty()<br />
        {<br />
            var items = Worksapce.GetItems(DataSpace.CSpace);<br />
            var itemX = items.Where(x =&gt; x.Name == typeof(T).Name).Single();<br />
            if (itemX.KeyMembers.Count != 1)<br />
            {<br />
                return null;<br />
            }<br />
            return itemX.KeyMembers.Single().Name;<br />
        }</p>
<p>If you want to learn the entity framework, see: <a href="http://www.testmaster.ch/EntityFramework.test" rel="nofollow" target="_blank">http://www.testmaster.ch/EntityFramework.test</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cincura.net</title>
		<link>http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/#comment-1998</link>
		<dc:creator>cincura.net</dc:creator>
		<pubDate>Mon, 14 Sep 2009 19:54:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/#comment-1998</guid>
		<description>Well this isn&#039;t so easy. You have to realize, that the model you see is conceptual model and there&#039;s no 1:1 mapping to the shape of store (database). I.e. you can have a Car entity that&#039;s composed from two tables, i.e. Vehicle and Car (aka inheritance). 

I&#039;m not sure what this is good for. But yes, you should be able to get this information from MetadataWorkspace, and definitely from MSL file.</description>
		<content:encoded><![CDATA[<p>Well this isn&#8217;t so easy. You have to realize, that the model you see is conceptual model and there&#8217;s no 1:1 mapping to the shape of store (database). I.e. you can have a Car entity that&#8217;s composed from two tables, i.e. Vehicle and Car (aka inheritance). </p>
<p>I&#8217;m not sure what this is good for. But yes, you should be able to get this information from MetadataWorkspace, and definitely from MSL file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Y</title>
		<link>http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/#comment-1995</link>
		<dc:creator>Alex Y</dc:creator>
		<pubDate>Mon, 14 Sep 2009 19:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.cincura.net/230583-metadataworkspace-in-entity-framework/#comment-1995</guid>
		<description>Thanks for nice blog.

Let me know please if you know a way to retrieve the table name from the Entity.
For example I may have Entity named SupperCar but the actual table name it is mapped is Car.
 Do I need to use MetadataWorkspace and CS-Space? I heard that it is not supported yet.</description>
		<content:encoded><![CDATA[<p>Thanks for nice blog.</p>
<p>Let me know please if you know a way to retrieve the table name from the Entity.<br />
For example I may have Entity named SupperCar but the actual table name it is mapped is Car.<br />
 Do I need to use MetadataWorkspace and CS-Space? I heard that it is not supported yet.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

