import { Injectable } from '@nestjs/common'; import { Repository, InjectRepository } from '@nestjs/azure-database'; import { Profile } from './profile.entity'; @Injectable() export class ProfileService { private readonly partitionKey: string = 'profile'; constructor( @InjectRepository(Profile) private readonly profileRepository: Repository ) {} async find(rowKey: string): Promise { return await this.profileRepository.find(this.partitionKey, rowKey); } async findAll(): Promise { return await this.profileRepository.findAll(); } async create(profile: Profile): Promise { return await this.profileRepository.create(profile); } async update(rowKey: string, profile: Profile): Promise { return await this.profileRepository.update( this.partitionKey, rowKey, profile ); } async delete(rowKey: string): Promise { await this.profileRepository.delete(this.partitionKey, rowKey); } }