public async Task <ResponseBaseModel <User> > GetUser(int code) { var response = new ResponseBaseModel <User>(); try { var result = await _serviceClient.GetAsync(new UserCode { Code = code }); response.SetData(result); } catch (Exception e) { response.SetErrorMsg(e.Message); } return(response); }
public async Task <ResponseBaseModel <IEnumerable <User> > > GetUsers() { var response = new ResponseBaseModel <IEnumerable <User> >(); try { var result = await _serviceClient.GetAllAsync(new Empty()); response.SetData(result.Value); } catch (Exception e) { response.SetErrorMsg(e.Message); } return(response); }