public async Task <OptionList> GetItem(string itemId) { var result = _optionListRepository.GetOptionList(Guid.Parse(itemId)); ParseResult(result); return(await Task.FromResult(result)); }
public IActionResult CreateOptionList([FromBody] Deviser.Core.Common.DomainTypes.OptionList optionList) { try { if (optionList == null || string.IsNullOrEmpty(optionList.Name)) { return(BadRequest("Invalid parameter")); } if (_optionListRepository.GetOptionList(optionList.Name) != null) { return(BadRequest("Option list already exist")); } var result = _optionListRepository.CreateOptionList(optionList); if (result != null) { return(Ok(result)); } return(NotFound()); } catch (Exception ex) { _logger.LogError(string.Format("Error occured while creating option list"), ex); return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }
public IList <PropertyOption> GetPropertyOption(OptionList optionList) { var result = _optionListRepository.GetOptionList(optionList.Id); return(result?.List); }