Exemple #1
0
        public async Task <ActionResult> OnGet(int id)
        {
            var lxRslt = await LblBO.Get(id);

            if (lxRslt.Err != null)
            {
                TempData["ExErr"] = lxRslt.Err;

                return(Page());
            }
            Lbl = lxRslt.Sngl;

            return(Page());
        }
        public async Task <ActionResult <LblModel> > Get(int id)
        {
            bool lxLblExists = await LblBO.Exists(id);

            if (!lxLblExists)
            {
                return(NotFound());
            }

            var lxRslt = await LblBO.Get(id);

            if (lxRslt.Err == null)
            {
                var lxLbl = lxRslt.Sngl;
                return(Ok(lxLbl));
            }
            else
            {
                return(BadRequest(lxRslt.Err));
            }
        }