public virtual List <MetadataReference> GetReferences() { var provider = new MetadataReferencesProvider(); NamedReferences.ForEach(name => provider.AddReferenceFromName(name)); References.ForEach(r => provider.Add(r)); return(provider.GetApplicationReferences()); }
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 }
public virtual void AddReferencesForTemplates(MetadataReferencesProvider metadataReferencesProvider) { metadataReferencesProvider.AddReferenceFromName("EntityFramework.SqlServer.Design"); }