Exemplo n.º 1
0
        /// <summary>
        /// Получитьтаблицу клиента по идентификатору.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="sclm"></param>
        /// <param name="tableId"></param>
        /// <returns></returns>
        public static async Task <StoryTable <T> > GetTableAsync <T>(this SCLM sclm, int tableId) where T : class, new()
        {
            StoryTable <T> table = await sclm.GETAsync <StoryTable <T> >(new Uri($"{sclm.GetEndpoint(api)}{Version}/{Path}/{tableId}", UriKind.Absolute), CancellationToken.None);

            table._sclm = sclm;
            return(table);
        }
Exemplo n.º 2
0
        public static async Task <StoryTable <T> > GetTableAsync <T>(this SCLM sclm, string name) where T : class, new()
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }
            StoryTable <T> table = await sclm.GETAsync <StoryTable <T> >(new Uri($"{sclm.GetEndpoint(api)}{Version}/{Path}/{name}", UriKind.Absolute), CancellationToken.None);

            table._sclm = sclm;
            return(table);
        }