首页 > TAG信息列表 > structuremap3

c#-接受所有已注册类型/实例列表的Structuremap 3构造函数

我有一个期望IEnumerable< IPluginType>的对象.作为其构造函数的参数.我的容器配置中还有一行,它添加了IPluginType的所有实现者: x.Scan(s => { ... s.AddAllTypesOf<IPluginType>(); }); 我已经通过container.WhatDoIHave()确认了预期的实现者已注册,但是未填充IEnumer

c# – 无法解析StructureMap.Net4中的符号SetAllProperties

在我的项目中,我使用的是StructureMap.Net4(版本3.0.3)和StructureMap(3.0.3).我使用以下代码为Ioc配置了setter注入 public static IContainer Initialize() { ObjectFactory.Initialize(x => {

c# – 在DbContext中访问HttpContext.Current.User.Identity.Name

我将使用UserName跟踪Created和Modified字段.为此,我直接在DbContext中引用了System.Web程序集: public void auditFields() { var auditDate = DateTime.Now; foreach (var entry in this.ChangeTracker.Entries<BaseEntity>()) {