Git Product home page Git Product logo

dotnet-shopping-cart's People

Contributors

prinx avatar

Watchers

 avatar  avatar

dotnet-shopping-cart's Issues

Improve you responses

Try to make you response the same format:
ie:
{
"success": true,
"message": "Item added to cart", //this could be nice error messages in case of failure
"data": {
.....
}
}

Also avoid using SingleOrDefault, do a little research about FindAsync and FirstOrDefaultAsync and use the one that makes more sense

Some more issues to fix

Sir Prince,
I must say you have done very well so far.
The hope is that you will pick quickly when given the chance and assistance.
Try to fix these few issues for us in the meantime:

  • If you can push your changes to a dev branch and create a PR it will make review easier.

  • Any code especially those that have external dependency such as database... have the potential to throw an exception. Please try catch the exceptions in all such method.

  • ILogger can not be resolved in User and Product controllers and that is breaking your code please check it

https://stackoverflow.com/questions/52921966/unable-to-resolve-ilogger-from-microsoft-extensions-logging
Read the question well

  • You are not validating user input that is breaking your code - try to create and or update a product without passing the name and see.
    You will notice the code breaks on the create without any exception handling and the update set the product name to null which should not be allowed.

  • When I tried to delete a product with an id that does not exist I get this
    {
    "status": 201,
    "success": true,
    "message": "Product created successfully.",
    "data": null
    }
    With response code 404

  • When I pass a phoneNumber that is not string the code breaks please validate it and return a nice response and again handle exceptions

  • CartItemController line 110 is not needed
    Avoid doing this
    //_db.Entry(cartItem).State = EntityState.Added;

  • /api/CartItems/user/{id}
    This endpoint is not returning accurate data

  • Finally check the assignment well and make the filters on Cart conform to the requirement

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.