Пример #1
0
        public async Task <IActionResult> GetOne(string name)
        {
            using (var db = new AppDb())
            {
                await db.Connection.OpenAsync();

                var query  = new UserQuery(db);
                var result = await query.FindOneByNameAsync(name);

                if (result == null)
                {
                    return(new NotFoundResult());
                }
                return(new OkObjectResult(result));
            }
        }