internal static IEnumerable <string> GetAssembliesToReference(EntityModelSchema model, IProgrammingLanguageStrategy language) { if (language.LanguageName != "VB") { yield return("mscorlib.dll"); } yield return("System.dll"); yield return("System.Core.dll"); yield return(DataFxAssemblyRef.File.DataServicesClient); yield return(DataFxAssemblyRef.File.ODataLib); yield return(DataFxAssemblyRef.File.EntityDataModel); if (model.HasSpatialFeatures()) { yield return(DataFxAssemblyRef.File.SpatialCore); } yield return("Microsoft.Test.Taupo.dll"); yield return("Microsoft.Test.Taupo.Astoria.dll"); yield return("Microsoft.Test.Taupo.Query.dll"); }
/// <summary> /// Gets the reference assemblies needed to compile a client for the given model and language /// </summary> /// <param name="model">The model being generated</param> /// <param name="language">The current language</param> /// <returns>The list of reference assemblies</returns> internal static IEnumerable <string> GetClientReferenceAssemblies(EntityModelSchema model, IProgrammingLanguageStrategy language) { bool isVB = language.LanguageName == "VB"; IEnumerable <string> languageSpecificReferences = isVB ? referenceAssemblies.Where(l => l != "mscorlib.dll") : referenceAssemblies; if (model.HasSpatialFeatures()) { languageSpecificReferences = languageSpecificReferences.Concat(DataFxAssemblyRef.File.SpatialCore); } return(languageSpecificReferences); }
internal static IEnumerable <string> GetNamespacesToImport(EntityModelSchema model) { yield return("System"); yield return("System.Collections.Generic"); yield return("System.Collections.ObjectModel"); yield return("Microsoft.OData.Client"); yield return("System.Linq"); yield return(typeof(AsyncHelpers).Namespace); yield return(typeof(ClientQueryExtensionMethods).Namespace); if (model.HasSpatialFeatures()) { // needed for extension methods for distance, etc. yield return("Microsoft.Spatial"); } }