// *********************************************************************** // Assembly : FCS.Lib.Utility // Author : fhdk // Created : 2023 01 23 07:31 // // Last Modified By: fhdk // Last Modified On : 2023 03 14 09:16 // *********************************************************************** // // Copyright (C) 2023-2023 FCS Frede's Computer Services. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; namespace FCS.Lib.Utility; /// /// Interface IRepositoryAsync /// /// The type of the t entity. public interface IAsyncReadonlyRepo where TEntity : class { /// /// Queryable /// /// IQueryable<TEntity>. IQueryable All(); /// /// All items asynchronous. /// /// The predicate. /// Task<IList<TEntity>>. Task> AllAsync(Expression> predicate); /// /// Any item asynchronous. /// /// The predicate. /// Task<System.Boolean>. Task AnyAsync(Expression> predicate); /// /// Finds the asynchronous. /// /// The predicate. /// Task<TEntity>. Task FindAsync(Expression> predicate); /// /// Firsts the asynchronous. /// /// The predicate. /// Task<TEntity>. Task FirstAsync(Expression> predicate); /// /// Firsts the or default asynchronous. /// /// The predicate. /// Task<TEntity>. Task FirstOrDefaultAsync(Expression> predicate); /// /// Anies the specified predicate. /// /// The predicate. /// true if XXXX, false otherwise. bool Any(Expression> predicate); /// /// Gets the by identifier. /// /// The identifier. /// TEntity. TEntity GetById(string id); }