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


C# IDatabaseFactory.Get方法代码示例

本文整理汇总了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);
 }
开发者ID:riccardone,项目名称:myselflog,代码行数:9,代码来源:LogManager.cs

示例2: PersonCommands

 public PersonCommands(IDatabaseFactory databaseFactory)
 {
     _db = databaseFactory.Get();
 }
开发者ID:riccardone,项目名称:myselflog,代码行数:4,代码来源:PersonCommands.cs

示例3: UnitOfWork

 public UnitOfWork(IDatabaseFactory factory)
     : this(factory.Get())
 {
 }
开发者ID:coredweller,项目名称:ASP.NET-4.0-StructureMap-LinqToSql-Base-Template,代码行数:4,代码来源:UnitOfWork.cs

示例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);
     }
 }
开发者ID:kcbridges,项目名称:Machete,代码行数:12,代码来源:Lookups.cs

示例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;
            }
        }
开发者ID:SavageLearning,项目名称:Machete,代码行数:36,代码来源:AccountViewModels.cs

示例6: SecurityLinkCommands

 public SecurityLinkCommands(IDatabaseFactory databaseFactory, ICryptoService cryptoService)
 {
     _cryptoService = cryptoService;
     _db = databaseFactory.Get();
 }
开发者ID:riccardone,项目名称:myselflog,代码行数:5,代码来源:SecurityLinkCommands.cs

示例7: UnitOfWork

 /// <summary>
 /// Initializes a new instance of the UnitOfWork class.
 /// </summary>
 public UnitOfWork(IDatabaseFactory factory)
 {
     _dbContext = factory.Get();
 }
开发者ID:TomKaminski,项目名称:ITAD2015,代码行数:7,代码来源:UnitOfWork.cs

示例8: LogCommands

 public LogCommands(IDatabaseFactory databaseFactory)
 {
     _dbContext = databaseFactory.Get() as DiabDbContext;
 }
开发者ID:riccardone,项目名称:myselflog,代码行数:4,代码来源:LogCommands.cs

示例9: ModelReader

 public ModelReader(IDatabaseFactory databaseFactory)
 {
     _db = databaseFactory.Get();
 }
开发者ID:riccardone,项目名称:myselflog,代码行数:4,代码来源:ModelReader.cs

示例10: UnitOfWork

 public UnitOfWork(IDatabaseFactory databaseFactory)
 {
     _dataContext = databaseFactory.Get();
 }
开发者ID:b9502032,项目名称:MySite,代码行数:4,代码来源:UnitOfWork.cs

示例11: FriendCommands

 public FriendCommands(IDatabaseFactory databaseFactory)
 {
     _db = databaseFactory.Get();
 }
开发者ID:riccardone,项目名称:myselflog,代码行数:4,代码来源:FriendCommands.cs


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