Show / Hide Table of Contents

    Class GenericRepository<TEntity>

    Class that represents a repository for any entity in the context.

    Inheritance
    System.Object
    GenericReadOnlyRepository<TEntity>
    GenericRepository<TEntity>
    AccountRepository
    CharacterRepository
    Implements
    IReadOnlyRepository<TEntity>
    Inherited Members
    GenericReadOnlyRepository<TEntity>.Context
    GenericReadOnlyRepository<TEntity>.GetById(String)
    GenericReadOnlyRepository<TEntity>.GetAll()
    GenericReadOnlyRepository<TEntity>.FindMany(Expression<Func<TEntity, Boolean>>)
    GenericReadOnlyRepository<TEntity>.FindOne(Expression<Func<TEntity, Boolean>>)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Fibula.Data.Repositories
    Assembly: Fibula.Data.dll
    Syntax
    public abstract class GenericRepository<TEntity> : GenericReadOnlyRepository<TEntity>, IReadOnlyRepository<TEntity> where TEntity : BaseEntity
    Type Parameters
    Name Description
    TEntity

    The type of entity.

    Constructors

    | Improve this Doc View Source

    GenericRepository(DbContext)

    Initializes a new instance of the GenericRepository<TEntity> class.

    Declaration
    public GenericRepository(DbContext context)
    Parameters
    Type Name Description
    Microsoft.EntityFrameworkCore.DbContext context

    The context to use with this repository.

    Methods

    | Improve this Doc View Source

    Add(TEntity)

    Adds an entity to the set in the context.

    Declaration
    public void Add(TEntity entity)
    Parameters
    Type Name Description
    TEntity entity

    The entity to add.

    | Improve this Doc View Source

    AddRange(IEnumerable<TEntity>)

    Adds a range of entities to the set in the context.

    Declaration
    public void AddRange(IEnumerable<TEntity> entities)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TEntity> entities

    The entity range to add.

    | Improve this Doc View Source

    Remove(TEntity)

    Removes an entity from the set in the context.

    Declaration
    public void Remove(TEntity entity)
    Parameters
    Type Name Description
    TEntity entity

    The entity to remove.

    | Improve this Doc View Source

    RemoveRange(IEnumerable<TEntity>)

    Removes a range of entities from the set in the context.

    Declaration
    public void RemoveRange(IEnumerable<TEntity> entities)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TEntity> entities

    The entity range to remove.

    Implements

    IReadOnlyRepository<TEntity>

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.