public void DeleteCoachInfo(CoachInfo coachInfo) { if (coachInfo == null) { throw new ArgumentNullException(nameof(coachInfo)); } _context.CoachInfos.Remove(coachInfo); }
public async Task <CoachInfo> GetCoachList() { CoachInfo retVal = null; HttpClient client = new HttpClient(); var coachResponse = await client.GetAsync(url.GetCoachUrl()); if (coachResponse.IsSuccessStatusCode) { var jsonPayload = await coachResponse.Content.ReadAsStringAsync(); retVal = System.Text.Json.JsonSerializer.Deserialize <CoachInfo>(jsonPayload); } return(retVal); }
public async Task AddCoachInfo(Guid userId, CoachInfo coachInfo) { if (userId == Guid.Empty) { throw new ArgumentNullException(nameof(userId)); } if (coachInfo == null) { throw new ArgumentNullException(nameof(coachInfo)); } coachInfo.AuthorId = userId; coachInfo.CreatedAt = DateTime.Now; coachInfo.UpdateAt = DateTime.Now; await _context.CoachInfos.AddAsync(coachInfo); }
public void UpdateCoachInfo(CoachInfo coachInfo) { }