import { Injectable } from '@nestjs/common' ; import { InjectRepository } from '@nestjs/typeorm' ; import { Repository , UpdateResult , DeleteResult } from 'typeorm' ; import { Sampletable1 } from '../../entity/sampledb1' ; @ Injectable ( ) export class CrudService { constructor ( @ InjectRepository ( Sampletable1 ) private table ) { } public async create ( data ) { return this . table . save ( data ) ; } public async read ( id ) { return this . table . findOne ( id ) ; } public async update ( id , data ) { return this . table . update ( id , data ) ; } public async remove ( id ) { return this . table . delete ( id ) ; } }