Ejemplo n.º 1
0
    static async Task ExecutePostEvaluationBatch(FlagrClient client)
    {
        var entityContext = new JObject();

        entityContext.Add("state", "NY");

        var ent = new Entity()
        {
            entityID      = "127",
            entityType    = "user",
            entityContext = entityContext,
        };

        var req = new BatchEvalContext()
        {
            entities = new List <Entity>()
            {
                ent,
            },
            enableDebug = true,
            flagIDs     = new List <int>()
            {
                1
            },
        };

        var resp = await client.PostEvaluationBatch(req);

        Console.WriteLine(JsonConvert.SerializeObject(resp, Formatting.Indented));
    }
Ejemplo n.º 2
0
    static async Task Main(string[] args)
    {
        var httpClient = new HttpClient();
        var client     = new FlagrClient(httpClient, "https://try-flagr.herokuapp.com/api/v1");

        await ExecutePostEvaluation(client);
        await ExecutePostEvaluationBatch(client);
    }