• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDataAccess类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HttpRequestEntityReader

        /// <summary>
        ///     Initializes a new instance of the <see cref="T:Stumps.Server.Data.HttpRequestEntityReader"/> class.
        /// </summary>
        /// <param name="serverId">The unique identifier for the server.</param>
        /// <param name="requestEntity">The request entity.</param>
        /// <param name="dataAccess">The data access provider used by the instance.</param>
        /// <exception cref="System.ArgumentNullException">
        /// <paramref name="serverId"/> is <c>null</c>.
        /// or
        /// <paramref name="requestEntity"/> is <c>null</c>.
        /// or 
        /// <paramref name="dataAccess"/> is <c>null</c>.
        /// </exception>
        public HttpRequestEntityReader(string serverId, HttpRequestEntity requestEntity, IDataAccess dataAccess)
        {
            if (string.IsNullOrWhiteSpace(serverId))
            {
                throw new ArgumentNullException("serverId");
            }

            if (requestEntity == null)
            {
                throw new ArgumentNullException("requestEntity");

            }

            if (dataAccess == null)
            {
                throw new ArgumentNullException("dataAccess");
            }

            _entity = requestEntity;

            this.Headers = new HttpHeaders();
            foreach (var pair in _entity.Headers)
            {
                this.Headers[pair.Name] = pair.Value;
            }

            _body = dataAccess.ServerReadResource(serverId, requestEntity.BodyResourceName) ?? new byte[0];
        }
开发者ID:Cayan-LLC,项目名称:stumps,代码行数:41,代码来源:HttpRequestEntityReader.cs


示例17: JobLogger

        /// <summary>
        /// Constructor, sets the parameters
        /// </summary>
        /// <param name="loggerConfiguration">Logger Configuration Factory</param>
        /// <param name="consoleAccess">Console Factory</param>
        /// <param name="dataAccess">DB Data Factory</param>
        /// <param name="fileAccess">File Factory</param>
        public JobLogger(ILoggerConfiguration loggerConfiguration, IConsoleAccess consoleAccess, IDataAccess dataAccess, IFileAccess fileAccess)
        {
            this._dataAccess = dataAccess;
            this._consoleAccess = consoleAccess;
            this._fileAccess = fileAccess;

            this._loggerConfiguration = loggerConfiguration;
        }
开发者ID:JorgeAgueroH,项目名称:JAAH-BE-L,代码行数:15,代码来源:JobLogger.cs


示例18: ScanningService

        public ScanningService(ILineProcessor lineProcessor, IDataAccess dataAccess, IFileReader fileReader)
        {
            _lineProcessor = lineProcessor;
            _dataAccess = dataAccess;
            _fileReader = fileReader;

            Mapper.CreateMap<WordItem, WordModel>();
        }
开发者ID:ruslantsm,项目名称:FolderScan,代码行数:8,代码来源:ScanningService.cs


示例19: 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;

            Load();
        }
开发者ID:jgodinez,项目名称:MoneyManager,代码行数:15,代码来源:TransactionRepository.cs


示例20: RandomRepositoryMethod

 /// <summary>
 /// A random static "Factory" method
 /// </summary>
 /// <param name="id">The value for the Id parameter.</param>
 /// <param name="name">The value for the Name parameter.</param>
 /// <param name="dataAccess">The data access.</param>
 public static void RandomRepositoryMethod(Guid id, string name, IDataAccess dataAccess)
 {
     dataAccess.ExecuteNonQuery(
         ConnectionString,
         SomeRandomTableInsertSP,
         DataAccess.CreateParameter("@Id", SqlDbType.UniqueIdentifier, id),
         DataAccess.CreateParameter("@Name", SqlDbType.NVarChar, name));
 }
开发者ID:ashishmgupta,项目名称:DependencyInjectionSimple,代码行数:14,代码来源:RandomRepository.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDataColumn类代码示例发布时间:2022-05-24
下一篇:
C# IData类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap