public Volunteer Add(Volunteer volunteer) { volunteer.Id = _volunteers.Any() ? _volunteers.Max(v => v.Id) + 1 : 1; _volunteers.Add(volunteer); Save(); return volunteer; }
public IHttpActionResult Register(RegisterRequest register) { var volunteer = new Volunteer { FirstName = register.FirstName, LastName = register.LastName, Mobile = register.Mobile, Email = register.Email, PostCode = register.PostCode, PasswordHash = register.PasswordHash, Availability = false }; var volunteerWithId = _volunteerRepository.Add(volunteer); return Ok(volunteerWithId); }