public class EntityFrameworkConfiguration : DbConfiguration
{
public EntityFrameworkConfiguration()
{
this.SetModelCacheKey(ctx => new EntityModelCacheKey((ctx.GetType().FullName + ctx.Database.Connection.ConnectionString).GetHashCode()));
}
}
Run Code Online (Sandbox Code Playgroud)
为了使上面的代码工作,我在web.config中添加了以下行
但对于我正在使用程序集引用的其他项目,我得到例外:
{"在发现'EntityFrameworkConfiguration'类型之前,实体框架使用了默认的DbConfiguration实例.必须在使用任何实体框架功能之前在应用程序启动时设置'EntityFrameworkConfiguration'实例,或者必须在应用程序的配置文件中注册. http://go.microsoft.com/fwlink/?LinkId=260883了解更多信息."}
使用选项卡时遇到单选按钮问题.当我给动态名称时,它创建了ng-relfect-name而不是name属性,这就是我的选项卡索引不起作用的原因.我需要给出name属性才能正常工作.
<div class="col-sm-5 form-inline">
<span *ngFor="let rv of q.responsetypevalues; let j = index " [ngSwitch]="q.responsetype">
<label *ngSwitchCase="'checkbox'">
<input class="form-check-input" type="checkbox" [(ngModel)]="model.questions[i].responsetypevalues[j].checked" name="model.questions[{{i}}].responsetypevalues[{{j}}].checked"> {{rv.value}}
</label>
<label *ngSwitchCase="'radio'">
<input class="form-check-input" name="model.questions[{{i}}].answer" type="radio" [(ngModel)]="model.questions[i].answer" [value]="rv.id"> {{rv.value}}
</label>
<input *ngSwitchDefault type="text" class="form-control" [(ngModel)]="model.questions[i].responsetypevalues[j].value" name="model.questions[{{i}}].responsetypevalues[{{j}}].value" [value]="rv.value" />
</span>
<div class="error">{{q.errormsg}}</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我在PrimeNg Datatable中排序/过滤日期列时遇到问题.我正在显示日期"dd/mm/yyyy"字符串.