I know we have an authorization attribute.
[HttpGet("{id}")]
[Authorize]
public IActionResult Get(int id)
In the startup.cs
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, options =>...
Just a thought, even though if im not able to change the framework and other configuration settings, i guess the deployment team can change that according to the requirements, is that correct? I can just give them the code and they can make configuration settings as per their wish.
I am trying to learn API development. I am using .net 3.1(my org uses VS 2019 and it is only showing me this framework). I have chosen API template(that has a sample Weatherforecast API). Upon executing it,I can see plain JSON in chrome but I wanted swagger UI).
I am getting the following error...
In my organisation. we use VS 2019 version 16.11.21. When I clicked on API template or even ASP.net MVC Core web app, it only shows 3.1(out of support). I know now .net 5.0 is also out of support but in CS 2019, .net 6.0 is not working. When I tried changing the target framework to 5.0 from...
Hello,
I have to develop an application where i have to access service now tickets. The application should access certain types of tickets and ignore the rest. Is it possible in c# to connect to service now tickets?
Secondly, how to connect to the database that resides on AWS or any other...
Hello,
I am using the following test API -
https://97mm2.sse.codesandbox.io/teachers/200
{
"message":"Required Teacher",
"data":{
"id":200,
"firstName":"Jerold",
"lastName":"Britto",
"age":28,
"email":"britto@xyz.com",
"class":10,
"students":[...
Hello,
When I click on Login, it shows the following message -
Same thing happens when I click Register and Contact us. I was finally able to login by stumbling upon the following page when I tried to visit the admin profile.
The validation code is in the button click event. This is the first thing that I am checking.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{...
So, how should I exit an application with a specific error code?
For example, I have to a console application that I run using task scheduler, and I want the app to return a specific error code to task scheduler, I normally write Environment.Exit(1) or
If(this condition is true)...
I am creating a pdf using PDFsharp and saving it automatically on button click-
// Save the document...
string filename = "Barcode.pdf";
document.Save(@"E:\" + filename);
MessageBox.Show("PDF saved successfully!");
Instead of automatically saving it by...
Can we check for a part of string in hashtable key? For example, our key is
key = residentnumber +","+ housenumber
I know have a function called containskey() but do we have something that could partially check for a string in a hashtable key?
For example, if we could search...
I was manually specifying the xls extension. How can I automatically save it for excel then? I am so sorry it is so confusing for me and its almost 10 hours non stop of me trying to figure this out.
I have a very simple query
Select * from Employees
where company = 'Company A'
order by firstName
I want to run this query to run automatically on a daily basis and save the results in excel. Is their any way I can achieve this purpose?
I tried using SQL server jobs but the output excel file...
...//Create OleDbCommand to fetch data from Excel
using (OleDbCommand cmd = new OleDbCommand("Select * from [Sheet1$]", excelConnection))
{
excelConnection.Open();
using (OleDbDataReader...
Hello,
I am trying to upload an excel file into SQL server. The thing is I am stuck here
string fileName = Path.Combine(@"C:\", FileUpload1.FileName);
FileUpload1.SaveAs(fileName);
String excelConnString =...
Hello,
I am creating a test website for practice. The homepage looks like this -
On clicking test The view is
I want that when I click ID, a message should be displayed underneath the text box telling if the id is valid or invalid. Im using MVC architecture and connecting to database...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.