public string Post(grocsell obj) { var ob = _context.grocitems.Where(x => x.GrocId == obj.GrocId).FirstOrDefault(); if (ob != null) { _context.grocsells.Add(obj); _context.SaveChanges(); return("Congrats!Successfully added"); } else { return("Sorry,the grocery item is not present in main table"); } }
public string Post(grocitem obj) { _context.grocitems.Add(obj); _context.SaveChanges(); return("Congrats!Successfully added"); }