public PlaceModel(Place place)
 {
     this.Id = place.Id;
     this.Name = place.Name;
     this.Latitude = place.Latitude;
     this.Longitude = place.Longitude;
 }
        public HttpResponseMessage CreatePlace(string sessionKey, [FromBody] PlaceModelRegister place)
        {
            Place existingPlace = placesRepo.All().Where(p => p.Longitude == place.Longitude && p.Latitude == place.Latitude).FirstOrDefault();

            if (existingPlace != null)
            {
                return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, "This place already exists.");
            }

            User user = usersRepo.All().Where(u => u.SessionKey == sessionKey).FirstOrDefault();
            if (user == null)
            {
                return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Cannot create place. Session key and user don't match.");
            }

            Place pl = new Place()
            {
                Name = place.Name,
                Latitude = place.Latitude,
                Longitude = place.Longitude
            };

            pl.Users.Add(user);
            placesRepo.Add(pl);
            return this.Request.CreateResponse(HttpStatusCode.OK, place);
        }
        public PlaceDetails(Place place)
            : base(place)
        {
            foreach (var comment in place.Comments)
            {
                Comments.Add(new CommentModel(comment));
            }

            foreach (var user in place.Users)
            {
                Users.Add(new UserModel(user));
            }
        }