Code Examples Galore! Unleash the Power of Buzruk.GenericRepository

This section equips you with practical code snippets showcasing the core functionalities of Buzruk.GenericRepository. Dive into these examples and explore dedicated Wiki pages for each method, providing a comprehensive breakdown of usage and best practices.

CRUD Operations: Effortless Data Management

  1. Retrieving Entities:
    • Get (Synchronous): Grab a specific entity by ID with lightning speed. (Link to Wiki page for Get)
    • GetAsync (Asynchronous): Fetch an entity asynchronously for a smooth and responsive user experience. (Link to Wiki page for GetAsync)
    • GetPagedAsync (Asynchronous): Conquer large datasets by retrieving data in manageable chunks, ideal for pagination. (Link to Wiki page for GetPagedAsync)
  2. Creating Entities:
    • Add (Synchronous): Effortlessly create a new entity and add it to your data store. (Link to Wiki page for Add)
    • AddAsync (Asynchronous): Asynchronously add a new entity, keeping your UI responsive. (Link to Wiki page for AddAsync)
  3. Updating Entities:
    • Update (Synchronous): Modify an existing entity's properties and persist the changes. (Link to Wiki page for Update)
    • UpdateAsync (Asynchronous): Asynchronously update an entity, ensuring a smooth user experience. (Link to Wiki page for UpdateAsync)
  4. Deleting Entities:
    • Remove (Synchronous): Remove an entity from the data store efficiently. (Link to Wiki page for Remove)
    • RemoveAsync (Asynchronous): Asynchronously delete an entity, maintaining responsiveness. (Link to Wiki page for RemoveAsync)

Bulk Operations: Efficiency at Your Fingertips

  • AddRangeAsync (Asynchronous): Add multiple entities in a single asynchronous operation, optimizing performance for large datasets. (Link to Wiki page for AddRangeAsync)
  • UpdateRangeAsync (Asynchronous): Update multiple entities asynchronously, streamlining bulk modifications. (Link to Wiki page for UpdateRangeAsync)

Data Insights & Utility Methods

  • Exists (Synchronous): Swiftly check if an entity exists based on its ID. (Link to Wiki page for Exists)
  • ExistsAsync (Asynchronou): Asynchronously determine if an entity exists. (Link to Wiki page for ExistsAsync)
  • Count (Synchronous): Get the total number of entities in your data store. (Link to Wiki page for Count)
  • CountAsync (Asynchronous): Asynchronously retrieve the total entity count. (Link to Wiki page for CountAsync)
  • LongCount (Synchronous): Accurately count entities, even with massive datasets. (Link to Wiki page for LongCount)
  • LongCountAsync (Asynchronous): Asynchronously count a large number of entities. (Link to Wiki page for LongCountAsync)
  • CountBy (Synchronous): Count entities based on specific criteria for granular data insights. (Link to Wiki page for CountBy)
  • CountByAsync (Asynchronous): Asynchronously count entities based on conditions. (Link to Wiki page for CountByAsync)

Optional Advanced Features

  • Eager Loading (Optional): Boost performance by pre-fetching related entities when retrieving primary data (including an asynchronous EagerLoadAsync option). (Link to Wiki page for Eager Loading - if applicable)
  • Change Tracking (Optional): Track entity modifications for efficient saving updates (requires configuration). (Link to Wiki page for Change Tracking - if applicable)