/// <summary> /// 添加权限集合 /// </summary> /// <param name="models"></param> /// <returns></returns> public async Task <StatusResult> InsertPermission(PermissionInputDto[] models) { var model = models.Adapt <List <DataLayer.Entities.PermissionEntity> >();; var res = await _modelRepository.InsertAsync(model); return(new StatusResult(res == null, "操作失败")); }
/// <summary> /// 添加菜单集合 /// </summary> /// <param name="models"></param> /// <returns></returns> public async Task <StatusResult> InsertMenu(MenuInputDto[] models) { var model = models.Adapt <List <MenuEntity> >();; var res = await _menuRepository.InsertAsync(model); return(new StatusResult(res == null, "操作失败")); }
public IActionResult All(int quizId) { Result[] results = DbContext.Results.Where(q => q.QuizId == quizId).ToArray(); return(new JsonResult( results.Adapt <ResultViewModel[]>(), JsonSettings)); }
public void Adapt() { IList <string> adapter = list.Adapt <int, string>(); Assert.IsNotNull(adapter); }