示例#1
0
        public virtual async Task <IActionResult> Get(int id)
        {
            try
            {
                var result = await reader.Get(id);

                if (result == null)
                {
                    return(NotFound(new NotFoundException()));
                }
                else
                {
                    return(Ok(result));
                }
            }
            catch (Exception ex)
            {
                return(ErrorRetrieving(ex.StackTrace));
            }
        }
示例#2
0
        public async Task Delete(int id)
        {
            var entity = await _reader.Get(id);

            await Delete(entity as T);
        }