internal static Event ToClient(this G.Event e)
 {
     return(new Event
     {
         EventId = e.EventId,
         EventType = e.EventType,
         EventName = e.EventName,
         EventDescription = e.EventDescription,
         EventOrg = e.EventOrg,
         EventDate = e.EventDate,
         EventLocation = e.EventLocation,
         EventPrice = e.EventPrice
     });
 }
 public static d.Event ToLocal(this g.Event e)
 {
     return(new d.Event
     {
         EventId = e.EventId,
         EventType = e.EventType,
         EventName = e.EventName,
         EventDescription = e.EventDescription,
         EventOrg = e.EventOrg,
         EventDate = e.EventDate,
         EventLocation = e.EventLocation,
         EventPrice = e.EventPrice
     });
 }
        public void CreateEvent(Event entity)
        {
            HttpContent content = new StringContent(JsonConvert.SerializeObject(entity));

            content.Headers.ContentType = new MediaTypeHeaderValue("application/json");

            HttpResponseMessage responseMessage = _httpClient.PostAsync($"event/", content).Result;

            responseMessage.EnsureSuccessStatusCode();

            string json = responseMessage.Content.ReadAsStringAsync().Result;

            G.Event newEvent = JsonConvert.DeserializeObject <G.Event>(json);
            newEvent.ToClient();
        }