Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject BusinessServerProvider into XMLFileDataService #253

Open
wants to merge 3 commits into
base: feature-239-use-proper-di
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions ICSSoft.STORMNET.Business/XMLDataService/XMLDataService.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
namespace ICSSoft.STORMNET.Business
{
using ICSSoft.Services;
using ICSSoft.STORMNET.Business.Audit;
using ICSSoft.STORMNET.Exceptions;
using ICSSoft.STORMNET.FunctionalLanguage;
using ICSSoft.STORMNET.FunctionalLanguage.SQLWhere;
using ICSSoft.STORMNET.Security;

using System;
using System.Collections;
using System.Collections.Specialized;
Expand All @@ -15,11 +8,13 @@
using System.Linq;
Anisimova2020 marked this conversation as resolved.
Show resolved Hide resolved
using System.Reflection;

using ICSSoft.Services;
using ICSSoft.STORMNET.Business.Audit;
using ICSSoft.STORMNET.Exceptions;
using ICSSoft.STORMNET.FunctionalLanguage;
using ICSSoft.STORMNET.FunctionalLanguage.SQLWhere;
using ICSSoft.STORMNET.Security;
using ICSSoft.STORMNET.Business.Interfaces;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если формально, то по алфавиту оно должно быть не тут.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Исправлено


using STORMFunction = ICSSoft.STORMNET.FunctionalLanguage.Function;

Expand All @@ -41,12 +36,19 @@ public partial class XMLFileDataService : System.ComponentModel.Component, IData
/// </summary>
/// <param name="securityManager">The security manager instance.</param>
/// <param name="auditService">The audit service.</param>
public XMLFileDataService(ISecurityManager securityManager, IAuditService auditService)
/// <param name="businessServerProvider">The provider for <see cref="BusinessServer"/> creation.</param>
public XMLFileDataService(ISecurityManager securityManager, IAuditService auditService, IBusinessServerProvider businessServerProvider)
{
SecurityManager = securityManager;
AuditService = auditService;
BusinessServerProvider = businessServerProvider;
}

/// <summary>
/// Сервис получения бизнес-серверов для обрабатываемых объектов.
/// </summary>
public IBusinessServerProvider BusinessServerProvider { get; protected set; }
Anisimova2020 marked this conversation as resolved.
Show resolved Hide resolved

/// <inheritdoc cref="IDataService" />
public ISecurityManager SecurityManager { get; }

Expand Down Expand Up @@ -1537,7 +1539,7 @@ public UpdateObjectStruct(string table, object key, SortedList values, string pr
/// <returns>Копии экземпляра сервиса данных.</returns>
public object Clone()
{
return new XMLFileDataService(SecurityManager, AuditService)
return new XMLFileDataService(SecurityManager, AuditService, BusinessServerProvider)
{
_altdataSet = _altdataSet,
_changeViewForTypeDelegate = _changeViewForTypeDelegate,
Expand Down