Skip to content

Dot Net Weekly Project#37

Open
PurpleDragon1999 wants to merge 19 commits into
cybergroupdevs:masterfrom
PurpleDragon1999:master
Open

Dot Net Weekly Project#37
PurpleDragon1999 wants to merge 19 commits into
cybergroupdevs:masterfrom
PurpleDragon1999:master

Conversation

@PurpleDragon1999

Copy link
Copy Markdown
Contributor

Project is partially completed. User Authorization is done. ADMIN can delete and view all employees.

@PurpleDragon1999
PurpleDragon1999 removed the request for review from niteshpandey31 February 11, 2020 09:31

[Route("getAllUsers")]
[HttpPost]
public IActionResult getAll([FromBody] CustomModels.CustomEmployee customEmployee)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Route should not contain http verbs in them . This is not restful practice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the issue here......

}

// GET api/values/5
[HttpGet("{id}")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused controller

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then what should I select for the default controller ? Because when we run the IIS Express, then by default it opens the browser for values controller.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we Not Run the Application without a default Controller being Set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can run the application without that, but just for checking that whether our service is running or not, I am using this.

{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
optionsBuilder.UseSqlServer(_config["dbConnection"]);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
Please Go through the link and fix the mistake

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the connection string from context file and startup file, and stored the connection string in appsettings.json.

<!-- <div class="dropdown show" id="empRole" style="display: none;">
<a class="btn-sm btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown link
</a>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the commented code.

{

if((_idbo.deleteEmp(customEmployee.Username, customEmployee.JwT)))
int temp = _idbo.deleteEmp(customEmployee.Username, customEmployee.JwT);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still Not Correct We should just receive an Id in case of Delete Not the Whole object

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sending only the token and username( which is a primary key in my case ), and all the other values will be null. The CustomModels' object gets only Username and token, and every other field will be null. From the frontend, I am passing only the username and token.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made another CustomModel which will only expect Username and token.

…l for handling Delete operations which will expect only Username and the token. 3. Modified the ValuesController by deleting unnecessary routes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants