• Question

  • User1480781148 posted


    I want to inquire that in asp.net 4.5 is there any way I can put business logic in middle ware in form  of class. if answer is yes how can achieve this .

    thank you.

    Monday, October 13, 2014 1:33 PM


All replies

  • User-484054684 posted

    Yes, you can always create "Class libraries" and put all your logic there. Class library project can contain simple C# files and can produce dll out of it. You can later refer the dll in your project to consume those APIs.

    Other way of doing is, creating webservices or WCF services or Web APIs as business logic layers, where not just simple classes but you would need to write some set of additional code and config things to set up the framework.

    This article explains step-by-step points to create simple class libaries and refering it in various dotnet apps.


    Monday, October 13, 2014 2:47 PM
  • User1480781148 posted

    so we can define classes in web service and call them in asp.net. furthermore  which is best way among WCF and web api, I believe webapi can only called by  using jquery  or alternatively we can call  in asp.net using vb.

    thank you.



    Tuesday, October 14, 2014 10:47 AM
  • User-484054684 posted

    Hi Asad,

    Yes there are different approaches.

    1. Using Class libraries - these will produce simple dlls.

    2. Using webservice layers

       Webservice - asmx - old style - provides SOAP/XML format messages.

       WCF - offers many protocols and message types, including HTTP, tcp.ip, MSMQ, WS HTTP etc.

       Web API - If you want to have simple HTTP services - this is the place to go.

    Tuesday, October 14, 2014 12:15 PM
  • User1480781148 posted

    nice, we can call webapi from  any asp.net webpage or its jquery in order to call 

    Tuesday, October 14, 2014 12:41 PM
  • User-484054684 posted

    We can call WebAPI from normal applications also, JQuery is not mandatory.

    See this reference http://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-client

    Hope this helps.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 14, 2014 12:48 PM