public IList <PlaceTypeListItemModel> GetPlaceTypes() { var result = placeTypeRepository.CreateQuery().Select(x => new PlaceTypeListItemModel { Id = x.Id, Name = x.Name }); return(result.ToList()); }
public void CreatePlaceTypesForPlace(int placeId, string[] gTypes) { if (gTypes == null) { return; } foreach (var gType in gTypes) { var placeType = placeTypeRepository.CreateQuery().SingleOrDefault(x => x.GName == gType); if (placeType != null) { var placePlaceType = new PlacePlaceType { PlaceId = placeId, PlaceTypeId = placeType.Id }; placePlaceTypeRepository.Insert(placePlaceType); } } }