AzureFunctions.Code.TemplatesManager.GetTemplates C# (CSharp) Method

GetTemplates() public method

public GetTemplates ( string runtime ) : IEnumerable
runtime string
return IEnumerable
        public IEnumerable<FunctionTemplate> GetTemplates(string runtime)
        {
            if (_lock.TryEnterReadLock(Timeout.Infinite))
            {
                try
                {
                    return _templates.Any(t => t.Runtime == runtime)
                        ? _templates.Where(t => t.Runtime == runtime)
                        : _templates.Where(t => t.Runtime == "default");
                }
                finally
                {
                    _lock.ExitReadLock();
                }
            }
            else
            {
                return Enumerable.Empty<FunctionTemplate>();
            }
        }