public HttpResponseMessage GetBoardMembersByProperty(int propertyId) { var repository = new BoardMembersRepository(); var result = repository.ListAllBoardMembers().Where(bm => bm.PropertyId == propertyId); return(Request.CreateResponse(HttpStatusCode.OK, result)); }
public HttpResponseMessage GetSingleBoardMember(int id) { var repository = new BoardMembersRepository(); var result = repository.GetBoardMemberById(id); return(Request.CreateResponse(HttpStatusCode.OK, result)); }
public HttpResponseMessage GetBoardMembersList() { var repository = new BoardMembersRepository(); var result = repository.ListAllBoardMembers(); return(Request.CreateResponse(HttpStatusCode.OK, result)); }
public HttpResponseMessage DeleteBoardMember(int id) { var repository = new BoardMembersRepository(); var result = repository.Delete(id); if (result) { return(Request.CreateResponse(HttpStatusCode.OK)); } return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Could not find board member")); }
public HttpResponseMessage AddNewBoardMember(BoardMembersDto boardmember) { var repository = new BoardMembersRepository(); var result = repository.Create(boardmember); if (result) { return(Request.CreateResponse(HttpStatusCode.Created)); } return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Board Member could not be added")); }
public BoardMembersService(BoardMembersRepository repo) { _repo = repo; }