Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

INewsService.cs

using Nop.Core;
using Nop.Core.Domain.News;

namespace Nop.Services.News;

/// 
/// News service interface
/// 
public partial interface INewsService
{
    #region News

    /// 
    /// Deletes a news
    /// 
    /// News item
    /// A task that represents the asynchronous operation
    Task DeleteNewsAsync(NewsItem newsItem);

    /// 
    /// Gets a news
    /// 
    /// The news identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the news
    /// 
    Task GetNewsByIdAsync(int newsId);

    /// 
    /// Gets all news
    /// 
    /// Language identifier; 0 if you want to get all records
    /// Store identifier; 0 if you want to get all records
    /// Page index
    /// Page size
    /// A value indicating whether to show hidden records
    /// Filter by news item title
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the news items
    /// 
    Task> GetAllNewsAsync(int languageId = 0, int storeId = 0,
        int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false, string title = null);

    /// 
    /// Inserts a news item
    /// 
    /// News item
    /// A task that represents the asynchronous operation
    Task InsertNewsAsync(NewsItem news);

    /// 
    /// Updates the news item
    /// 
    /// News item
    /// A task that represents the asynchronous operation
    Task UpdateNewsAsync(NewsItem news);

    /// 
    /// Get a value indicating whether a news item is available now (availability dates)
    /// 
    /// News item
    /// Datetime to check; pass null to use current date
    /// Result
    bool IsNewsAvailable(NewsItem newsItem, DateTime? dateTime = null);

    #endregion

    #region News comments

    /// 
    /// Gets all comments
    /// 
    /// Customer identifier; 0 to load all records
    /// Store identifier; pass 0 to load all records
    /// News item ID; 0 or null to load all records
    /// A value indicating whether to content is approved; null to load all records 
    /// Item creation from; null to load all records
    /// Item creation to; null to load all records
    /// Search comment text; null to load all records
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the comments
    /// 
    Task> GetAllCommentsAsync(int customerId = 0, int storeId = 0, int? newsItemId = null,
        bool? approved = null, DateTime? fromUtc = null, DateTime? toUtc = null, string commentText = null);

    /// 
    /// Gets a news comment
    /// 
    /// News comment identifier
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the news comment
    /// 
    Task GetNewsCommentByIdAsync(int newsCommentId);

    /// 
    /// Get news comments by identifiers
    /// 
    /// News comment identifiers
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the news comments
    /// 
    Task> GetNewsCommentsByIdsAsync(int[] commentIds);

    /// 
    /// Get the count of news comments
    /// 
    /// News item
    /// Store identifier; pass 0 to load all records
    /// A value indicating whether to count only approved or not approved comments; pass null to get number of all comments
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the number of news comments
    /// 
    Task GetNewsCommentsCountAsync(NewsItem newsItem, int storeId = 0, bool? isApproved = null);

    /// 
    /// Deletes a news comment
    /// 
    /// News comment
    /// A task that represents the asynchronous operation
    Task DeleteNewsCommentAsync(NewsComment newsComment);

    /// 
    /// Deletes a news comments
    /// 
    /// News comments
    /// A task that represents the asynchronous operation
    Task DeleteNewsCommentsAsync(IList newsComments);

    /// 
    /// Inserts a news comment
    /// 
    /// News comment
    /// A task that represents the asynchronous operation
    Task InsertNewsCommentAsync(NewsComment comment);

    /// 
    /// Update a news comment
    /// 
    /// News comment
    /// A task that represents the asynchronous operation
    Task UpdateNewsCommentAsync(NewsComment comment);

    #endregion
}