Installing Mailkit and setting up IEmailSender - asp.net-core

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!

Related

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.

how to connect couchdb with web api 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

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.

Web API run VB6 COM components in STA mode

Masters,
I've few past developed VB6 components that are heavily used in our most of the applications
Now, we want to consume same components for newly developing Web API project.
But, as per this post ,
http://www.west-wind.com/weblog/posts/2012/Sep/18/Creating-STA-COM-compatible-ASPNET-Applications
We found strike on Asp.net Web API it might due to we don't have any page in Web API project.
Please tell me correct workaround achieve this.
Thanks in advance.
I would suggesting looking into the StaTaskScheduler http://blogs.msdn.com/b/pfxteam/archive/2010/04/07/9990421.aspx

Using autodocs with WCF REST Service Template 40

I'm looking for a documentation tool for REST services created using the 'WCF REST Service Template 40' and came across Autodocs (http://autodocs.codeplex.com/), however I'm not sure if they'll work together....
Anyone who has made it work or any suggestions to another tool to use for documentation (It's rather important that's it's the REST services which gets documented, and not the C# API)
TIA
Søren
Working with Autodocs for any length of time it becomes pretty obvious that the support is not there for the project yet. Its just too young. I ran into a few errors that stopped me from pursuing it after I found the documentation help methods integrated into WCF 4.0
The post explaining my error:
http://social.msdn.microsoft.com/Forums/eu/wcf/thread/b196a05f-2d28-449e-9620-a74f939a625f
WCF Web HTTP Service Help Page
http://msdn.microsoft.com/en-us/library/ee230442.aspx
Hope that helps you.