Skip to content

queoGmbH/csharp-commons.persistence

Repository files navigation

Commons.Persistence

Build Status Build Status

Description

To be able to query or change data persistently in a database, for example.

Class diagramm

class diagramm

Example

We want to use commons.persistance to get the number and a list of all movies contained in a given database.

Steps:

IGenericDao<Movie, int> _movieDao = new MovieDao<Movie, int>();
  • Create a new class to be able to implement the dao
public class MovieDao : GenericDao<Movie, int>
{
    public MovieDao(MovieContext dbContext) : base(dbContext)
    {
    }
}
  • Now you can use the dao to get all the data
IEnumerable allMovies = movieDao.GetAll();
  • Determine the number of films with the help of the Daos
public long AnzahlDerFilme()
{
    return allMovies.GetCount(); //returns amount of entities
}

How to use it

  • include Nuget-Package (queo.commons.persistance)
<PackageReference Include="Queo.Commons.Persistence" Version="3.0.0" />
  • Register the Dao
  • Create a new class to be able to implement the dao
  • Instantiate new Dao
  • Now you can use the Dao

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published