public async Task <BusDetailModel> Add(BusDetailModel item) { await this.context.BusDetail.AddAsync(item); await this.context.SaveChangesAsync(); return(item); }
public async Task <BusDetailModel> Update(BusDetailModel item) { if (item != null) { this.context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Modified; await this.context.SaveChangesAsync(); } return(item); }
public string Save(BusDetailModel model) { model.CreatedDate = DateTime.Now; model.ID = Guid.NewGuid(); var data = _busRepo.Add(model); if (data.IsCompletedSuccessfully) { return("success"); } else { return("Error"); } }