{"action":"created","issue":{"url":"https://api.github.com/repos/uWebshop/uWebshop-Releases/issues/45","labels_url":"https://api.github.com/repos/uWebshop/uWebshop-Releases/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/uWebshop/uWebshop-Releases/issues/45/comments","events_url":"https://api.github.com/repos/uWebshop/uWebshop-Releases/issues/45/events","html_url":"https://github.com/uWebshop/uWebshop-Releases/issues/45","id":84029707,"number":45,"title":"Performance issue fetching Customer data from basket","user":{"login":"HeuHax","id":2834719,"avatar_url":"https://avatars.githubusercontent.com/u/2834719?v=3","gravatar_id":"","url":"https://api.github.com/users/HeuHax","html_url":"https://github.com/HeuHax","followers_url":"https://api.github.com/users/HeuHax/followers","following_url":"https://api.github.com/users/HeuHax/following{/other_user}","gists_url":"https://api.github.com/users/HeuHax/gists{/gist_id}","starred_url":"https://api.github.com/users/HeuHax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeuHax/subscriptions","organizations_url":"https://api.github.com/users/HeuHax/orgs","repos_url":"https://api.github.com/users/HeuHax/repos","events_url":"https://api.github.com/users/HeuHax/events{/privacy}","received_events_url":"https://api.github.com/users/HeuHax/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-02T13:45:35Z","updated_at":"2015-06-02T14:37:03Z","closed_at":null,"body":"When pulling out data from Basket.GetBasket().Customer every property like Firstname, Lastname etc. seems to do one or more database hits. I currently have 200 database hits on my checkout page due to this, which are all duplicates of the same query.\r\nI think it would be better to do the database hit only once on the Customer and make the properties available then.\r\n\r\nDunno if this makes sense? ;O"},"comment":{"url":"https://api.github.com/repos/uWebshop/uWebshop-Releases/issues/comments/107975294","html_url":"https://github.com/uWebshop/uWebshop-Releases/issues/45#issuecomment-107975294","issue_url":"https://api.github.com/repos/uWebshop/uWebshop-Releases/issues/45","id":107975294,"user":{"login":"HeuHax","id":2834719,"avatar_url":"https://avatars.githubusercontent.com/u/2834719?v=3","gravatar_id":"","url":"https://api.github.com/users/HeuHax","html_url":"https://github.com/HeuHax","followers_url":"https://api.github.com/users/HeuHax/followers","following_url":"https://api.github.com/users/HeuHax/following{/other_user}","gists_url":"https://api.github.com/users/HeuHax/gists{/gist_id}","starred_url":"https://api.github.com/users/HeuHax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeuHax/subscriptions","organizations_url":"https://api.github.com/users/HeuHax/orgs","repos_url":"https://api.github.com/users/HeuHax/repos","events_url":"https://api.github.com/users/HeuHax/events{/privacy}","received_events_url":"https://api.github.com/users/HeuHax/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T14:37:03Z","updated_at":"2015-06-02T14:37:03Z","body":"Couldn't we check it only once and from there decide what to do?\r\nThis costs around 700 ms load time.. \r\n\r\nMaybe instead of doing basket.Customer.Firstname , ..Lastname etc. we could have a basket.GetCustomerModel() method. This methods checks if members is logged in and then returns the data based on that and populates the data only once to the model."}}