コード例 #1
0
        public virtual async Task <ActionResult <TEnttiy> > Get(int id)
        {
            try
            {
                var result = await GeneralDB.GetById(id);

                if (result == null)
                {
                    return(NotFound($"Cannot Find {typeof(TEnttiy).Name} with id {id}"));
                }

                return(Ok(result));
            }// try
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            } // catch
        }