コード例 #1
0
        public async Task <ActionResult> GetSubscriptions(int id)
        {
            try
            {
                if (await _repo.GetSubscriptionById(id) is CoreSubscriptions sub)
                {
                    var resource = ApiMapper.MapSub(sub);
                    return(Ok(resource));
                }
            }
            catch (NullReferenceException)
            {
                return(NotFound($"No Subscripttion with an id of {id} was found."));
            }

            return(Ok("There are no Subscriptions."));
        }