当前位置: 首页>>代码示例>>C#>>正文


C# IDataAccess类代码示例

本文整理汇总了C#中IDataAccess的典型用法代码示例。如果您正苦于以下问题:C# IDataAccess类的具体用法?C# IDataAccess怎么用?C# IDataAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IDataAccess类属于命名空间,在下文中一共展示了IDataAccess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BaseTestInitialize

        public void BaseTestInitialize()
        {
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                Formatting = Formatting.None,
                Converters = new JsonConverter[] { new JsonKnownTypeConverter() }
            };

            var container = new UnityContainer().LoadConfiguration();
            this.dataAccess = container.Resolve<IDataAccess>();
            var formMetadata = this.dataAccess.GetProduct("1000");
            var subpageMetadata = this.dataAccess.GetProduct("5000");
            this.controlList = formMetadata.FormDefinition.Pages.AllControls;
            this.subpageControlList = subpageMetadata.FormDefinition.Pages.AllControls;
            this.validatorList = new RegexValidatorList
                                 {
                                     new RegexValidator
                                     {
                                         Id = "1",
                                         Regex = "^((\\+\\d{1,3}[\\- ]?)??(\\(?\\d{1,4}\\)?[\\- ])?((?:\\d{0,5})\\d{3,4}[\\- ]?\\d{3,4}))?$",
                                         Name = "Phone"
                                     }
                                 };

            IEnumerable<Control> flatControls = this.controlList.Flatten();
            this.defaultControlsAccess = new List<ControlAccess>(flatControls.Select(e => new ControlAccess(e.Id, AccessLevel.Write)));
        }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:27,代码来源:ApplicationValidatorTests.cs

示例2: TransactionRepository

 /// <summary>
 ///     Creates a TransactionRepository Object
 /// </summary>
 /// <param name="dataAccess">Instanced <see cref="IDataAccess{T}" /> for <see cref="FinancialTransaction" /></param>
 /// <param name="recurringDataAccess">
 ///     Instanced <see cref="IDataAccess{T}" /> for <see cref="RecurringTransaction" />
 /// </param>
 public TransactionRepository(IDataAccess<FinancialTransaction> dataAccess,
     IDataAccess<RecurringTransaction> recurringDataAccess)
 {
     this.dataAccess = dataAccess;
     this.recurringDataAccess = recurringDataAccess;
     data = new ObservableCollection<FinancialTransaction>(this.dataAccess.LoadList());
 }
开发者ID:M-Zuber,项目名称:MoneyManager,代码行数:14,代码来源:TransactionRepository.cs

示例3: SystemWorkflowManager

 /// <summary>
 /// Initializes a new instance of the <see cref="SystemWorkflowManager" /> class.
 /// </summary>
 /// <param name="workflowService">Gateway into the workflow subsystem.</param>
 /// <param name="formServiceGateway">Gateway into the forms subsystem.</param>
 /// <param name="dataAccess">The data access.</param>
 public SystemWorkflowManager(IWorkflowService workflowService, IFormServiceGateway formServiceGateway, IDataAccess dataAccess)
 {
     this.workflowService = workflowService;
     this.formServiceGateway = formServiceGateway;
     this.dataAccess = dataAccess;
     this.productCache = new Dictionary<string, ProductVersionList>();
 }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:13,代码来源:SystemWorkflowManager.cs

示例4: BoxEntry

        public BoxEntry(IRecordView view, IDataAccess dataAccess)
        {
            if (view == null) throw new ArgumentNullException("view");

            this.view = view;
            this.dataAccess = dataAccess;
        }
开发者ID:NathanGloyn,项目名称:Is-your-code-SOLID---with-unit-tests,代码行数:7,代码来源:BoxEntry.cs

示例5: SettingsViewModel

        public SettingsViewModel(IDataAccess dataAccess)
        {
            this.dataAccess = dataAccess;

            LightTheme = Settings.Default.LightTheme;
            DBLocation = Settings.Default.DBLocation;
        }
开发者ID:RSchwoerer,项目名称:BugTracker,代码行数:7,代码来源:SettingsViewModel.cs

示例6: CreateProperlyFileInDb_Test

        public void CreateProperlyFileInDb_Test()
        {
            // Arrange
            ArrangeMocks();
            _dataAccess = MockRepository.GenerateMock<IDataAccess>();
            var service = new ScanningService(_lineProcessor, _dataAccess, _fileReader);

            var actualCreatedFilePath = string.Empty;
            _dataAccess.Expect(x => x.GetFile(Arg<string>.Is.Anything)).WhenCalled(x =>
                                    {
                                        actualCreatedFilePath = (string) x.Arguments[0];
                                    })
                                    .Return(GetTestFileEntity(_testPath));

            _dataAccess.Expect(x => x.SaveWords(Arg<IEnumerable<string>>.Is.Anything)).Return(GetSaveWordsResult());
            _dataAccess.Expect(x => x.AddWordEntries(Arg<List<WEntry>>.Is.Anything));

            // Act
            var actualResult = service.AddScanningFile(_testPath, _token);
            actualResult.Wait(_token);

            // Assert
            _dataAccess.VerifyAllExpectations();
            Assert.AreEqual(_testPath, actualCreatedFilePath);
        }
开发者ID:ruslantsm,项目名称:FolderScan,代码行数:25,代码来源:ScanningServiceTests.cs

