示例#1
0
 private IActionResult FetchByAlternateKey <T>(String entity, String field, string email)
 {
     try
     {
         return(Json(ActiveModel.GetRecordByFieldValue <T>(entity, field, email)));
     }
     catch (Exception e)
     {
         return(NotFoundHandler(e));
     }
 }
示例#2
0
 private IActionResult ListForField <T>(String entity, String field, int value)
 {
     try
     {
         return(Json(ActiveModel.GetTableByFieldValue <T>(entity, field, value.ToString())));
     }
     catch (Exception e)
     {
         return(NotFoundHandler(e));
     }
 }
示例#3
0
 private IActionResult FetchById <T>(String entity, int id)
 {
     try
     {
         return(Json(ActiveModel.GetRecordById <T>(entity, id)));
     }
     catch (Exception e)
     {
         return(NotFoundHandler(e));
     }
 }
示例#4
0
        private const int PAGESIZE = 10;  // maximum number of items on latest page

        private IActionResult ListAll <T>(String entity)
        {
            try
            {
                return(Json(ActiveModel.GetTableForEntity <T>(entity)));
            }
            catch (Exception e)
            {
                return(NotFoundHandler(e));
            }
        }
示例#5
0
 private IActionResult ListLatestByFieldValue <T>(String Entity, String Field, String Value)
 {
     try
     {
         return(Json(ActiveModel.GetLatestByFieldValue <T>(Entity, Field, Value, PAGESIZE)));
     }
     catch (Exception e)
     {
         return(NotFoundHandler(e));
     }
 }
示例#6
0
 private IActionResult ListLatest <T>(String entity)
 {
     try
     {
         return(Json(ActiveModel.GetLatest <T>(entity, PAGESIZE)));
     }
     catch (Exception e)
     {
         return(NotFoundHandler(e));
     }
 }