Beispiel #1
0
 public IHttpActionResult GetAllNotes()
 {
     try
     {
         NotesBS       BS         = new NotesBS();
         List <NoteDO> listNoteDO = BS.Fetch();
         return(Ok(listNoteDO));
     }
     catch (Exception)
     {
         Console.WriteLine("Something went wrong. Try again!");
         throw;
     }
 }
Beispiel #2
0
        public IHttpActionResult Post(NoteDO body)
        {
            try
            {
                NotesBS BS     = new NotesBS();
                NoteDO  noteDO = BS.Save(body.body);

                return(Ok(noteDO));
            }
            catch (Exception)
            {
                Console.WriteLine("Something went wrong. Try again!");
                throw;
            }
        }
Beispiel #3
0
        public IHttpActionResult GetQueriedNote([FromUri] string query)
        {
            try
            {
                NotesBS       BS     = new NotesBS();
                List <NoteDO> noteDO = BS.Fetch(query);

                return(Ok(noteDO));
            }
            catch (Exception)
            {
                Console.WriteLine("Something went wrong. Try again!");
                throw;
            }
        }
Beispiel #4
0
        public IHttpActionResult GetOneNote(int id)
        {
            try
            {
                NotesBS BS     = new NotesBS();
                NoteDO  noteDO = BS.Fetch(id);

                return(Ok(noteDO));
            }
            catch (Exception)
            {
                Console.WriteLine("Something went wrong. Try again!");
                throw;
            }
        }