Ejemplo n.º 1
0
        public async Task <IActionResult> GetBranchesOfCompany(
            [FromRoute] int companyId,
            [FromQuery] BranchFilter filterModel,
            [FromQuery] Sortable sortable,
            [FromQuery] Paginable paginable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                var branchList = await _branchManager.GetBranchesByCompany(companyId, filterModel, sortable, paginable);

                return(Ok(branchList));
            }
            catch (KeyNotFoundException ex)
            {
                return(NotFound(ex.Message));
            }
        }