/// <summary> /// Creates a new ContactsController with the given service. /// </summary> /// <param name="service">The service.</param> /// <param name="userProvider">The user provider.</param> /// <param name="phoneNumberHandler">The phone number handler.</param> /// <param name="emailAddressHandler">The Email Address handler.</param> public ContactsController(IContactService service, IUserProvider userProvider, IPhoneNumberHandler phoneNumberHandler, IEmailAddressHandler emailAddressHandler) { Contract.Requires(service != null, "The contact service must not be null."); Contract.Requires(userProvider != null, "The user provider must not be null."); Contract.Requires(emailAddressHandler != null, "The email address handler must not be null."); Contract.Requires(phoneNumberHandler != null, "The phone number handler must not be null."); this.service = service; this.userProvider = userProvider; this.emailAddressHandler = emailAddressHandler; this.phoneNumberHandler = phoneNumberHandler; }
/// <summary> /// Constructor /// </summary> /// <param name="service">The service to inject</param> /// <param name="userProvider">The user provider.</param> /// <param name="addressHandler">The address handler.</param> /// <param name="socialMediaHandler">The social media handler.</param> /// <param name="phoneNumberHandler">The phone number handler.</param> /// <param name="emailAddressHandler">The Email Address handler.</param> public PeopleController( IPersonService service, IUserProvider userProvider, IAddressModelHandler addressHandler, ISocialMediaPresenceModelHandler socialMediaHandler, IPhoneNumberHandler phoneNumberHandler, IEmailAddressHandler emailAddressHandler) { Contract.Requires(service != null, "The participant service must not be null."); Contract.Requires(userProvider != null, "The user provider must not be null."); Contract.Requires(addressHandler != null, "The address handler must not be null."); Contract.Requires(emailAddressHandler != null, "The email address handler must not be null."); Contract.Requires(phoneNumberHandler != null, "The phone number handler must not be null."); Contract.Requires(socialMediaHandler != null, "The social media handler must not be null."); this.addressHandler = addressHandler; this.service = service; this.userProvider = userProvider; this.socialMediaHandler = socialMediaHandler; this.emailAddressHandler = emailAddressHandler; this.phoneNumberHandler = phoneNumberHandler; }