コード例 #1
0
        public async Task <ILanguage> FetchLanguage(Guid guid)
        {
            using (DbDataReader reader = await dbLanguage.GetOne(guid))
            {
                if (reader.Read())
                {
                    Language language = new Language();
                    LoadFromReader(reader, language);
                    return(language);
                }
            }

            return(null);
        }
コード例 #2
0
        public async Task <ILanguage> FetchLanguage(Guid guid, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            using (DbDataReader reader = await dbLanguage.GetOne(guid))
            {
                if (reader.Read())
                {
                    Language language = new Language();
                    LoadFromReader(reader, language);
                    return(language);
                }
            }

            return(null);
        }