コード例 #1
0
        public virtual List <MetadataReference> GetReferences()
        {
            var provider = new MetadataReferencesProvider();

            NamedReferences.ForEach(name => provider.AddReferenceFromName(name));
            References.ForEach(r => provider.Add(r));
            return(provider.GetApplicationReferences());
        }
コード例 #2
0
        private List <MetadataReference> SetupMetadataReferencesForCompilationOfGeneratedCode(
            MetadataReferencesProvider metadataReferencesProvider)
        {
            metadataReferencesProvider.AddReferenceFromName("EntityFramework.Core");
            metadataReferencesProvider.AddReferenceFromName("EntityFramework.Relational");
            metadataReferencesProvider.AddReferenceFromName("EntityFramework.SqlServer");

#if DNXCORE50 || NETCORE50
            metadataReferencesProvider.AddReferenceFromName("System.Data.Common");
            metadataReferencesProvider.AddReferenceFromName("System.Linq.Expressions");
            metadataReferencesProvider.AddReferenceFromName("System.Reflection");

            return(metadataReferencesProvider.GetApplicationReferences());
#else
            var metadataReferences = metadataReferencesProvider.GetApplicationReferences();
            metadataReferences.Add(MetadataReference.CreateFromFile(
                                       Assembly.Load(new AssemblyName(
                                                         "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")).Location));

            return(metadataReferences);
#endif
        }
コード例 #3
0
 public virtual void AddReferencesForTemplates(MetadataReferencesProvider metadataReferencesProvider)
 {
     metadataReferencesProvider.AddReferenceFromName("EntityFramework.SqlServer.Design");
 }