Skip to content

Dot net project#35

Open
KritikaSachdeva wants to merge 3 commits into
cybergroupdevs:masterfrom
KritikaSachdeva:dotnetproject
Open

Dot net project#35
KritikaSachdeva wants to merge 3 commits into
cybergroupdevs:masterfrom
KritikaSachdeva:dotnetproject

Conversation

@KritikaSachdeva

Copy link
Copy Markdown

No description provided.

@rakshan1996 rakshan1996 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In Complete PR please add the .net project along with this.

return Ok("Employee data updated by patch!");
}

[Route("getAllUsers")]

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 include http verbs . Use Restful naming conventions

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

corrected route name from 'getAllUsers' to 'UsersList'.


namespace EmployeeProject.Controllers
{
[Route("api/[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.

Remove Unused Controller Files

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

removed ValuesController.cs

{
if (!optionsBuilder.IsConfigured)
{
#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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Connection string should not be present in Db context file . It should be initialized once in startup class and connection String should be read from app.settings.json

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

made the required changes

public class AdminController : ControllerBase
{

DbModels.projectContext _projectContext;

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 we are using complete refrence instead of relative to create instance of classes.



[HttpPost]
public IActionResult CreateEntry([FromBody] CustomModels.DetailsClass detailsClass)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please refer to the above comment and make necessary changes.

using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

using DbModels

public class LoginController : ControllerBase
{
private IConfiguration _config;
public DbModels.projectContext _projectContext;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

projectContext _projectContext;
also a Class name must not be CamelCase.

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