public int CreateVolunteer(IVolunteer volunteerDTO) { Volunteer v = VolunteerFactory.CreateVolunteer(volunteerDTO); v = _store.Volunteers.Add(v); _store.SaveChanges(); return v.Id; }
public int CreateVolunteer(IVolunteer volunteerDTO) { Volunteer v = VolunteerFactory.CreateVolunteer(volunteerDTO); v = _store.Volunteers.Add(v); _store.SaveChanges(); return(v.Id); }
public override int CreateVolunteer(IVolunteer volunteer) { _store.CreateIfNotExists(); var blob = _store.GetBlockBlobReference($"{volunteer.Id}.txt"); var json = JsonConvert.SerializeObject(volunteer); blob.UploadText(json); return volunteer.Id; }
public override int CreateVolunteer(IVolunteer volunteer) { _store.CreateIfNotExists(); var blob = _store.GetBlockBlobReference($"{volunteer.Id}.txt"); var json = JsonConvert.SerializeObject(volunteer); blob.UploadText(json); return(volunteer.Id); }
public IHttpActionResult Post([FromBody] IVolunteer volunteer) { try { // TO-DO: replace with Created 201 response return(Ok(this.Service.CreateVolunteer(volunteer))); } catch (Exception) { return(InternalServerError()); } }
public static Volunteer CreateVolunteer(IVolunteer volunteerDTO) { if (volunteerDTO == null) return null; return new Volunteer { Id = volunteerDTO.Id, Description = volunteerDTO.Description, ZipCode = volunteerDTO.ZipCode, IsActive = volunteerDTO.IsActive }; }
public static Volunteer CreateVolunteer(IVolunteer volunteerDTO) { if (volunteerDTO == null) { return(null); } return(new Volunteer { Id = volunteerDTO.Id, Description = volunteerDTO.Description, ZipCode = volunteerDTO.ZipCode, IsActive = volunteerDTO.IsActive }); }
public AdminController(IDonation donation, ILoanDonor loanDonor, IRecurringDonation recurringDonation, ILoan loan, IContact contact, IUserProfile userProfile, ICause cause, IReview review, IVolunteer volunteer, IConfiguration config, IHttpContextAccessor accessor) { _cause = cause; _recurringdonation = recurringDonation; _loan = loan; _loandonor = loanDonor; _volunteer = volunteer; _donation = donation; _contact = contact; _review = review; _userprofile = userProfile; _config = config; _accessor = accessor; }
public IHttpActionResult Put(int id, [FromBody] IVolunteer volunteer) { try { this.Service.UpdateVolunteer(volunteer); return(StatusCode(HttpStatusCode.NoContent)); } catch (InvalidOperationException e) { return(BadRequest()); } catch (Exception e) { return(InternalServerError()); } }
public void UpdateVolunteer(IVolunteer volunteerDTO) { Volunteer oldV = _store.Volunteers .Include(x => x.User) .Single(x => x.Id == volunteerDTO.Id); _store.Entry(oldV).CurrentValues.SetValues(volunteerDTO); _store.Entry(oldV.User).CurrentValues.SetValues( new { FirstName = volunteerDTO.FirstName, LastName = volunteerDTO.LastName, Email = volunteerDTO.Email } ); _store.SaveChanges(); }
public void UpdateVolunteer(IVolunteer volunteer) { _volunteerList[volunteer.Id] = volunteer; }
public int CreateVolunteer(IVolunteer volunteer) { _volunteerList.Add(volunteer.Id, volunteer); return volunteer.Id; }
public virtual void UpdateVolunteer(IVolunteer volunteer) { _service.UpdateVolunteer(volunteer); }
public virtual int CreateVolunteer(IVolunteer volunteer) { return(_service.CreateVolunteer(volunteer)); }
public HomeController(IDisaster disasterSvc, IVolunteer volunteerSvc) { _disasterSvc = disasterSvc; _volunteerSvc = volunteerSvc; }
public VolunteerController(IVolunteer volunteer, IConfiguration config, IHttpContextAccessor accessor) { _volunteer = volunteer; _config = config; _accessor = accessor; }
public int CreateVolunteer(IVolunteer volunteer) { _volunteerList.Add(volunteer.Id, volunteer); return(volunteer.Id); }
public VolunteersController(IVolunteer volunteer) { Volunteer = volunteer; }
public HomeController(IDisaster disasterSvc, IVolunteer volunteerSvc, IWebSecurityWrapper webSecurity) { _disasterSvc = disasterSvc; _volunteerSvc = volunteerSvc; _webSecurity = webSecurity; }
public AccountController(IVolunteer volunteerSvc, ICluster clusterSvc) { _clusterSvc = clusterSvc; _volunteerSvc = volunteerSvc; }
public virtual int CreateVolunteer(IVolunteer volunteer) { return _service.CreateVolunteer(volunteer); }