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


C# DAL.UnitOfWork类代码示例

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


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

示例1: Get

 public static Models.CdVersion Get(int cdVersionId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.CdVersionRepository.GetById(cdVersionId);
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:CdVersion.cs

示例2: SearchImageProfileFileFolders

 public static List<Models.ImageProfileFileFolder> SearchImageProfileFileFolders(int profileId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.ImageProfileFileFolderRepository.Get(x => x.ProfileId == profileId, orderBy: q => q.OrderBy(t => t.Priority));
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:ImageProfileFileFolder.cs

示例3: GetScript

 public static Models.Script GetScript(int scriptId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.ScriptRepository.GetById(scriptId);
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:Script.cs

示例4: GetUser

 public static CloneDeployUser GetUser(int userId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.UserRepository.GetById(userId);
     }
 }
开发者ID:cdadmin,项目名称:clonedeploy,代码行数:7,代码来源:User.cs

示例5: GetUserByApiId

 public static Models.CloneDeployUser GetUserByApiId(string apiId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.UserRepository.GetFirstOrDefault(x => x.ApiId == apiId);
     }
 }
开发者ID:cdadmin,项目名称:clonedeploy,代码行数:7,代码来源:User.cs

示例6: GetAllOptionalInstallsForMt

 public static List<Models.MunkiManifestOptionInstall> GetAllOptionalInstallsForMt(int manifestTemplateId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.MunkiOptionalInstallRepository.Get(s => s.ManifestTemplateId == manifestTemplateId);
     }
 }
开发者ID:cdadmin,项目名称:clonedeploy,代码行数:7,代码来源:MunkiOptionalInstall.cs

示例7: TotalCount

 public static string TotalCount(int manifestTemplateId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.MunkiOptionalInstallRepository.Count(x => x.ManifestTemplateId == manifestTemplateId);
     }
 }
开发者ID:cdadmin,项目名称:clonedeploy,代码行数:7,代码来源:MunkiOptionalInstall.cs

示例8: Get

 public static List<Models.UserImageManagement> Get(int userId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.UserImageManagementRepository.Get(x => x.UserId == userId);
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:UserImageManagement.cs

示例9: GetFileFolder

 public static Models.FileFolder GetFileFolder(int FileFolderId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.FileFolderRepository.GetById(FileFolderId);
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:FileFolder.cs

示例10: GetSite

 public static Models.Site GetSite(int siteId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.SiteRepository.GetById(siteId);
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:Site.cs

示例11: SearchSites

 public static List<Models.Site> SearchSites(string searchString = "")
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.SiteRepository.Get(searchString);
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:Site.cs

示例12: GetComputersForManifestTemplate

 public static List<Models.ComputerMunki> GetComputersForManifestTemplate(int templateId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.ComputerMunkiRepository.Get(x => x.MunkiTemplateId == templateId);
     }
 }
开发者ID:cdadmin,项目名称:clonedeploy,代码行数:7,代码来源:ComputerMunki.cs

示例13: Get

 public static List<Models.ComputerMunki> Get(int computerId)
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return uow.ComputerMunkiRepository.Get(x => x.ComputerId == computerId);
     }
 }
开发者ID:cdadmin,项目名称:clonedeploy,代码行数:7,代码来源:ComputerMunki.cs

示例14: FirstRunCompleted

 public static bool FirstRunCompleted()
 {
     using (var uow = new DAL.UnitOfWork())
     {
         return Convert.ToBoolean(uow.CdVersionRepository.GetById(1).FirstRunCompleted);
     }
 }
开发者ID:Terricide,项目名称:clonedeploy,代码行数:7,代码来源:CdVersion.cs

示例15: AddGroup

        public static Models.ValidationResult AddGroup(Models.Group group, int userId)
        {
            using (var uow = new DAL.UnitOfWork())
            {
                var validationResult = ValidateGroup(group, true);
                if (validationResult.IsValid)
                {
                    uow.GroupRepository.Insert(group);
                    validationResult.IsValid = uow.Save();

                    //If Group management is being used add this group to the allowed users list
                    var userManagedGroups = BLL.UserGroupManagement.Get(userId);
                    if (userManagedGroups.Count > 0)
                        BLL.UserGroupManagement.AddUserGroupManagements(
                            new List<Models.UserGroupManagement>
                            {
                                new Models.UserGroupManagement
                                {
                                    GroupId = group.Id,
                                    UserId = userId
                                }
                            });
                }

                return validationResult;
            }
        }
开发者ID:cdadmin,项目名称:clonedeploy,代码行数:27,代码来源:Group.cs


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