public bool Create(AvailableToGuestCreateViewModel availableToGuestVM) { var availableToGuest = availableToGuestRep.GetByName(availableToGuestVM.Name); if (availableToGuest != null) { return(false); } AvailableToGuest add = new AvailableToGuest(); add.Name = availableToGuestVM.Name; availableToGuestRep.Create(add); availableToGuestRep.SaveChanges(); return(true); }
public void Create(AvailableToGuest availableToGuest) { db.Set <AvailableToGuest>().Add(availableToGuest); }