Ejemplo n.º 1
0
        public IList <PlaceTypeListItemModel> GetPlaceTypes()
        {
            var result = placeTypeRepository.CreateQuery().Select(x => new PlaceTypeListItemModel
            {
                Id   = x.Id,
                Name = x.Name
            });

            return(result.ToList());
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }