Mihneas22
Hosting an API
Hello! I want to host my API to the web but I don't rlly know what service to use. I have an ASP.NET Core API, Clean Arhitecture with a local SQL Server Database. What would be the best method to get it on the web along with the database? Thanks!
43 replies
Database In ASP.Net Core
Hello! So basically we all know when we create a SQL Database in Visual Studio Community with EF and SQLServer and we can store data there. My question is this: when we add the app to a website like Heroku or a Hosting App in order to publish it to the web, does the database with all the data gets added too or is there a separate process for that? Thanks!
60 replies
Get values from appsettings in .NET Core
Hello, I have this function in which I try to get a value from app settings file with the IConfiguration but it seems the method I got to use doesen't exist in this current context. How can I solve?
private readonly IConfiguration _configuration;
public APIKeyValidation(IConfiguration configuration)
{
_configuration = configuration;
}
public bool ValidateKey(string userApiKey)
{
if (userApiKey == null)
return false;
var apiKey = _configuration.GetValue<string>(ApiConstants.ApiKeyName);
if(apiKey == null || userApiKey != apiKey)
return false;
}
8 replies