コード例 #1
0
        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"));
            }
        }
コード例 #2
0
        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"));
            }
        }