本文整理汇总了C#中ISessionProvider类的典型用法代码示例。如果您正苦于以下问题:C# ISessionProvider类的具体用法?C# ISessionProvider怎么用?C# ISessionProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISessionProvider类属于命名空间,在下文中一共展示了ISessionProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SecurityAuthenticationProvider
public SecurityAuthenticationProvider(IStorageApplication<User> userStorageApplication, IHashProvider hashProvider, ISecurityAccessTokenProvider securityAccessTokenProvider, ISessionProvider sessionProvider)
{
_userStorageApplication = userStorageApplication;
_hashProvider = hashProvider;
_securityAccessTokenProvider = securityAccessTokenProvider;
_sessionProvider = sessionProvider;
}
开发者ID:johnbrunnings,项目名称:Neat,代码行数:7,代码来源:SecurityAuthenticationProvider.cs
示例2: Session
public Session(IResultTransformer resultTransformer, IDao<Bank> bankDao, IDao<LogModel> logDao, ISessionProviderFactory<NHibernateStatelessSession> sessionProviderFactory)
: base(resultTransformer)
{
this.bankDao = bankDao;
this.logDao = logDao;
logSessionProvider = sessionProviderFactory.Build("LOG");
}
开发者ID:BosphorusTeam,项目名称:bosphorus.dao,代码行数:7,代码来源:Session.cs
示例3: AssemblyByConfigurationBootstrap
public AssemblyByConfigurationBootstrap(IConfigurationProvider configurationProvider, ISessionProvider sessionProvider)
{
if (configurationProvider == null) throw new ArgumentNullException(nameof(configurationProvider));
if (sessionProvider == null) throw new ArgumentNullException(nameof(sessionProvider));
_configurationProvider = configurationProvider;
_sessionProvider = sessionProvider;
}
开发者ID:RagingRudolf,项目名称:CodeFirst.UCommerce,代码行数:7,代码来源:AssemblyByConfigurationBootstrap.cs
示例4: PollModule
public PollModule(TinyIoc.TinyIoCContainer container, PollService pollService = null, ISessionProvider sessionProvider = null)
{
if (container == null) throw new ArgumentNullException("container");
if (!(sessionProvider is DefaultSessionProvider)) _SessionProvider = sessionProvider;
if (pollService == null)
{
container.Register<PollService>().AsSingleton();
pollService = container.Resolve<PollService>();
}
_PollService = pollService;
Get["/Poll/Register"] = x =>
{
var sp = _SessionProvider;
if (sp == null) sp = new DefaultSessionProvider(Request);
var response = Response.AsJson(_PollService.Register(Request.UserHostAddress, sp.SessionId));
if (sp is DefaultSessionProvider)
{
response = response.WithCookie(DefaultSessionProvider.SessionIdCookieName, sp.SessionId);
}
return response;
};
Get["/Poll/Wait"] = x =>
{
string clientId = Request.Query.clientId;
ulong seqCode = Request.Query.seqCode;
return Response.AsJson(_PollService.Wait(clientId, seqCode));
};
}
开发者ID:vitaut7,项目名称:Nancy.LongPoll,代码行数:33,代码来源:PollModule.cs
示例5: NestWebService
public NestWebService() {
_deserializer = ServiceContainer.GetService<INestWebServiceDeserializer>();
_sessionProvider = ServiceContainer.GetService<ISessionProvider>();
_analyticsService = ServiceContainer.GetService<IAnalyticsService>();
_webRequestProvider = ServiceContainer.GetService<IWebRequestProvider>();
_timestampProvider = ServiceContainer.GetService<ITimestampProvider>();
}
开发者ID:garyjohnson,项目名称:wpnest,代码行数:7,代码来源:NestWebService.cs
示例6: PollModule
public PollModule(TinyIoc.TinyIoCContainer container, IPollService pollService = null, ISessionProvider sessionProvider = null)
{
if (container == null) throw new ArgumentNullException("container");
if (!(sessionProvider is DefaultSessionProvider)) _SessionProvider = sessionProvider;
if (pollService == null)
{
container.Register<IPollService, PollService>().AsSingleton();
pollService = container.Resolve<IPollService>();
}
_PollService = pollService as PollService;
if (pollService == null) throw new ApplicationException("Support Nany.LongPoll.PollService implementation only");
Get["/Poll/Register"] = x =>
{
var sp = _SessionProvider;
if (sp == null) sp = new DefaultSessionProvider(Request);
var response = Response.AsJson(_PollService.Register(Request.UserHostAddress, sp.SessionId));
if (sp is DefaultSessionProvider)
{
response = response.WithCookie(DefaultSessionProvider.SessionIdCookieName, sp.SessionId);
}
return response;
};
Get["/Poll/Wait"] = x =>
{
string clientId = Request.Query.clientId;
ulong seqCode = Request.Query.seqCode;
return Response.AsText(JsonConvert.SerializeObject(_PollService.Wait(clientId, seqCode)), "application/json");
};
}
开发者ID:AIexandr,项目名称:Nancy.LongPoll,代码行数:34,代码来源:PollModule.cs
示例7: WebLoginModule
public WebLoginModule(ISessionProvider sessionProvider)
{
_sessionProvider = sessionProvider;
Get["/weblogin"] = parameters => View["web/login.html"];
Get["/weblogout"] = parameters => this.Logout("/");
Post["/weblogin"] = parameters =>
{
using (var session = _sessionProvider.GetSession())
{
string username = Request.Form["UserName"];
string password = Request.Form["Password"];
var login = session.Query<Login>()
.SingleOrDefault(
x => x.Username == username && x.Password == password);
if (login == null)
return Response.AsRedirect("/weblogin", RedirectResponse.RedirectType.SeeOther);
if(login.Roles.Contains(Roles.SuperAdmin))
return this.Login(login.AuthenticationKey, DateTime.Now.AddDays(1), "/admin");
if (login.Roles.Contains(Roles.ClientAdmin))
return this.Login(login.AuthenticationKey, DateTime.Now.AddDays(1), "/web/views/livedetails.html?" + login.ClientId);
if (login.Roles.Contains(Roles.ClientUser))
return this.Login(login.AuthenticationKey, DateTime.Now.AddDays(1), "/mobile/views/startup.html");
return this.Login(login.AuthenticationKey, fallbackRedirectUrl: "/");
}
};
}
开发者ID:henrikrtfm,项目名称:Seerefine,代码行数:35,代码来源:WebLoginModule.cs
示例8: UserService
public UserService(ISessionProvider sessionProvider)
{
ISessionFactory sessionFactory = sessionProvider.GetSessionFactory();
_unitOfWork = new UnitOfWork(sessionFactory);
_repository = new Repository<int, User>(_unitOfWork.Session);
}
开发者ID:kashinathn,项目名称:SampleApp,代码行数:7,代码来源:UserService.cs
示例9: MomentController
public MomentController(ISessionProvider<AefSession> sessionProvider,
IMomentManager momentManager,
IMomentFileManager momentFileManager,
IMomentLikeManager momentLikeManager,
IMomentCommentManager momentCommentManager,
IAccessTimeManager accessTimeManager,
IStaffManager staffManager,
IOrgManager orgManager) : base(sessionProvider)
{
Args.NotNull(momentManager, nameof(momentManager));
Args.NotNull(momentFileManager, nameof(momentFileManager));
Args.NotNull(momentManager, nameof(momentManager));
Args.NotNull(staffManager, nameof(staffManager));
Args.NotNull(accessTimeManager, nameof(accessTimeManager));
Args.NotNull(orgManager, nameof(orgManager));
m_MomentManager = momentManager;
m_MomentFileManager = momentFileManager;
m_MomentLikeManager = momentLikeManager;
m_MomentCommentManager = momentCommentManager;
m_SessionProvider = sessionProvider;
m_StaffManager = staffManager;
m_AccessTimeManager = accessTimeManager;
m_OrgManager = orgManager;
}
开发者ID:yaoyel,项目名称:Finework,代码行数:25,代码来源:MomentController.cs
示例10: UserInformationDtoFactory
/// <summary>
/// Initializes a new instance of the <see cref="UserInformationDtoFactory"/> class.
/// </summary>
/// <param name="sessionProvider">The session provider.</param>
/// <param name="currentClaimsPrincipalService">The current claims principal service.</param>
public UserInformationDtoFactory(
ISessionProvider sessionProvider,
ICurrentClaimsPrincipalService currentClaimsPrincipalService )
{
_sessionProvider = sessionProvider;
_currentClaimsPrincipalService = currentClaimsPrincipalService;
}
开发者ID:divyang4481,项目名称:REM,代码行数:12,代码来源:UserInformationDtoFactory.cs
示例11: MonitorModule
public MonitorModule(ISessionProvider sessionProvider)
: base("/monitor")
{
_sessionProvider = sessionProvider;
Get["/live"] = parameters =>
{
using (var session = _sessionProvider.GetSession())
{
return session.Load<MonitorSite>("MonitorSites/1").Text;
}
};
Get["/createlive"] = parameters =>
{
using (var session = _sessionProvider.GetSession())
{
if (session.Load<MonitorSite>("MonitorSites/1") == null)
{
session.Store(new MonitorSite
{
Id = "MonitorSites/1",
Text = "I was fetched from the database",
});
session.SaveChanges();
return "Message was stored to the database.";
}
else
{
return Response.AsRedirect("/monitor/live");
}
}
};
}
开发者ID:henrikrtfm,项目名称:Seerefine,代码行数:33,代码来源:MonitorModule.cs
示例12: EventsDispatcher
public EventsDispatcher(ISessionProvider sessionProvider, IProvideClientSettings clientSettings)
{
_sessionProvider = sessionProvider;
_clientSettings = clientSettings;
_eventConsumers = new Dictionary<Type, List<Type>>();
var consumerTypes = (from type in GetType().Assembly.GetTypes()
where type.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IConsumerOf<>))
select type).ToArray();
foreach (var consumerType in consumerTypes)
{
foreach (var interfaceType in consumerType.GetInterfaces())
{
if(interfaceType.IsGenericType == false)
continue;
if(interfaceType.GetGenericTypeDefinition() == typeof(IConsumerOf<>) == false)
continue;
if(_eventConsumers.ContainsKey(interfaceType) == false)
_eventConsumers.Add(interfaceType, new List<Type>());
if(_eventConsumers[interfaceType].Contains(consumerType))
continue;
_eventConsumers[interfaceType].Add(consumerType);
}
}
}
开发者ID:henrikrtfm,项目名称:Seerefine,代码行数:30,代码来源:EventsDispatcher.cs
示例13: SetUp
public override void SetUp()
{
base.SetUp();
CreateDatabaseSchema();
sessionProvider = engine.Resolve<ISessionProvider>();
repository = new ContentItemRepository(sessionProvider);
all = new ContentItem []
{
root = CreateOneItem<Definitions.PersistableItem>(0, "page", null),
child1 = CreateOneItem<Definitions.PersistableItem>(0, "page1", root),
grandchild1 = CreateOneItem<Definitions.PersistableItem>(0, "page1_1", child1),
part1 = CreateOneItem<Definitions.PersistablePart>(0, "part1", child1),
part2 = CreateOneItem<Definitions.PersistablePart>(0, "part1", child1),
child2 = CreateOneItem<Definitions.PersistableItem>(0, "page2", root),
version = CreateOneItem<Definitions.PersistableItem>(0, "page1", null)
};
part1.ZoneName = "Left";
part2.ZoneName = "RecursiveLeft";
child1["Hello"] = "World";
child2["Age"] = 2.7;
grandchild1["Age"] = 1.7;
version.VersionOf = child1;
foreach (var item in all)
repository.SaveOrUpdate(all);
}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:28,代码来源:ItemRepositoryTests_Find.cs
示例14: TaskNewsController
public TaskNewsController(ISessionProvider<AefSession> sessionProvider,
ITaskNewsManager taskNewsManager)
: base(sessionProvider)
{
if (taskNewsManager == null) throw new ArgumentNullException(nameof(taskNewsManager));
m_TaskNewsManager = taskNewsManager;
}
开发者ID:yaoyel,项目名称:Finework,代码行数:7,代码来源:TaskNewsController.cs
示例15: AdminModule
public AdminModule(ISessionProvider sessionProvider, IDispatchEvents eventDispatcher)
: base(sessionProvider, eventDispatcher, "/api/admin")
{
Post["/clients/create"] = parameters =>
{
var createCommand = this.Bind<CreateClientCommand>();
RavenSession.Advanced.UseOptimisticConcurrency = true;
var newClient = new Client
{
Name = createCommand.Name,
};
RavenSession.Store(newClient);
RavenSession.Store(new UniqueClientName
{
Id = createCommand.Name,
});
UncommitedEvents.Add(new ClientCreated
{
Id = newClient.Id,
Name = newClient.Name,
});
return HttpStatusCode.Processing;
};
Get["/clients/{clientId}"] = parameters =>
{
var client = RavenSession.Load<Client>(string.Format("clients/{0}", parameters.clientId));
return Response.AsJson(new { client });
};
}
开发者ID:henrikrtfm,项目名称:Seerefine,代码行数:35,代码来源:AdminModule.cs
示例16: SessionInfo
/// <summary>
/// Initializes a new instance of the <see cref="SessionInfo"/> class.
/// </summary>
/// <param name="provider">The provider.</param>
/// <exception cref="System.ArgumentNullException">provider;Error on assigning the session provider into BussinesDAO 'cause It's null.</exception>
public SessionInfo(ISessionProvider provider)
{
if (provider == null)
throw new ArgumentNullException("provider", "Error on assigning the session provider into BussinesDAO 'cause It's null.");
this.sessionProvider = provider;
}
开发者ID:TheHunter,项目名称:PersistentLayer.NHibernate,代码行数:12,代码来源:SessionInfo.cs
示例17: AppointmentService
public AppointmentService()
{
ObjectFactory.Container.Configure(x => x.AddRegistry<WcfRegistry>());
_sessionProvider = ObjectFactory.GetInstance<ISessionProvider>();
_appointmentRepository = ObjectFactory.GetInstance<IAppointmentRepository>();
_appointmentValidator = ObjectFactory.GetInstance<IAppointmentValidator>();
}
开发者ID:lucidcoding,项目名称:EnterpriseExample,代码行数:7,代码来源:AppointmentService.svc.cs
示例18: BeforeEachTest
protected virtual void BeforeEachTest()
{
Mockery = new MockRepository();
SessionProvider = Mockery.DynamicMock<ISessionProvider>();
SessionFactory = Mockery.DynamicMock<ISessionFactory>();
Session = Mockery.DynamicMock<ISession>();
CreateCriteria = Mockery.DynamicMock<ICriteria>();
}
开发者ID:AndreyB1990,项目名称:Task1,代码行数:8,代码来源:RepositoryFixtureBase.cs
示例19: VisualCaptcha
public VisualCaptcha(ISessionProvider sessionProvider, string mediaPath, string @namespace = "visualcaptcha", List<Option> images=null, List<Option> audios=null)
{
_sessionProvider = sessionProvider;
__dirname = mediaPath;
ImageOptions = images??LoadImageOptions();
AudioOptions = audios??LoadAudioOptions();
_namespace = @namespace;
}
开发者ID:terabytenz,项目名称:VisualCaptcha.Net,代码行数:8,代码来源:VisualCaptcha.cs
示例20: SecurityUserProvider
public SecurityUserProvider(IUserSecurityStorageProvider userSecurityStorageProvider, ISecurityAccessTokenProvider securityAccessTokenProvider, IHashProvider hashProvider, ISecurityContext securityContext, ISessionProvider sessionProvider)
{
_userSecurityStorageProvider = userSecurityStorageProvider;
_securityAccessTokenProvider = securityAccessTokenProvider;
_hashProvider = hashProvider;
_securityContext = securityContext;
_sessionProvider = sessionProvider;
}
开发者ID:johnbrunnings,项目名称:Neat,代码行数:8,代码来源:SecurityUserProvider.cs
注:本文中的ISessionProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论