Exemplo n.º 1
0
        public async Task HandleGetCustomerForEditAction(GetCustomerForEditAction action, IDispatcher dispatcher)
        {
            Console.WriteLine("Getting customer with Id: 42");

            await Task.Delay(1000);

            string jsonFromServer   = $"{{\"Id\":42,\"RowVersion\":\"AQIDBAUGBwgJCgsMDQ4PEA==\",\"Name\":\"Our first customer\"}}";
            var    objectFromServer = JsonConvert.DeserializeObject <CustomerEdit>(jsonFromServer);

            dispatcher.Dispatch(new GetCustomerForEditResultAction(objectFromServer));
        }
Exemplo n.º 2
0
 public static EditCustomerState Reduce(EditCustomerState state, GetCustomerForEditAction action) =>
 new EditCustomerState(isLoading: true);