public ActionResult <User> GetUser(Guid id)
        {
            try
            {
                // obrisano iz uslova && x.IsDeleted == false zbog invoice-a ovde i kod customer controller-a
                var user             = _userService.AsQueryable().FirstOrDefault(x => x.Id == id);
                var invoicesResponse = _invoiceService.AsQueryable().Where(x => x.IssuerId == id);


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

                return(Ok(user));
            }
            catch (Exception e)
            {
                return(BadRequest(e.GetBaseException().Message));
            }
        }
Exemple #2
0
        public ActionResult <Invoice> GetInvoice(Guid id)
        {
            try
            {
                var invoice = _invoiceService.AsQueryable().FirstOrDefault(x => x.Id == id && x.IsDeleted == false);

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

                return(Ok(invoice));
            }
            catch (Exception e)
            {
                return(BadRequest(e.GetBaseException().Message));
            }
        }