Exemplo n.º 1
0
        internal CommonRequest Find(int id)
        {
            var url  = $"{this._apiUrl}/Employees/Find?id={id}";
            var json = HttpConnector.Get(url);

            if (json.State == StateEnum.Success)
            {
                return(JsonConvert.DeserializeObject <CommonRequest>(json.Message));
            }
            else
            {
                return(json);
            }
        }
Exemplo n.º 2
0
        internal EmployeeCollection Read()
        {
            var url  = $"{this._apiUrl}/Employees/Read";
            var json = HttpConnector.Get(url);

            if (json.State == StateEnum.Success)
            {
                return(JsonConvert.DeserializeObject <EmployeeCollection>(json.Message));
            }

            var error = new EmployeeCollection()
            {
                State   = StateEnum.Fail,
                Message = json.Message,
            };

            return(error);
        }