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

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

Default API Controller class of Optical Fiber Network (OFN) model.

    1: using System;
    2: using System.Collections.Generic;
    3: using System.Linq;
    4: using System.Web.Http;
    5: using System.Web.Http.Results;
    6:  
    7: namespace Ia.Ftn.Wa.Api.Model.Controller
    8: {
    9:     ////////////////////////////////////////////////////////////////////////////
   10:  
   11:     /// <summary publish="true">
   12:     /// Default API Controller class of Optical Fiber Network (OFN) model.
   13:     /// </summary>
   14:     /// 
   15:     /// <remarks> 
   16:     /// Copyright © 2006-2017 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   17:     ///
   18:     /// 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
   19:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   20:     ///
   21:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   22:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   23:     /// 
   24:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   25:     /// 
   26:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   27:     /// </remarks> 
   28:     [Authorize]
   29:     public class Default2Controller : ApiController
   30:     {
   31:         ////////////////////////////////////////////////////////////////////////////
   32:  
   33:         /// <summary>
   34:         /// Echo the passed string
   35:         /// </summary>
   36:         [HttpGet]
   37:         [Route("api/v1/echo/{text}")]
   38:         public string Echo(string text)
   39:         {
   40:             return text;
   41:         }
   42:  
   43:         ////////////////////////////////////////////////////////////////////////////
   44:  
   45:         /// <summary>
   46:         /// Return current time
   47:         /// </summary>
   48:         [HttpGet]
   49:         [Route("api/v1/time")]
   50:         public string Time()
   51:         {
   52:             return DateTime.UtcNow.AddHours(3).ToString("yyyy-MM-dd HH:mm:ss.fff");
   53:         }
   54:  
   55:         ////////////////////////////////////////////////////////////////////////////
   56:         ////////////////////////////////////////////////////////////////////////////
   57:     }
   58: }