public static async Task<Shops> GetAll(Event oEvent) { var response = await Network.Get("/events/" + oEvent.id + "/shops"); if (response.IsSuccessStatusCode) return Network.Deserialize<Shops>(await response.Content.ReadAsStringAsync()); var errorHandler = Network.Deserialize<ErrorHandler>(await response.Content.ReadAsStringAsync()); Utils.Notify("Une erreur s'est produite", errorHandler.errors.First().message); return null; }
public static async Task<bool> Create(Event oEvent) { var response = await Network.Post("/events", Network.Serialize(oEvent), true); if (response.IsSuccessStatusCode) return true; var errorHandler = Network.Deserialize<ErrorHandler>(await response.Content.ReadAsStringAsync()); Utils.Notify("Une erreur s'est produite", errorHandler.errors.First().message); return false; }