public async Task <IActionResult> PutLog(int id, Log log) { if (id != log.LogId) { return(BadRequest()); } _context.Entry(log).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LogExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task CreateCustomer(Customer customer) { var db = new DsContext(); await db.customer.AddAsync(customer); await db.SaveChangesAsync(); }
public async Task CreateVendor(Vendors vendor) { var db = new DsContext(); await db.Vendor.AddAsync(vendor); await db.SaveChangesAsync(); }
public async Task <ActionResult <Vendor> > PostTodoItem(Vendor vendors) { var dbContext = new DsContext(); var vend = dbContext.Vendors.Where(u => u.UserName == vendors.UserName && u.Password == vendors.Password); if (vend != null) { dbContext.Vendors.Add(vendors); await dbContext.SaveChangesAsync(); } //return CreatedAtAction("GetTodoItem", new { id = todoItem.Id }, todoItem); return(CreatedAtAction(nameof(Vendor), new { id = vendors.VendorId }, vendors)); }