Пример #1
0
 public ConferenceMemoryService(IDataProtectionProvider protectionProvider, PurposeStringConstants purposeStringConstants)
 {
     this.protector = protectionProvider.CreateProtector(purposeStringConstants.ConferenceIdQueryString);
     conferences.Add(new ConferenceModel {
         Id = 1, EncryptedId = protector.Protect("1"), Name = "NDC", Location = "Berlin", Start = DateTime.Now.Date, AttendeeTotal = 1000
     });
     conferences.Add(new ConferenceModel {
         Id = 2, EncryptedId = protector.Protect("2"), Name = "IT/DevConnections", Location = "Moscow", Start = DateTime.Now + TimeSpan.FromDays(200), AttendeeTotal = 10000
     });
 }
Пример #2
0
 public ProposalMemoryService(IDataProtectionProvider protectionProvider,
                              PurposeStringConstants purposeStringConstants)
 {
     protector = protectionProvider.CreateProtector(purposeStringConstants.ConferenceIdQueryString);
     proposals.Add(new ProposalModel
     {
         Id                    = 1,
         ConferenceId          = 1,
         EncryptedConferenceId = protector.Protect("1"),
         Speaker               = "Nikolay Filippov",
         Title                 = "ASP.NET Core 2.x"
     });
     proposals.Add(new ProposalModel
     {
         Id                    = 2,
         ConferenceId          = 2,
         EncryptedConferenceId = protector.Protect("2"),
         Speaker               = "John Doe",
         Title                 = "Understanding C#"
     });
 }