Skip to content

Instantly share code, notes, and snippets.

@davidcsejtei
Created October 18, 2020 09:28
Show Gist options
  • Select an option

  • Save davidcsejtei/2945469785817dede5cc3f0ca042f0ad to your computer and use it in GitHub Desktop.

Select an option

Save davidcsejtei/2945469785817dede5cc3f0ca042f0ad to your computer and use it in GitHub Desktop.
User Repository for TypeORM
import {EntityRepository, Repository} from "typeorm";
import {User} from "../entities/User";
@EntityRepository(User)
export class UserRepository extends Repository<User> {
findByName(name: string) {
return this.findOne({ name });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment