Professional Cross-Platform Mobile Development in C# by Goers Kenny Horgen Ben Hunter John Olson Scott & John Hunter & Ben Horgen & Kenny Goers
Author:Goers, Kenny, Horgen, Ben, Hunter, John, Olson, Scott & John Hunter & Ben Horgen & Kenny Goers
Language: eng
Format: epub
Publisher: John Wiley & Sons
Published: 2012-01-27T16:00:00+00:00
Retrieving Detail Objects
Now that you have created a lightweight customer list, you need a way to return the full details of a customer at the appropriate point in the application workflow. You need the ability to view, add, and edit customer detail information but leave order processing for a separate workflow path. As such, you can design the data method and endpoints accordingly.
The code in Listing 7.7 shows the GetCustomer() data method. The data is organized so that the first address in the Addresses collection is always the default address. You can take that address and set the PrimaryAddress property, if it is not already set, before returning the customer to the service.
Listing 7.7: The GetCustomer method
public static Customer GetCustomer(string customer) { Customer retval = GetCustomerList().Where(obj => obj.ID == customer).FirstOrDefault(); if (retval.Addresses.Count > 0 && retval.PrimaryAddress == null) { retval.PrimaryAddress = new Address() { ID = retval.Addresses[0].ID, Description = retval.Addresses[0].Description, Street1 = retval.Addresses[0].Street1, Street2 = retval.Addresses[0].Street2, City = retval.Addresses[0].City, State = retval.Addresses[0].State, Zip = retval.Addresses[0].Zip }; } return retval; }
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12607)
Hello! Python by Anthony Briggs(9929)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9805)
The Mikado Method by Ola Ellnestam Daniel Brolund(9796)
Dependency Injection in .NET by Mark Seemann(9351)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8316)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7774)
Grails in Action by Glen Smith Peter Ledbrook(7707)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7571)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7235)
Microservices with Go by Alexander Shuiskov(6999)
Practical Design Patterns for Java Developers by Miroslav Wengner(6908)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6865)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6429)
Angular Projects - Third Edition by Aristeidis Bampakos(6276)
The Art of Crafting User Stories by The Art of Crafting User Stories(5794)
NetSuite for Consultants - Second Edition by Peter Ries(5722)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5543)
Kotlin in Action by Dmitry Jemerov(5077)
