public HttpResponseMessage GetAllMemberShipTypes() { LibraryUserRepository LibraryUsers = new LibraryUserRepository(); IEnumerable <LibraryUser> lsLibraryUsers; lsLibraryUsers = LibraryUsers.GetLibraryUsers(); if (lsLibraryUsers.Count() > 0) { return(Request.CreateResponse(HttpStatusCode.OK, lsLibraryUsers)); } { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Item not found")); } }
public HttpResponseMessage GetMemberShipTypesByID(int id) { LibraryUserRepository ctxLibraryUsers = new LibraryUserRepository(); LibraryUser _LibraryUser = ctxLibraryUsers.GetLibraryUsers().FirstOrDefault(x => x.LibraryUserID == id); if (_LibraryUser != null) { return(Request.CreateResponse(HttpStatusCode.OK, _LibraryUser)); } { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Item not found")); } }