本文整理汇总了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);
}
}
示例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));
}
}
示例3: GetScript
public static Models.Script GetScript(int scriptId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.ScriptRepository.GetById(scriptId);
}
}
示例4: GetUser
public static CloneDeployUser GetUser(int userId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.UserRepository.GetById(userId);
}
}
示例5: GetUserByApiId
public static Models.CloneDeployUser GetUserByApiId(string apiId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.UserRepository.GetFirstOrDefault(x => x.ApiId == apiId);
}
}
示例6: GetAllOptionalInstallsForMt
public static List<Models.MunkiManifestOptionInstall> GetAllOptionalInstallsForMt(int manifestTemplateId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.MunkiOptionalInstallRepository.Get(s => s.ManifestTemplateId == manifestTemplateId);
}
}
示例7: TotalCount
public static string TotalCount(int manifestTemplateId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.MunkiOptionalInstallRepository.Count(x => x.ManifestTemplateId == manifestTemplateId);
}
}
示例8: Get
public static List<Models.UserImageManagement> Get(int userId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.UserImageManagementRepository.Get(x => x.UserId == userId);
}
}
示例9: GetFileFolder
public static Models.FileFolder GetFileFolder(int FileFolderId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.FileFolderRepository.GetById(FileFolderId);
}
}
示例10: GetSite
public static Models.Site GetSite(int siteId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.SiteRepository.GetById(siteId);
}
}
示例11: SearchSites
public static List<Models.Site> SearchSites(string searchString = "")
{
using (var uow = new DAL.UnitOfWork())
{
return uow.SiteRepository.Get(searchString);
}
}
示例12: GetComputersForManifestTemplate
public static List<Models.ComputerMunki> GetComputersForManifestTemplate(int templateId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.ComputerMunkiRepository.Get(x => x.MunkiTemplateId == templateId);
}
}
示例13: Get
public static List<Models.ComputerMunki> Get(int computerId)
{
using (var uow = new DAL.UnitOfWork())
{
return uow.ComputerMunkiRepository.Get(x => x.ComputerId == computerId);
}
}
示例14: FirstRunCompleted
public static bool FirstRunCompleted()
{
using (var uow = new DAL.UnitOfWork())
{
return Convert.ToBoolean(uow.CdVersionRepository.GetById(1).FirstRunCompleted);
}
}
示例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;
}
}