Entity Framwork 获取EDM中的实体名

            using (DemoEntities context = new DemoEntities ())
            {
                var entityName = context.MetadataWorkspace.GetEntityContainer(context.DefaultContainerName, DataSpace.CSpace).BaseEntitySets;
                foreach (var name in entityName)
                {
                    Console.WriteLine("entity name : {0}", name.Name);
                }
            }
 
080301 

 

posted @ 2010-08-03 10:55  i'm zjz  阅读(393)  评论(0编辑  收藏  举报