public int Delete(int id) { DelevaryInfo delevaryInfoToDelete = context.DelevaryInfos.SingleOrDefault(d => d.DId == id); context.DelevaryInfos.Remove(delevaryInfoToDelete); return(context.SaveChanges()); }
public int Update(DelevaryInfo delevaryInfo) { DelevaryInfo delevaryInfoToUpdate = context.DelevaryInfos.SingleOrDefault(i => i.DId == delevaryInfo.DId); delevaryInfoToUpdate.DelevaryAddress = delevaryInfo.DelevaryAddress; delevaryInfoToUpdate.DelevaryCity = delevaryInfo.DelevaryCity; delevaryInfoToUpdate.DelevaryStatus = delevaryInfo.DelevaryStatus; delevaryInfoToUpdate.Pcategory = delevaryInfo.Pcategory; delevaryInfoToUpdate.PickUpAddress = delevaryInfo.PickUpAddress; delevaryInfoToUpdate.PickUpCity = delevaryInfo.PickUpCity; delevaryInfoToUpdate.price = delevaryInfo.price; delevaryInfoToUpdate.weight = delevaryInfo.weight; return(context.SaveChanges()); }
public int Insert(DelevaryInfo delevaryInfo) { context.DelevaryInfos.Add(delevaryInfo); return(context.SaveChanges()); }