示例7: StumpsServerInstance

        /// <summary>
        ///     Initializes a new instance of the <see cref="T:Stumps.Server.StumpsServerInstance"/> class.
        /// </summary>
        /// <param name="serverFactory">The factory used to initialize new server instances.</param>
        /// <param name="serverId">The unique identifier of the Stumps server.</param>
        /// <param name="dataAccess">The data access provider used by the instance.</param>
        public StumpsServerInstance(IServerFactory serverFactory, string serverId, IDataAccess dataAccess)
        {
            if (serverFactory == null)
            {
                throw new ArgumentNullException("serverFactory");
            }

            _serverFactory = serverFactory;

            this.ServerId = serverId;

            _lock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
            _dataAccess = dataAccess;

            // Setup the objects needed to keep track of Stumps.
            _stumpList = new List<StumpContract>();
            _stumpReference = new Dictionary<string, StumpContract>(StringComparer.OrdinalIgnoreCase);

            // Setup the recordings maintained by the server instance.
            this.Recordings = new Recordings();

            // Initialize the server
            InitializeServer();

            // Initialize the Stumps
            InitializeStumps();
        }
开发者ID:Cayan-LLC,项目名称:stumps,代码行数:33,代码来源:StumpsServerInstance.cs

示例8: GetUser

		public static User GetUser(IDataAccess dataAccess, int userId)
		{
			if(dataAccess == null)
				throw new ArgumentNullException("dataAccess");

			return dataAccess.Select<User>(DATA_ENTITY_USER, new Condition("UserId", userId)).FirstOrDefault();
		}
开发者ID:dbabox,项目名称:Zongsoft.Security,代码行数:7,代码来源:MembershipHelper.cs

示例9: TokenLogic

        public TokenLogic(IDataAccess objDataAccess)
        {
            //primesc obiectul, nu e treaba TokenLogic ce dataAccess se foloseste
            //unity are grija de dependency injection

            _dataAccess = objDataAccess;
        }
开发者ID:GeorgeMi,项目名称:PollApp,代码行数:7,代码来源:TokenLogic.cs

示例10: AccountRepository

        /// <summary>
        ///     Creates a AccountRepository Object
        /// </summary>
        /// <param name="dataAccess">Instanced account data Access</param>
        public AccountRepository(IDataAccess<Account> dataAccess)
        {
            this.dataAccess = dataAccess;

            Data = new ObservableCollection<Account>();
            Load();
        }
开发者ID:AsithPerera,项目名称:MoneyManager,代码行数:11,代码来源:AccountRepository.cs

示例11: Setup

 public void Setup()
 {
     fakeDataAccess = Substitute.For<IDataAccess>();
     fakeView = Substitute.For<ISearchView>();
     target = new SearchPresenter(fakeDataAccess);
     target.SearchView = fakeView;
 }
开发者ID:NathanGloyn,项目名称:Is-your-code-SOLID---with-unit-tests,代码行数:7,代码来源:When_searching_for_records.cs

示例12: ShiftRuleFactory

        public ShiftRuleFactory(IDataAccess dataAccess)
        {
            LogSession.Main.EnterMethod(this, "ShiftRuleFactory");
            try
            {
                /*--------- Your code goes here-------*/
                this.DataAccess = dataAccess;

                this.m_HardRulesRepository = new ShiftRuleCollection();
                this.m_SoftRulesRepository = new ShiftRuleCollection();

                CreateRulesInstances(ref m_HardRulesRepository, ref m_SoftRulesRepository);

                foreach (var hardRule in this.m_HardRulesRepository)
                {
                    LogSession.Main.LogObject("Hard Rules Repository item", hardRule);
                }
                foreach (var softRule in this.m_SoftRulesRepository)
                {
                    LogSession.Main.LogObject("Soft Rules Repository item", softRule);
                }
                /*------------------------------------*/
            }
            catch (Exception ex)
            {
                LogSession.Main.LogException(ex);
                throw ex;
            }
            finally
            {
                LogSession.Main.LeaveMethod(this, "ShiftRuleFactory");
            }
        }
开发者ID:gvallejo,项目名称:ShiftScheduler,代码行数:33,代码来源:ShiftRuleFactory.cs

示例13: AttachmentManager

 /// <summary>
 /// Initializes a new instance of the <see cref="AttachmentManager"/> class.
 /// </summary>
 /// <param name="attachmentAccess">Provides access to application attachments.</param>
 /// <param name="dataAccess">Provides access to the data layer.</param>
 /// <param name="applicationManager">Manages applications.</param>
 /// <param name="entitlementProvider">The entitlement provider.</param>
 public AttachmentManager(IAttachmentAccess attachmentAccess, IDataAccess dataAccess, ApplicationManager applicationManager, IApplicationEntitlementProvider entitlementProvider)
     : base(dataAccess)
 {
     this.attachmentAccess = attachmentAccess;
     this.applicationManager = applicationManager;
     this.entitlementProvider = entitlementProvider;
 }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:14,代码来源:AttachmentManager.cs

示例14: Setup

 public void Setup()
 {
     fakeDataAccess = Substitute.For<IDataAccess>();
     fakeView = Substitute.For<IRecordView>();
     target = new BoxEntry(fakeDataAccess);
     target.View = fakeView;
 }
开发者ID:NathanGloyn,项目名称:Is-your-code-SOLID---with-unit-tests,代码行数:7,代码来源:When_deleting_a_file.cs

示例15: UserService

        /// <summary>
        /// Initializes a new instance of the <see cref="UserService"/> class.
        /// </summary>
        /// <param name="dataAccess">The data access.</param>
        /// <exception cref="System.ArgumentNullException">dataAccess</exception>
        public UserService(IDataAccess dataAccess)
		{
			if (dataAccess == null)
				throw new ArgumentNullException ("dataAccess");

			_dataAccess = dataAccess;
		}
开发者ID:peymanmortazavi,项目名称:Hangout,代码行数:12,代码来源:UserService.cs


注:本文中的IDataAccess类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。