public GroupNotification add(GroupNotification store) { logger.Info("Add Store: "); try { if (store == null) { throw new ArgumentNullException("Store"); } List <Customer> customers = new List <Customer>(); foreach (var item in store.Customer) { Customer cuslist = context.Customers.Where(x => x.CustomerId == item.CustomerId).FirstOrDefault(); customers.Add(cuslist); } store.Customer = customers; context.AddGroupNotification(store); logger.Info("End Add Store: "); return(store); } catch (Exception ex) { logger.Error("Error in Add Store " + ex.Message); return(null); } }