public IActionResult GetBranchById(int BranchId)
        {
            if (BranchId < 1)
            {
                return(BadRequest());
            }

            var branches = BranchManager.GetBranchById(BranchId);

            if (branches == null)
            {
                return(NotFound());
            }

            return(Ok(branches));
        }
Пример #2
0
        public async Task <IActionResult> Get([FromRoute] Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var branchDetail = await _branchManager.GetBranchById(id);

                if (branchDetail == null)
                {
                    return(NotFound());
                }

                return(Ok(branchDetail));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }