Мы разрабатываем систему, которая подключается к Microsoft Dynamics CRM
с помощью XRM SDK
, это на стороне сервера построена на .NET MVC
, Front End Side построен на AngularjsМедленность в динамике CRM с использованием XRM SDK?
Мы столкнулись с проблемой задержки в ответах API, напр. Для входа в API API требуется как минимум 1,8 секунды для получения успеха или ложного ответа, и этот API является самым быстрым.
Другие API еще медленнее, мы попытались поймать источник этой медлительности, чтобы исправить это, но не повезло. это XRM SDK
, API или CRM
.
Если вы можете помочь.
var cols = new ColumnSet("exdyn_employeecontractid", "exdyn_contractstatus");
var secondEntityCols = new ColumnSet("exdyn_companyagreementid", "exdyn_agreementstatus");
var filter = new FilterExpression
{
Conditions =
{
new ConditionExpression
{
AttributeName = "exdyn_employeeid",
Operator = ConditionOperator.Equal,
Values = {model.EmployeeId}
},
new ConditionExpression
{
AttributeName = "exdyn_contractstatus",
Operator = ConditionOperator.Equal,
Values = { 3 } // approved {2} signed
},
},
FilterOperator = LogicalOperator.And
};
var secondFilter = new FilterExpression
{
Conditions =
{
new ConditionExpression
{
AttributeName = "exdyn_agreementstatus",
Operator = ConditionOperator.Equal,
Values = { 2 } // active {2}
}
}
};
var entity = _organizationService.GetEntityCollectionWithJoin
("exdyn_employeecontract", "exdyn_companyagreement",
"exdyn_companyagreementid", "exdyn_companyagreementid", JoinOperator.Inner,
cols, secondEntityCols, filter, secondFilter).Entities.FirstOrDefault();
==============
код Используется для подключения:
public class WebModule : Module
{
protected override void Load(ContainerBuilder builder)
{
// Register your Web API controllers.
builder.RegisterApiControllers(Assembly.GetExecutingAssembly());
// Register your MVC controllers.
builder.RegisterControllers(Assembly.GetExecutingAssembly());
// OPTIONAL: Register web abstractions like HttpContextBase.
builder.RegisterModule<AutofacWebTypesModule>();
builder.RegisterFilterProvider();
builder.Register(c => new WebConfigurationSettings()).As<IWebSettings>().SingleInstance();
builder.Register(GetOrganizationServiceManagement).SingleInstance();
builder.Register(GetOrganizationProxy).InstancePerRequest();
builder.Register(c => new ExceptionHandler()).SingleInstance();
builder.Register(c => new EmployeeService(c.Resolve<IOrganizationService>()))
.As<IEmployeeService>()
.EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new AttendanceService(c.Resolve<IOrganizationService>()))
.As<IAttendanceService>().EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new ContractService(c.Resolve<IOrganizationService>()))
.As<IContractService>().EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new InquiryService(c.Resolve<IOrganizationService>(), c.Resolve<ILookupService>()))
.As<IInquiryService>().EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new LookupService(c.Resolve<IOrganizationService>()))
.As<ILookupService>().EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new LeaveRequestService(c.Resolve<IOrganizationService>(),
c.Resolve<IContractService>(), c.Resolve<ILookupService>()))
.As<ILeaveRequestService>().EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new PurchaseRequestService(c.Resolve<IOrganizationService>(), c.Resolve<ILookupService>()))
.As<IPurchaseRequestService>().EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new NotificationService(c.Resolve<IOrganizationService>()))
.As<INotificationService>().EnableInterfaceInterceptors()
.InterceptedBy(typeof(ExceptionHandler))
.InstancePerRequest();
builder.Register(c => new CacheClient())
.As<ICacheClient>()
.SingleInstance();
}
private static IServiceManagement<IOrganizationService> GetOrganizationServiceManagement(IComponentContext ctx)
{
var settings = ctx.Resolve<IWebSettings>();
return ServiceConfigurationFactory.CreateManagement<IOrganizationService>(
new Uri(settings.OrganizationUrl));
}
private static IOrganizationService GetOrganizationProxy(IComponentContext ctx)
{
var svcMgmt = ctx.Resolve<IServiceManagement<IOrganizationService>>();
var settings = ctx.Resolve<IWebSettings>();
var credentials = new AuthenticationCredentials();
credentials.ClientCredentials.UserName.UserName = settings.SystemUserName;
credentials.ClientCredentials.UserName.Password = settings.SystemUserPassword;
var authCredentials = svcMgmt.Authenticate(credentials);
//return new OrganizationServiceProxy(svcMgmt, authCredentials.SecurityTokenResponse);
return new OrganizationServiceProxy(svcMgmt, authCredentials.ClientCredentials);
}
}
Это On-Premise или Online? Вы используете конечную точку мыла или остальную конечную точку? – Sxntk
Вы должны отправить какой-то код. Как используется SDK? Как создается соединение? Формат строки подключения? – dynamicallyCRM
Звучит о праве на меня.По моему опыту Dynamics CRM Online отстой: не масштабируется, если он опускается вниз - ничего не поделаешь, нет доступа к подчеркиванию SQL Server, низкой производительности и т. Д. –