Giter VIP home page Giter VIP logo

Comments (11)

bmaluijb avatar bmaluijb commented on June 4, 2024

Hi! The main branch is the one that creates the Cosmos DB and fills it with a collection and documents. All of this happens in CosmosDBConnector.cs. Can you check that you use the master branch and that it generates a database and collection? It should also call the method to initialize the data in the retrieveallcookies method, perhaps you can debug that.

from buildingcloudnativesolutions.

eliassal avatar eliassal commented on June 4, 2024

I did git clone after clicking on copy and It was on the master branch.
Yes, I have CosmosDBConnector.cs in NationalCookies.Data, I can see the sub

 private void InitializeCookies()
        {
            //define the cookie objects
            Cookie cookieChololateChip = new Cookie
            {
                Id = Guid.NewGuid(),
                ImageUrl = "https://intcookie.azureedge.net/cdn/cookie-cc.jpg",
                Name = "Chololate Chip",
                Price = 1.2
            };

            Cookie cookieButterCookie = new Cookie
            {
                Id = Guid.NewGuid(),
                ImageUrl = "https://intcookie.azureedge.net/cdn/cookie-bc.jpg",
                Name = "Butter Cookie",
                Price = 1.0
            };

            Cookie cookieMacaroon = new Cookie
            {
                Id = Guid.NewGuid(),
                ImageUrl = "https://intcookie.azureedge.net/cdn/cookie-mc.jpg",
                Name = "Macaroons",
                Price = 0.9
            };

            //add cookies to Cosmos DB
            CreateDocument(this._cookieCollectionName, cookieChololateChip);
            CreateDocument(this._cookieCollectionName, cookieButterCookie);
            CreateDocument(this._cookieCollectionName, cookieMacaroon);
        }

from buildingcloudnativesolutions.

bmaluijb avatar bmaluijb commented on June 4, 2024

So is it working now?

from buildingcloudnativesolutions.

eliassal avatar eliassal commented on June 4, 2024

No, I tried debugging, getting more details on the same finction, I think the error is saying that there is nothing in the DB

cookies_004

from buildingcloudnativesolutions.

eliassal avatar eliassal commented on June 4, 2024

While debugging, all code inside the constructor CosmosDBConnector executed but again inside the fucntion
RetrieveAllCookies
that it fails

from buildingcloudnativesolutions.

bmaluijb avatar bmaluijb commented on June 4, 2024

Mmm, it looks like it is expecting a collection, which isn’t there. Could you throw away the database in Cosmos DB and debug the code in the constructor that creates the database and collection and see if it actually creates a collection

from buildingcloudnativesolutions.

eliassal avatar eliassal commented on June 4, 2024

Ok I will drop it but should I remove it from appsettings as well the name of the DB?

from buildingcloudnativesolutions.

bmaluijb avatar bmaluijb commented on June 4, 2024

No, leave the settings

from buildingcloudnativesolutions.

eliassal avatar eliassal commented on June 4, 2024

OK, it created the database but not the collections nor inserted the cookies, what should I eneter for the 2 params

 "CosmosDBCookieCollectionName": "",
  "CosmosDBOrderCollectionName": "",

from buildingcloudnativesolutions.

bmaluijb avatar bmaluijb commented on June 4, 2024

Ah, that might be it. Please fill in all values that the app settings file requires. Fill in whatever you like

from buildingcloudnativesolutions.

eliassal avatar eliassal commented on June 4, 2024

I entered cookies for the 1st one and orders for the 2nd, yes it created the collections and added the 3 cookies
Thanks for your help

from buildingcloudnativesolutions.

Related Issues (3)

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.