📜  adonis prepare create - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:21.930000             🧑  作者: Mango

代码示例1
import User from 'App/Models/User'
const user = new User()

// Assign username and email
user.username = 'virk'
user.email = 'virk@adonisjs.com'

// Insert to the database
await user.save()

console.log(user.$isPersisted) // true