Пример #1
0
        public async Task <IActionResult> Get(int id)
        {
            if (await genericService.Exists(id))
            {
                if (await genericService.Authorize(id, EntityRole.Viewer))
                {
                    TModel model = await genericService.Get(id);

                    return(Ok(model));
                }

                return(Unauthorized());
            }

            return(NotFound());
        }