예제 #1
0
        public HttpResponseMessage GetAllLibLibMemeberShip()
        {
            LibMemberShipRepository      LibMemberShips = new LibMemberShipRepository();
            IEnumerable <LibMemeberShip> lsLibMemeberShips;

            lsLibMemeberShips = LibMemberShips.GetLibMemberShip();
            if (lsLibMemeberShips.Count() > 0)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, lsLibMemeberShips));
            }
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Item not found"));
            }
        }
예제 #2
0
        public HttpResponseMessage GetLibLibMemeberShipID(int id)
        {
            LibMemberShipRepository ctxLibMemberShips = new LibMemberShipRepository();

            LibMemeberShip _LibMemeberShip = ctxLibMemberShips.GetLibMemberShip().FirstOrDefault(x => x.LibMemberShipID == id);

            if (_LibMemeberShip != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, _LibMemeberShip));
            }
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Item not found"));
            }
        }