Create Web API using SQLite .NET 4.5 - c#

I want to create a Web API in .NET Framework 4.5 (hosting enviroment that we are using requires only .NET 4 or 4.5 and not Core) using sqlite database. What is the right way to do implement a web api and connect it to the sqlite database in a way to deploy it directly through plesk? Please have in mind that we do not have a dedicated server and we are going to use Plesk to upload the published API.
Thanks in advance
I have already created the api, but I want some help with the creation of sqlite database and use of tables so to deploy it through Plesk.

Use google and reseach. It's not a single issue.

Related

Use SQLite in ASP.NET MVC web application instead of SQL Server

How to create a small ASP.NET MVC web application using SQLite database? I have tried so many ways and searched in web all of them showing using .NET Core & ASP.NET Core MVC, I don't need this.
But I need to create an ASP.NET MVC web application. I have tried by adding extension in Visual Studio 2019. I am not satisfied like using SQL Server.
I need just how to add SQLite to my ASP.NET MVC application. Please ask me if you need explanation. Please suggest a link or Youtube video. I am a beginner

How to set up an Odata service that supports $crossjoin, hosted on ASP.net core or separately

I'm working on a new web application in ASP.net core and currently use the OData WebApi. The issue I'm currently having is that one OData feature I want to use $Crossjoin is not supported by the web api. Also noted in this question from 2 years ago. And I have not seen any updates since.
Essentially I want to be able to use a query like this with Odata and have my application hosted on ASP.net Core:
http://host/service/$crossjoin(Products,Sales)?
$filter=Products/ID eq Sales/ProductID
So right now I'm assuming there is no way to get $Crossjoin to work with WebAPI. Are there any libraries that will support that protocol and can also be hosted on ASP.net core or at the same time? One that I came across OData V4 Service modules - SQL Connector that I can host using node.
The reason why I would like to use Crossjoin is because I cannot modify tables or add views to the database I am accessing. It does not use Primary or Foreign Keys. And I will want to be be able to join on multiple properties. I am also early into building my application so I don't mind migrating my current WebApi to something else to save me time in the future.
To have an idea of how my application looks, it is based off the ASP.NET Core Vue Starter template with Typescript. I am also using Microsoft SQL Server 2012, and Entity Framework Core.
Any suggestions are greatly appreciated, thank you.

Using ADO.NET in UWP apps possible?

I am trying to use ADO.NET so that my C# UWP app can access my Azure SQL database but when I try to refer to "System.Data.SqlClient", it is not readily available. I tried importing the "System.Data.dll" file but that led to a new host of errors.
I'm being led to believe that ADO.NET is not compatible with UWP apps. The problem with that is that I can't find another technology that will allow me to work with my Azure SQL database. Am I missing something here?
The best way to handle this is to create a full web api solution.
So, at the end, you will have
An Azure SQL Database
A Web API website , which will expose your datas in a JSON format. Using Entity Framework is not mandatory but can help in some way :)
An UWP application which will request your Web API endpoints
You will find here a complete solution : http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1
Latest UWP platform offers connectivity to SQl Server .
Please refer
https://learn.microsoft.com/en-us/windows/uwp/data-access/sql-server-databases

RESTful API Server in C#

Are there any frameworks that allow a RESTful API Server to be written in C#?
I have seen MVC 4, however this seems to be providing a view that you can see in the browser, I just require the API server and no view. It would be great if it was able to provide a streaming API too.
Thanks
If you are using .NET Framework 4.5 you can use Web API
If you are using .NET Framework 3.5 I highly recommend ServiceStack
If you are using .NET Core then you can use ASP.NET Core Web API
Nancy is a free REST framework for C#.
If you are working in .NET 4.0 or higher and looking for a pre-existing REST server solution that you can plug into (which it sounds like you are), you might want to check out Grapevine. You can get it using NuGet, and the project wiki has lots of sample code.
I am the project author, and I had a similar need as the one you described. Using resources I found here and elsewhere, I built Grapevine so that I would have a solution in my back pocket whenever I needed it again (DRY).
If you are ok with using IIS to host your app, WebAPI is the route to go, per the above answers. Not every solution is best in IIS however.
For executable apps (such as a windows service), consider using WebServicesHost. This page is a good example of how to implement it.
You can use web api, it is part of the .net MVC framework but it is relying on the razor engine (inly if you use the mvc templating engine cshtml).
If you are using .net 4.0 you can use web api 1,
If you are you .net 4.5 you can use web api 2
2022, no IIS/ASP answer:
Consider EmbedIO (and probably SWAN on top of that)
A tiny, cross-platform, module based, MIT-licensed web server for .NET Framework and .NET Core.

ASP.NET website to be deployed on Windows Azure with databases

I know this is a very common question and I could find several answers, but I think my situation is a bit different.
So, I have an ASP.NET Website (NOT a web application), built using "Web forms". Its a very simple website which does bunch of REST calls and talks to the SQL Server 2008. Can you please help me finding a step by step guide to deploy the same on Windows Azure using VS 2010? As of now, the website runs fine on a traditional web hosting server.
So far what I am getting are approaches which use MVC (and using ASP.NET web application, not website). I don't think that I should be concerned about MVC at all? Does a website vs. web application aspect make a difference? If yes, do I need to convert the website to web application?
There's a lot of content on web, so I am a bit confused given my condition. Can someone please put me in right direction? Thanks a lot.
You'll need to convert your Website project to an ASP.NET Web Role project, whether you first convert it to a ASP.NET Web Application or not doesn't really matter. The rest of the tutorial you already linked to applies just fine.
There's no need to look at ASP.NET MVC, It's a different technology than web forms, and there's no need to move to it in order to get your site hosted on Azure.
As for your database, unless you host that yourself in a VM-Role or somewhere else (and connect it using Azure Connect), you'll need to convert it to Sql Azure or Azure Table Storage. SQL Azure is largely compatible with SQL Server, but there are a few features which are unsupported.

Categories