示例#1
0
        public async Task <IActionResult> GetById(string id)
        {
            var model = await _operation.GetByIdAsync(id);

            if (model == null)
            {
                return(new JsonResult("Data not found")
                {
                    StatusCode = 401
                });
            }

            return(Ok(model));
        }
示例#2
0
 public async Task <SampleModel> GetById(string Id)
 {
     return(await _operation.GetByIdAsync(Id));
 }