本文整理汇总了C#中IDatabaseFactory.Get方法的典型用法代码示例。如果您正苦于以下问题:C# IDatabaseFactory.Get方法的具体用法?C# IDatabaseFactory.Get怎么用?C# IDatabaseFactory.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDatabaseFactory
的用法示例。
在下文中一共展示了IDatabaseFactory.Get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogManager
public LogManager(IDatabaseFactory databaseFactory, ICryptoService cryptoService)
{
_dbContext = databaseFactory.Get() as DiabDbContext;
LogCommands = new LogCommands(databaseFactory);
ModelReader = new ModelReader(databaseFactory);
PersonCommands = new PersonCommands(databaseFactory);
FriendCommands = new FriendCommands(databaseFactory);
SecurityLinkCommands = new SecurityLinkCommands(databaseFactory, cryptoService);
}
示例2: PersonCommands
public PersonCommands(IDatabaseFactory databaseFactory)
{
_db = databaseFactory.Get();
}
示例3: UnitOfWork
public UnitOfWork(IDatabaseFactory factory)
: this(factory.Get())
{
}
示例4: TeacherEnumerator
public TeacherEnumerator(IDatabaseFactory plop)
: this()
{
Db = plop;
var users = Db.Get().Users;
//var teachers = users.SelectMany(x => x.Roles).Where(y => y.Role.Name == "Teacher");
var usernames = users.Where(y => y.Roles.Any(role => role.Role.Name == "Teacher")).Select(x => x.UserName);
foreach (var bliftasplik in usernames)
{
this.Teachers.Add(bliftasplik);
}
}
示例5: SelectUserRolesViewModel
// Enable initialization with an instance of ApplicationUser:
public SelectUserRolesViewModel(ApplicationUser user, IDatabaseFactory dbFactory)
: this()
{
this.UserName = user.UserName;
string[] firstLast = user.UserName.Split('.');
this.FirstName = firstLast[0];
if (firstLast.Length > 1)
{
this.LastName = firstLast[1];
}
else
{
this.LastName = "";
}
this.UserId = user.Id;
// Add all available roles to the list of EditorViewModels:
IDbSet<IdentityRole> allRoles = dbFactory.Get().Roles;
foreach (var role in allRoles)
{
// An EditorViewModel will be used by Editor Template:
var rvm = new SelectRoleEditorViewModel(role);
this.Roles.Add(rvm);
}
// Set the Selected property to true for those roles for
// which the current user is a member:
foreach (IdentityUserRole userRole in user.Roles)
{
SelectRoleEditorViewModel checkUserRole =
this.Roles.Find(r => r.RoleName == userRole.Role.Name);
checkUserRole.Selected = true;
}
}
示例6: SecurityLinkCommands
public SecurityLinkCommands(IDatabaseFactory databaseFactory, ICryptoService cryptoService)
{
_cryptoService = cryptoService;
_db = databaseFactory.Get();
}
示例7: UnitOfWork
/// <summary>
/// Initializes a new instance of the UnitOfWork class.
/// </summary>
public UnitOfWork(IDatabaseFactory factory)
{
_dbContext = factory.Get();
}
示例8: LogCommands
public LogCommands(IDatabaseFactory databaseFactory)
{
_dbContext = databaseFactory.Get() as DiabDbContext;
}
示例9: ModelReader
public ModelReader(IDatabaseFactory databaseFactory)
{
_db = databaseFactory.Get();
}
示例10: UnitOfWork
public UnitOfWork(IDatabaseFactory databaseFactory)
{
_dataContext = databaseFactory.Get();
}
示例11: FriendCommands
public FriendCommands(IDatabaseFactory databaseFactory)
{
_db = databaseFactory.Get();
}