Ejemplo n.º 1
0
        public void HandleRequest_GetAll_Test()
        {
            var target = CreateTarget();
            var result = target.HandleRequest(DataRequest <StitchInstance> .GetAll());

            result.Type.Should().Be(DataResponseType.Success);
            result.Entities.Count.Should().Be(3);
        }
Ejemplo n.º 2
0
        // TODO: We need to be get all stitch instances by:
        // 1) All stitches under a given application
        // 2) All stitches under a given application.component
        // 3) All stitches under a given application.component.version
        public IEnumerable <TEntity> GetAll <TEntity>()
            where TEntity : class, IDataEntity
        {
            var response = Bus
                           .Request <DataRequest <TEntity>, DataResponse <TEntity> >(DataRequest <TEntity> .GetAll());

            if (response == null)
            {
                return(Enumerable.Empty <TEntity>());
            }

            return(response.Entities);
        }
Ejemplo n.º 3
0
        private async void BackGroundRequests_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                var request = await DataRequest.GetAll(_Employe.GetAll, Security.Token);

                var employe = new Employe();

                employe = request.ToObject <Employe>();
                List <UserPointJson> result = JsonConvert.DeserializeObject <List <UserPointJson> >(employe.point.userPointJson);

                if (request != null)
                {
                    MessageBox.Show(request.ToString(), "API BackGround Task Result");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "API BackGround Task Result");
            }
        }
Ejemplo n.º 4
0
 private async void BackGroundRequests_DoWork(object sender, DoWorkEventArgs e)
 {
     var request = await DataRequest.GetAll(_Employe.GetAll, Security.Token);
 }