/// <summary> /// Add a new nearby /// </summary> /// <param name="name">The name of the nearby place</param> /// <param name="location">The location of the nearby place</param> /// <param name="type">The type of the nearby place</param> /// <returns>A new nearby place</returns> public Nearby AddNearby(string name, string location, NearbyType type) { Nearby nearby = new Nearby(name, location, type); context.NearbyPlaces.Add(nearby); context.SaveChanges(); return(nearby); }
public JsonResult AddNearby(string name, string location, NearbyType type) { AcomodationService service = new AcomodationService(); var nearbyPlace = service.AddNearby(name, location, type); return(new JsonResult() { Data = new { NearbyPlace = nearbyPlace }, ContentEncoding = Encoding.UTF8, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public Nearby(string Name, string Location, NearbyType Type) { this.Name = Name; this.Location = Location; this.Type = Type; }