public async Task <int> CreateAsync <TSource, TDestination>(TSource item) where TSource : class where TDestination : class { try { GetProperties(item); string uri = FormatUriWithIds <TDestination>(); token = await _jwt.CheckTokenAsync(token); var response = await _http.PostAsync <TSource, TSource>(item, uri, "AdminClient", token.Token); return((int)response.GetType().GetProperty("Id").GetValue(response)); } catch { throw; } }
public async Task <int> CreateAsync <TSource, TDestination>(TSource item) where TSource : class where TDestination : class { try { GetProperties(item); string uri = FormatUriWithIds <TDestination>(); _token = await _jwtTokenService.CheckTokenAsync(_token); var response = await _http.PostAsync <TSource, TDestination>(item, uri, AppConstants.HttpClientName, _token.Token); return((int)response.GetType() .GetProperty("Id") .GetValue(response)); } catch (Exception ex) { throw; } }