public async Task <IActionResult> GetAssetCategory(string id) { if (string.IsNullOrEmpty(id)) { return(BadRequest()); } var res = await _assetsService.AssetCategoryGetAsync(id); if (res == null) { return(NotFound()); } return(Ok(GetAssetCategoriesResponseModel.Create(new[] { res.ConvertToApiModel() }))); }
public async Task <IActionResult> GetAssetCategories() { var res = await _assetsService.AssetCategoryGetAllAsync(); return(Ok(GetAssetCategoriesResponseModel.Create(res.Select(itm => itm.ConvertToApiModel()).ToArray()))); }