)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » TempController (Ia.Api.Wa.Controllers.Db)

Public general use code classes and xml files that we've compiled and used over the years:

DB Temp API Controller class.

    1: using Microsoft.AspNetCore.Mvc;
    2: using System.Net;
    3:  
    4: namespace Ia.Api.Wa.Controllers.Db
    5: {
    6:     ////////////////////////////////////////////////////////////////////////////
    7:  
    8:     /// <summary publish="true">
    9:     /// DB Temp API Controller class.
   10:     /// </summary>
   11:     /// 
   12:     /// <remarks> 
   13:     /// Copyright © 2019-2024 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   14:     ///
   15:     /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
   16:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   17:     ///
   18:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   19:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   20:     /// 
   21:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   22:     /// 
   23:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   24:     /// </remarks> 
   25:     [ApiController]
   26:     [Route("api/db")]
   27:     public class TempController : ControllerBase
   28:     {
   29:         private static readonly object objectLock = new object();
   30:  
   31:         ////////////////////////////////////////////////////////////////////////////
   32:  
   33:         /// <summary>
   34:         /// 
   35:         /// </summary>
   36:         [HttpPost]
   37:         [Route("temp/object/{name}/write")]
   38:         public HttpStatusCode PostDbTempObject<T>(string name, T t)
   39:         {
   40:             //Cl.IaDbContext.Temp.Object.Write(name, t);
   41:  
   42:             return HttpStatusCode.OK;
   43:         }
   44:  
   45:         ////////////////////////////////////////////////////////////////////////////
   46:  
   47:         /// <summary>
   48:         /// 
   49:         /// </summary>
   50:         [HttpGet]
   51:         [Route("temp/object/{name}/read")]
   52:         public T? GetDbTempObjectForName<T>(string name)
   53:         {
   54:             T? t;
   55:  
   56:             if (!string.IsNullOrEmpty(name))
   57:             {
   58:                 t = default;// Cl.IaDbContext.Temp.Object.Read<T>(name);
   59:             }
   60:             else t = default;
   61:  
   62:             return t;
   63:         }
   64:  
   65:         ////////////////////////////////////////////////////////////////////////////
   66:         ////////////////////////////////////////////////////////////////////////////
   67:     }
   68:  
   69:     ////////////////////////////////////////////////////////////////////////////
   70:     ////////////////////////////////////////////////////////////////////////////
   71: }