You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WF-PmAPI/WF_EF_Api/Shared/ISourceService.cs

47 lines
1.7 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Shared
{
public interface ISourceService<TSource>
{
// Retrieves a source by its unique identifier (id).
// 'id' is the unique identifier of the source.
Task<TSource> GetSourceById(int id);
// Retrieves a source by its title.
// 'title' is the title of the source to be retrieved.
Task<TSource> GetSourceByTitle(string title);
// Retrieves a source by its date.
// 'date' is the date associated with the source to be retrieved.
Task<PaginationResult<TSource>> GetSourceByDate(int date);
// Retrieves a source by its type.
// 'type' is the type of the source to be retrieved.
Task<TSource> GetSourceByType(int type);
// Retrieves all sources, with pagination support.
// This returns a list of all sources in the system.
Task<PaginationResult<TSource>> GetAll();
// Adds a new source to the system.
// 'source' is the source object that will be added.
Task AddSource(TSource source);
// Updates an existing source identified by its unique identifier ('id').
// 'id' is the unique identifier of the source to be updated
// 'source' contains the updated source data.
Task UpdateSource(int id, TSource source);
// Removes a source from the system based on its unique identifier ('id').
// 'id' is the unique identifier of the source to be removed.
Task RemoveSource(int id);
// Retrieves the unique identifier of the last added source.
Task<int> GetLastSourceId();
}
}