Blacker.MangaScraper.Library.DAL.StorageDAL.GetChapterInfo C# (CSharp) Метод

GetChapterInfo() публичный Метод

public GetChapterInfo ( string id ) : DownloadedChapterInfo
id string
Результат DownloadedChapterInfo
        public DownloadedChapterInfo GetChapterInfo(string id)
        {
            if (String.IsNullOrEmpty(id))
                throw new ArgumentException("Id must not be null or empty.", "id");

            const string sql = BaseSelect + "WHERE ch.ChapterId=@ChapterId";

            using (var connection = GetConnection())
            using (var command = GetTextCommand(sql))
            {
                command.Parameters.AddWithValue("@ChapterId", id);

                var table = ExecuteDataTable(command, connection);

                if (table == null || table.Rows.Count != 1)
                    return null;

                return LoadDownloadInfoFromDataRow(table.Rows[0], LoadChapterFromDataRow(table.Rows[0]));
            }
        }