本文整理汇总了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)));
}
示例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());
}
示例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>();
}
示例4: BoxEntry
public BoxEntry(IRecordView view, IDataAccess dataAccess)
{
if (view == null) throw new ArgumentNullException("view");
this.view = view;
this.dataAccess = dataAccess;
}
示例5: SettingsViewModel
public SettingsViewModel(IDataAccess dataAccess)
{
this.dataAccess = dataAccess;
LightTheme = Settings.Default.LightTheme;
DBLocation = Settings.Default.DBLocation;
}
示例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);
}
示例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();
}
示例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();
}
示例9: TokenLogic
public TokenLogic(IDataAccess objDataAccess)
{
//primesc obiectul, nu e treaba TokenLogic ce dataAccess se foloseste
//unity are grija de dependency injection
_dataAccess = objDataAccess;
}
示例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();
}
示例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");
}
}
示例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;
}
示例14: Setup
public void Setup()
{
fakeDataAccess = Substitute.For<IDataAccess>();
fakeView = Substitute.For<IRecordView>();
target = new BoxEntry(fakeDataAccess);
target.View = fakeView;
}
示例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;
}