Hey,
Perhaps another example will help here.
What follows is the list of methods that I return from my database. Almost all of them return some form of ArticleDetails, CommentDetails, or CategoryDetails, or List of these, but what those ArticleDetails represents changes. i.e. GetArticles, GetArticles based on a category id, etc.
Here ArticleDetails, CommentDetails and CategoryDetails are all one instance of a Custom Class that contain the definition of what that thing looks like, i.e. properties, fields, etc.Code:// methods that work with categories public abstract List<CategoryDetails> GetCategories(); public abstract CategoryDetails GetCategoryByID(int categoryID); public abstract bool DeleteCategory(int categoryID); public abstract bool UpdateCategory(CategoryDetails category); public abstract int InsertCategory(CategoryDetails category); // methods that work with articles public abstract List<ArticleDetails> GetArticles(); public abstract List<ArticleDetails> GetArticles(int categoryID); public abstract int GetArticleCount(); public abstract int GetArticleCount(int categoryID); public abstract List<ArticleDetails> GetPublishedArticles(DateTime currentDate); public abstract List<ArticleDetails> GetPublishedArticles(int categoryID, DateTime currentDate); public abstract int GetPublishedArticleCount(DateTime currentDate); public abstract int GetPublishedArticleCount(int categoryID, DateTime currentDate); public abstract ArticleDetails GetArticleByID(int articleID); public abstract bool DeleteArticle(int articleID); public abstract bool UpdateArticle(ArticleDetails article); public abstract int InsertArticle(ArticleDetails article); public abstract bool ApproveArticle(int articleID); public abstract bool IncrementArticleViewCount(int articleID); public abstract bool RateArticle(int articleID, int rating); public abstract string GetArticleBody(int articleID); // methods that work with comments public abstract List<CommentDetails> GetComments(); public abstract List<CommentDetails> GetComments(int articleID); public abstract int GetCommentCount(); public abstract int GetCommentCount(int articleID); public abstract CommentDetails GetCommentByID(int commentID); public abstract bool DeleteComment(int commentID); public abstract bool UpdateComment(CommentDetails article); public abstract int InsertComment(CommentDetails article);
Gary





Reply With Quote