/// <summary> /// Initializes a new instance of the<see cref="ProposalService"/> class. /// </summary> public ProposalService(IDataProtectionProvider dataProtectionProvider, IPurposeString purposeStringConstant) { this._protector = dataProtectionProvider.CreateProtector(purposeStringConstant.ConferenceIdQueryString); this._proposals = new List <ProposalModel> { new ProposalModel { Id = 1, ConferenceId = 1, Speaker = "Speaker X", Title = "Understanding ASP.NET Core Security" }, new ProposalModel { Id = 2, ConferenceId = 2, Speaker = "Speaker Y", Title = "Starting Your Developer Career" }, new ProposalModel { Id = 3, ConferenceId = 2, Speaker = "Speaker Z", Title = "ASP.NET Core TagHelpers" } }; }
public ProposalController( IProposalService service, IDataProtectionProvider dataProtectionProvider, IPurposeString purposeStringConstant) { this._service = service; this._protector = dataProtectionProvider.CreateProtector(purposeStringConstant.ConferenceIdQueryString); }
/// <summary> /// Initializes a new instance of the<see cref="ConferenceService"/> class. /// </summary> public ConferenceService(IDataProtectionProvider dataProtectionProvider, IPurposeString purposeString) { this._protector = dataProtectionProvider.CreateProtector(purposeString.ConferenceIdQueryString); this._conferences = new List <ConferenceModel> { new ConferenceModel { Id = 1, EncryptedId = this._protector.Protect("1"), Name = "NDC", Location = "Oslo", Start = new DateTime(2017, 6, 12), AttendeeTotal = 2132 }, new ConferenceModel { Id = 2, EncryptedId = this._protector.Protect("2"), Name = "IT/DevConnections", Location = "San Francisco", Start = new DateTime(2017, 10, 18), AttendeeTotal = 3210 } }; }