public async Task <IHttpActionResult> InsertVaiTro([FromBody] VaiTro vaitro) { VaiTroRepository repo = new VaiTroRepository(_connectionString); vaitro.NgayTaoDT = DateTime.Now; vaitro.NgaySuaDT = DateTime.Now; var result = await repo.Insert(vaitro); return(Content(HttpStatusCode.OK, result)); }
public async Task <IHttpActionResult> InsertVaiTroTest() { VaiTroRepository repo = new VaiTroRepository(_connectionString); VaiTro vaitro = new VaiTro(); vaitro.MaVaiTro = Guid.NewGuid().ToString(); vaitro.TenVaiTro = Guid.NewGuid().ToString(); vaitro.KhoaYN = false; vaitro.CtrVersion = 1; VaiTro objResult = await repo.Insert(vaitro); return(Ok(objResult)); }