public async Task <bool> SaveRegistartion(_1TE_MY.Models.Models.Registeration registration) { try { if (registration.RegistrationID > 0) { var regmodel = _context.Registration.Where(o => o.RegistrationID == registration.RegistrationID).FirstOrDefault(); regmodel.FullName = registration.FullName; regmodel.MobileNo = registration.MobileNo; regmodel.MobileCountryID = registration.MobileCountryID; regmodel.SecurityQuestion = registration.SecurityQuestion; regmodel.Answer = registration.Answer; _context.Update(regmodel); } else { _context.Add(registration); } await _context.SaveChangesAsync(); return(true); } catch (Exception ex) { throw; } }
public List <Merchant> AddMerchant(Merchant merchant) { if (merchant != null) { _context.Add(merchant); _context.SaveChanges(); } return(GetAllMerchants()); }