public int Update(DbEducation education) { var rem = _context.Find <DbEducation>(education.Id); if (rem == null) { return(0); } if (education.Type != null) { rem.Type = education.Type; } if (education.University != null) { rem.University = education.University; } if (education.Specialty != null) { rem.Specialty = education.Specialty; } if (education.View != null) { rem.View = education.View; } if (education.Employee != null) { rem.Employee = education.Employee; } var b = _context.Update(rem); return(b); }
public ActionResult Put(DbEducation Education) { var result = _service.Update(Education); if (result > 0) { return(Ok()); } return(BadRequest()); }
public ActionResult Add(DbEducation Education) { var result = _service.Add(Education); if (result > 0) { return(Ok()); } return(BadRequest()); }
public async Task <bool> AddEducation(DbEducation education) { var client = _clientFactory.CreateClient("api"); var response = await client.PostAsJsonAsync("Education", education); if (response.IsSuccessStatusCode) { return(true); } return(false); }
public int Add(DbEducation education) { var b = _context.Create(education); return(b); }