Skip to content

Commit

Permalink
Improved: connection readiness performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
yagasoft committed Apr 29, 2021
1 parent 77fdaa0 commit d94c94d
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 958 deletions.
8 changes: 5 additions & 3 deletions CrmCodeGenerator.VSPackage/AssemblyRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,10 @@ private void RefreshTypes(List<string> existingTypeNames)
UpdateStatus($"Refreshing '{className}' ... ");

Guid? typeId;

using (var context = new XrmServiceContext(GetConnection(ConnectionString)) { MergeOption = MergeOption.NoTracking })

var service = GetConnection(ConnectionString);

using (var context = new XrmServiceContext(service) { MergeOption = MergeOption.NoTracking })
{
typeId =
(from typeQ in context.PluginTypeSet
Expand All @@ -457,7 +459,7 @@ private void RefreshTypes(List<string> existingTypeNames)

UpdateStatus($"Refreshing type '{updatedType.Id}' ... ");

GetConnection(ConnectionString).Update(updatedType);
service.Update(updatedType);

UpdateStatus($"Finished refreshing '{className}'.");
});
Expand Down
23 changes: 10 additions & 13 deletions CrmCodeGenerator.VSPackage/CrmPluginRegExt.VSPackage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.25\lib\net462\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand All @@ -98,7 +98,7 @@
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.49\lib\net462\Microsoft.Rest.ClientRuntime.dll</HintPath>
<HintPath>..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.68\lib\net462\Microsoft.Rest.ClientRuntime.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ServiceBus, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAzure.ServiceBus.2.5.1.0\lib\net40-full\Microsoft.ServiceBus.dll</HintPath>
Expand Down Expand Up @@ -321,19 +321,20 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Xrm.Client, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Yagasoft.Libraries.EnhancedOrgService.5.1.3\lib\net462\Microsoft.Xrm.Client.dll</HintPath>
<HintPath>..\packages\Yagasoft.Libraries.EnhancedOrgService.5.3.2\lib\net462\Microsoft.Xrm.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.dll</HintPath>
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.25\lib\net462\Microsoft.Xrm.Sdk.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.Deployment.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll</HintPath>
<HintPath>..\packages\Microsoft.CrmSdk.Deployment.9.0.2.25\lib\net462\Microsoft.Xrm.Sdk.Deployment.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xrm.Sdk.Workflow, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.Workflow.9.0.2.26\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll</HintPath>
<HintPath>..\packages\Microsoft.CrmSdk.Workflow.9.0.2.25\lib\net462\Microsoft.Xrm.Sdk.Workflow.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xrm.Tooling.Connector, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.49\lib\net462\Microsoft.Xrm.Tooling.Connector.dll</HintPath>
<HintPath>..\packages\Microsoft.CrmSdk.XrmTooling.CoreAssembly.9.1.0.68\lib\net462\Microsoft.Xrm.Tooling.Connector.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -409,10 +410,10 @@
<Private>True</Private>
</Reference>
<Reference Include="Yagasoft.Libraries.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d99f90f6e31ed2df, processorArchitecture=MSIL">
<HintPath>..\packages\Yagasoft.Libraries.Common.2.4.3\lib\net462\Yagasoft.Libraries.Common.dll</HintPath>
<HintPath>..\packages\Yagasoft.Libraries.Common.2.4.5\lib\net462\Yagasoft.Libraries.Common.dll</HintPath>
</Reference>
<Reference Include="Yagasoft.Libraries.EnhancedOrgService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d99f90f6e31ed2df, processorArchitecture=MSIL">
<HintPath>..\packages\Yagasoft.Libraries.EnhancedOrgService.5.1.3\lib\net462\Yagasoft.Libraries.EnhancedOrgService.dll</HintPath>
<HintPath>..\packages\Yagasoft.Libraries.EnhancedOrgService.5.3.2\lib\net462\Yagasoft.Libraries.EnhancedOrgService.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand All @@ -438,7 +439,6 @@
<ItemGroup>
<Compile Include="AssemblyRegistration.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="deviceidmanager.cs" />
<Compile Include="Dialogs\Converters\BoolToVisibilityConverter.cs" />
<Compile Include="Dialogs\Login.xaml.cs">
<DependentUpon>Login.xaml</DependentUpon>
Expand All @@ -465,7 +465,6 @@
<Compile Include="Helpers\StreamEater.cs" />
<Compile Include="Helpers\ThreadingHelper.cs" />
<Compile Include="Helpers\WindowExtensions.cs" />
<Compile Include="MessageEventArgs.cs" />
<Compile Include="Model\CrmAssembly.cs" />
<Compile Include="Model\CrmEntity.cs" />
<Compile Include="Model\CrmStepImage.cs" />
Expand All @@ -476,8 +475,6 @@
<Compile Include="Model\Settings.cs" />
<Compile Include="Helpers\Helper.cs" />
<Compile Include="Model\SettingsArray.cs" />
<Compile Include="ProviderSolutionProps.cs" />
<Compile Include="QuickConnection.cs" />
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down
2 changes: 1 addition & 1 deletion CrmCodeGenerator.VSPackage/Dialogs/Login.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public partial class Login : INotifyPropertyChanged
{
#region Properties

private const string WindowTitle = "Plugin Registration Extension v2.2.3";
private const string WindowTitle = "Plugin Registration Extension v2.2.4";

private Settings settings;
private readonly SettingsArray settingsArray;
Expand Down
3 changes: 2 additions & 1 deletion CrmCodeGenerator.VSPackage/Helpers/CrmDataHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#region Imports

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using CrmPluginEntities;
Expand Down Expand Up @@ -37,7 +38,7 @@ internal static class CrmDataHelper
{
public static List<ComboMessage> MessageList = new List<ComboMessage>();
public static List<ComboUser> UserList = new List<ComboUser>();
public static Dictionary<string, List<string>> AttributeList = new Dictionary<string, List<string>>();
public static IDictionary<string, List<string>> AttributeList = new ConcurrentDictionary<string, List<string>>();

internal static List<string> GetEntityNames(string connectionString, bool cached = true)
{
Expand Down
13 changes: 0 additions & 13 deletions CrmCodeGenerator.VSPackage/MessageEventArgs.cs

This file was deleted.

4 changes: 2 additions & 2 deletions CrmCodeGenerator.VSPackage/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("2.2.3.0")]
[assembly: AssemblyFileVersion("2.2.3.0")]
[assembly: AssemblyVersion("2.2.4.0")]
[assembly: AssemblyFileVersion("2.2.4.0")]


[assembly: ProvideBindingRedirection(AssemblyName = "Microsoft.Xrm.Sdk",
Expand Down
1 change: 0 additions & 1 deletion CrmCodeGenerator.VSPackage/ProviderSolutionProps.cs

This file was deleted.

117 changes: 0 additions & 117 deletions CrmCodeGenerator.VSPackage/QuickConnection.cs

This file was deleted.

Loading

0 comments on commit d94c94d

Please sign in to comment.