how to connect couchdb with web api core - asp.net-core

want to connect to a CouchDb databse from asp.net core web api , but am having trouble finding the code to do so.
Can anyone help me with the code to do that? What is the 'normal' way of doing that?
Cheers!

You can use the MyCouch Library for .Net https://github.com/danielwertheim/mycouch

I had the same need and after evaluating the existing options, I created a set of mechanisms that met the requirements that I had to meet and made available on github and the nuget package.
The explanation of how to use it is on github.
Below is the link in case you want to take a look.
In time, to prevent someone from coming here and deleting my answer, I inform you that I have no intention of promoting what I did with this answer, just suggesting that you evaluate it and if it is your case, feel free to use it.
Link: Nuget Package |
Github
An example webapi core project follows how to make this connection and perform data operations with this lib: webapi core sample

Related

Installing Mailkit and setting up IEmailSender

I'm new to ASP Boilerplate and so far it's great. I'm a little confused on integrating email usage into my existing app.
the documentation for ASP Boilerplate says that the asp.net core version of the boilerplate does not include Mailkit but I'm not able to determine that.
The last thing i'm having an issue with is injecting and using the mail function. If anyone could share an example or provide a high level view of how this works it would be very appreciated.
thanks in advance!

What is the best way to use HTTPS in asp .net core?

I have published an asp.net core project(a website which made by asp.net core MVC) on a server(windows server 2018) and it works well for a long time.
And also, it used the HTTP all the time. As we know, now google suggest upgrade HTTP to HTTPS for more safely. So I wanna to upgrade it also.
I have applied for an SSL certificate yet and I found several ways to use HTTPS in asp.net core, such as:
The official way by adding so many codes in code-behind:
https://learn.microsoft.com/en-us/aspnet/core/security/enforcing-ssl?view=aspnetcore-2.2&tabs=visual-studio
By using PowerShell and edit some code in code-behind:
https://asp.net-hacker.rocks/2018/07/05/aspnetcore-ssl.html
By using some Nuget Package:
https://dzone.com/articles/enforce-ssl-and-use-hsts-in-net-core20-net-core-se
Just configure it in visual studio:
https://wildermuth.com/2016/10/26/Testing-SSL-in-ASP-NET-Core
But I tried all the way above and failed. Now I am crazy because there are so many ways and I don't know which one is right.
What's more, if all ways above can achieve it, then what's the difference between them and what's the advantage and disadvantage of them?
I am a beginner in web development and I have never been in touch with the HTTPS.
Would you please help me? Thank you.

Write IdentityServer4 logs to a log.txt file

We are using IdentityServer4 with ASP.NET Core. We want to write Identity Server's logs to an external file (i.g. log.txt). Can we do this via the log4net library?
From the relevant IdentityServer docs:
IdentityServer uses the standard logging facilities provided by ASP.NET Core.
So in essence, your question nearly duplicates this question about hooking up log4net in ASP.NET Core. The top answer for that question also explains how to add a rolling file appender, which is what you'd need to get what you want.
That basically answers your question as currently written. If you need more specific advise, I recommend asking a question with your current attempted code / steps to reproduce your scenario.
.Net Core has pretty good logging support straight out of the box.
Have a read of this: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?tabs=aspnetcore2x

LinkedIn External Login in ASP.NET Core 2.0

I need to implement external logins and had no problem with Facebook and Google since they are supported but I'm stuck at LinkedIn. I am not exactly a beginner but I'm not very experienced at this either. Prior to this post I viewed a thousand explanations and most of them were vague, others just didn't work and others were explained for advanced people.
What I've tried:
-using cookies in the Configure method, but the methods were deprecated (I figured they were not for the 2.0 version). I also tried app.UseLinkedInAuthentication(...) from Microsoft.AspNetCore.Authentication.LinkedIn to no success.
-writing a service in ConfigureServices (but I didn't get it to work, I assume this is where I need to do it). I also tried this but they were talking like they knew what they were doing.
So to keep this simple, I made a default MVC ASP.NET Core 2.0 application in Visual Studio 2017. All I need to do is write stuff in Startup.cs, so my question is, what is it that I have to write and why? Thank you very much in advance.
PS: I would appreciate an explanation in the comment, if it's a link I probably already visited it :)
There is AspNet.Security.OAuth.Providers repo that provides a collection of security middleware to support social authentication providers.
Corresponding releases can be found using this link: https://www.nuget.org/profiles/aspnet-contrib (all packages that start from AspNet.Security.OAuth)
Unfortunately, the current master branch is only for ASP.NET Core 1.0 and so nuget packages like package for LinkedIn were published only for that version, but you may clone the repo and switch to experimental branch that is an on-going port to ASP.NET Core 2.0.
Look into this github issue if you need the current status of porting.
By the way, according to this github issue, the LinkedIn authentication provider has been ported already.

What is the state of websockets on asp.net core

I would like to implement a websockets server with asp.net core. At the moment it seems that you have 2 different packages for this:
"Microsoft.AspNetCore.WebSockets.Server" : "0.1.0-*"
"Microsoft.AspNetCore.SignalR.Server": "0.2.0-*"
I have the following questions:
What's the difference between these 2 packages (I need the simplest implementation possible)
From the versioning, it seems that these packages are at an early alpha stage. Is there something more mature that I could use with .net core?
Can anyone provide me pointers to good tutorials on how to implement websockets with asp.net core? Google gives me somewhat outdated results
Websockets tutorial
SignalR Tutorial
As for maturity, I guess this is the best you can get at the moment.
I think you want to use Microsoft.AspNetCore.WebSockets. You can find some samples in the repo: https://github.com/aspnet/WebSockets