public IActionResult ListarSkills() { try { return(Ok(_mapperSkill.GetAll())); } catch (Exception ex) { return(BadRequest(new{ Erro = ex.ToString() })); } }
public async Task <IActionResult> Index() { var skills = await _skillService.GetAll(); var sliders = await _homePageSliderService.GetAll(); var messages = await _messageService.GetAll(); var educations = await _educationService.GetAll(); var experiences = await _experienceService.GetAll(); var interesteds = await _interestedService.GetAll(); var articles = await _articleService.GetAll(); var categories = await _categoryService.GetAll(); ViewBag.SkillCount = skills.Data.Skills.Count; ViewBag.SliderCount = sliders.Data.HomePageSliders.Count; ViewBag.MessageCount = messages.Data.Messages.Count; ViewBag.EducationCount = educations.Data.Educations.Count; ViewBag.ExperienceCount = experiences.Data.Experiences.Count; ViewBag.InterestedCount = interesteds.Data.Interesteds.Count; ViewBag.ArticleCount = articles.Data.Articles.Count; ViewBag.CategoryCount = categories.Data.Categories.Count; return(View()); }
public IActionResult GetByResumeId(int resumeId) { var entities = _skillService.GetAll(resumeId); var model = entities.ToModels(); return(Ok(model)); }
public IActionResult Get() { try { //throw new Exception("Exception while fetching all the user from the storage."); _logger.LogInfo("In Get"); var skills = _skillService.GetAll(); if (skills == null) { _logger.LogInfo("No Skills Fetched"); } else { _logger.LogInfo(skills.Count().ToString() + "Skills Fetched"); } return(Ok(skills)); } catch (Exception ex) { _logger.LogError(ex.Message); return(BadRequest()); } }
private IEnumerable <SelectListItem> GetCategories() { var sections = _sectionService.GetAll(); var skills = _skillService.GetAll(); var groups = (from se in sections select new SelectListGroup() { Name = se.Title }).ToList(); var skillsWithSections = (from se in sections join sk in skills on se.Id equals sk.SectionId select new { Id = sk.Id, Title = sk.Title, SectionTitle = se.Title }).ToList(); var groupData = (from sk in skillsWithSections select new SelectListItem() { Value = sk.Id.ToString(), Text = sk.Title, Group = groups.First(sec => sec.Name.Equals(sk.SectionTitle)) }).ToList(); return(groupData); }
public async Task <ActionResult> Skills(string message) { TempData["message"] = message; IEnumerable <SkillViewModel> viewModel = _mapper.Map <IEnumerable <SkillDTO>, IEnumerable <SkillViewModel> > (await _skillService.GetAll().OrderBy(x => x.Name).ToListAsync()); return(View(viewModel)); }
public async Task <IActionResult> GetAllSkills([FromQuery] PaginationFilter filter) { var route = Request.Path.Value; var validFilter = new PaginationFilter(filter.PageNumber, filter.PageSize); var skillsResult = await _skillService.GetAll(validFilter); var pagedReponse = PaginationHelper.CreatePagedReponse(skillsResult.Skills.ToList(), validFilter, skillsResult.TotalRecords, _uriService, route); return(Ok(pagedReponse)); }
private async Task GetSkills() { try { // Get skills from api var skills = await _skillService.GetAll(); if (skills != null) { // If skills are found, check if each exists in db foreach (var skill in skills) { var existSkill = await _skillRepository.GetSkillRef(skill.Id); if (existSkill != null) { // If skill exists, update if required if (skill.Name == existSkill.Name && skill.XpCost == existSkill.XpCost) { continue; } else { var updSkill = new Skill { Name = skill.Name, XpCost = skill.XpCost, SkillRef = skill.Id, Id = existSkill.Id }; _skillRepository.UpdateSkill(updSkill); } } else { // If skill doesn't exist, create new var newSkill = new Skill { SkillRef = skill.Id, Name = skill.Name, XpCost = skill.XpCost, Id = skill.Id }; _skillRepository.InsertSkill(newSkill); } } await _skillRepository.Save(); } } catch (BrokenCircuitException) { _logger.LogWarning("Broken Circuit"); } }
public ActionResult <IEnumerable <Skill> > GetSkills() { var getResult = _skillService.GetAll(); if (getResult.Success) { return(getResult.Data); } return(NotFound()); }
public ActionResult <IEnumerable <Skill> > Get() { try { var result = _skillService.GetAll(); return(Ok(result)); } catch (Exception ex) { return(UnprocessableEntity(ex)); } }
public async Task <IActionResult> Index() { var skills = await _skillService.GetAll(); if (skills.ResultStatus == ResultStatus.Success) { return(View(skills.Data)); } if (skills.ResultStatus == ResultStatus.Error) { return(NotFound()); } return(View()); }
public ActionResult <List <SkillDto> > GetAll() { try { var skills = _service.GetAll().ToList(); List <SkillDto> skillsDto = _mapper.Map <List <SkillDto> >(skills); return(Ok(skillsDto)); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
public ActionResult Skills(int categoryId = 0, int page = 1, int itemsPerPage = 10) { var viewModel = new SkillsViewModel { Skills = _skillService.GetAll(categoryId) .ToPagedList(page, itemsPerPage), Categories = _categoryService.GetAll(), SelectedCategoryId = categoryId, SelectedCategoryName = categoryId == 0 ? "Filter By Category" : _categoryService.GetById(categoryId) .Name }; return(View(viewModel)); }
private void Setup(MajorType major) { var url = HttpContext.Request.GetDisplayUrl(); IsLocal = url.Contains("localhost"); RootPath = url.Remove(url.IndexOf("shared")); Abilities = _abilityService.GetAll <AbilityDescriptionModel>(major).ToList(); Races = _raceService.GetAll(major).ToList(); Branches = _branchService.GetAllWithPerks(major); Traits = _traitService.GetAll(major).ToList(); Skills = _skillService.GetAll(major).ToList(); if (major != MajorType.Fantasy) { return; } MagicSchools = _magicService.GetAllSchools().ToList(); Alchemy = _alchemyService.GetSummary(); }
public async Task <BaseResponses <IEnumerable <Skill> > > Handle(SkillListRequest request, CancellationToken cancellationToken) { BaseResponses <IEnumerable <Skill> > response = null; using (var trx = unitOfWork.BeginTransaction()) { try { var result = await skillService.GetAll(); response = new BaseResponses <IEnumerable <Skill> >(result); } catch (RestException ex) { response = new BaseResponses <IEnumerable <Skill> >(ex.StatusCode, ex.Message); } return(response); } }
public PartialViewResult OnGetGrid(MajorType major) { var list = _skillService.GetAll(major).OrderBy(x => x.Id); return(Partial(SitePages.MajorEditorSkills_Grid, list)); }
public async Task <IActionResult> Get() { return(Response(await _service.GetAll())); }
public virtual ActionResult <IEnumerable <SkillDto> > GetAll() { return(_skillService.GetAll().ToList()); }
// GET: Employee/Create public ActionResult Create() { ViewBag.skillList = new MultiSelectList(_skillService.GetAll(), "Id", "SkillName"); return(View()); }
public void GetAll() { Assert.IsTrue(_skillService.GetAll().ToList().Count == 3); Assert.AreEqual(_skillService.GetAll().ToList()[0].Name, "Nokia Lumia 630"); Assert.AreEqual(_skillService.GetByIdAsync(1).Result.Name, "Nokia Lumia 630"); }
public IList <SkillDTO> Get() { return(Service.GetAll()); }
// // GET: /Skill/ public ActionResult Skills() { var model = service.GetAll().Select(e => new { e.Id, e.Name, e.Description }).ToList(); return(View(model)); }
public IEnumerable <SkillDto> GetSkillsByCategory(int id) => _skillService.GetAll(id);