Beispiel #1
0
        public HttpResponseMessage GetAllBookIssueds()
        {
            BookIssuedRepository     ctxBookIssued = new BookIssuedRepository();
            IEnumerable <BookIssued> lsBookIssueds;

            lsBookIssueds = ctxBookIssued.GetBookIssued();
            if (lsBookIssueds.Count() > 0)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, lsBookIssueds));
            }
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Item not found"));
            }
        }
Beispiel #2
0
        public HttpResponseMessage GetBookIssuedByID(int id)
        {
            BookIssuedRepository ctxBookIssued = new BookIssuedRepository();

            BookIssued _BookIssued = ctxBookIssued.GetBookIssued().FirstOrDefault(x => x.BookIssuedID == id);

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