我想做的是在添加
这是我的服务
public int Insert<T>(T model)
{
var consultation = Mapper.Map<T, Consultation>(model);
consultationRepository.Insert(consultation);
return consultation.id;
}
插入后,我将在我的服务中获取Id值,我只想在我的组件中获取该Id,以便在添加之后显示它
这是我的组件,
onSubmit(): void {
swal({
title: 'Are you sure?',
text: "You won't be able to revert this!",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, add it!'
}).then(() => {
this.model.DossierId = this.DossierId;
this.model.DoctorId = this.DoctorId;
this._consultationservice.post(this.model);
});
}
知道怎么做吗?谢谢你的帮助