- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
1__state":-2 ,"<>t__builder":{"when run project netcore-6ren"> 1__state":-2 ,"<>t__builder":{"when run project netcore-当我运行项目 netcore 时,我收到一条消息 {"stateMachine":{"<>1__state":-1,"<>t__builder":{ 我不知道如何解决这个问题。我在命令行中看到错误 M-6ren">
当我运行项目 netcore 时,我收到一条消息 {"stateMachine":{"<>1__state":-1,"<>t__builder":{ 我不知道如何解决这个问题。我在命令行中看到错误
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'task' with type 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder`
Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HLFMHMJ7MBQN", Request id "0HLFMHMJ7MBQN:00000001": An unhandled exception was thrown by the application. Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'task' with type 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder`
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("AppDbConnection"),
b => b.MigrationsAssembly("liyobe.Data")));
services.AddIdentity<AppUser, AppRole>()
.AddEntityFrameworkStores<AppDbContext>()
.AddDefaultTokenProviders();
// Configure Identity
services.Configure<IdentityOptions>(options =>
{
// Password settings
options.Password.RequireDigit = true;
options.Password.RequiredLength = 6;
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = false;
options.Password.RequireLowercase = false;
// Lockout settings
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(30);
options.Lockout.MaxFailedAccessAttempts = 10;
// User settings
options.User.RequireUniqueEmail = true;
});
services.AddAutoMapper();
// Add application services.
services.AddScoped<UserManager<AppUser>, UserManager<AppUser>>();
services.AddScoped<RoleManager<AppRole>, RoleManager<AppRole>>();
//CreateMapper(services, Configuration);
//services.AddSingleton(Mapper.Configuration);
services.AddScoped<IMapper>(sp => new Mapper(sp.GetRequiredService<AutoMapper.IConfigurationProvider>(), sp.GetService));
services.AddTransient(typeof(IUnitOfWork), typeof(EFUnitOfWork));
services.AddTransient(typeof(IAsyncRepository<,>), typeof(EFRepository<,>));
services.AddTransient<IFunctionService, FunctionService>();
services.AddTransient<DbInitializer>();
//services.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/error");
}
//app.UseStaticFiles();
//app.UseHttpsRedirection();
app.UseMvc();
}
[Produces("application/json")]
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
IFunctionService _functionService;
public ValuesController(IFunctionService functionService)
{
_functionService = functionService;
}
// GET api/values
[HttpGet]
public async Task<IActionResult> Get()
{
try
{
var data = _functionService.GetAll("");
return Ok(data);
}
catch (Exception ex)
{
throw new Exception();
}
}
public async Task<List<FunctionViewModel>> GetAll(string functionId)
{
var query = await _functionRepository.ListAllAsync();
var result = _mapper.Map<List<Function>, List<FunctionViewModel>>(query);
return result;
}
public class FunctionViewModel
{
public string Id { get; set; }
[Required]
[StringLength(128)]
public string Name { set; get; }
[Required]
[StringLength(250)]
public string URL { set; get; }
[StringLength(128)]
public string ParentId { set; get; }
public string IconCss { get; set; }
public int SortOrder { set; get; }
public bool Status { set; get; }
}
[Table("Functions")]
public class Function : BaseEntity<string>, ISwitchable, ISortable
{
public Function()
{
}
public Function(string name, string url, string parentId, string iconCss, int sortOrder)
{
this.Name = name;
this.URL = url;
this.ParentId = parentId;
this.IconCss = iconCss;
this.SortOrder = sortOrder;
}
[Required]
[StringLength(128)]
public string Name { set; get; }
[Required]
[StringLength(250)]
public string URL { set; get; }
[StringLength(128)]
public string ParentId { set; get; }
public string IconCss { get; set; }
public int SortOrder { set; get; }
public bool Status { set; get; }
}
最佳答案
// GET api/values
[HttpGet]
public async Task<IActionResult> Get()
{
try
{
var data = await _functionService.GetAll("");
return Ok(data);
}
catch (Exception ex)
{
throw new Exception();
}
}
关于c# - 错误 "{"stateMachine": {"<>1__state":-2 ,"<>t__builder":{"when run project netcore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51604749/
我的 Spring 状态机中有一个守卫。 @Bean public Guard myGuard() { return context -> { try {
bbv.Common.StateMachine 类是我见过的最好的状态机代码。但它只缺少一件事:获取当前状态。 这是一个订单跟踪系统: fsm = new ActiveStateMachine();
使用新的 Spring Statemachine 项目,我可以在不使用可用于 JavaConfig 和 Spring @Configuration 类的适配器类的情况下以编程方式创建状态机吗? 最佳答
我正在测试 Spring Statemachine,特别是我对应用状态机来管理对象的状态感兴趣。 我的状态机类型为StateMachine . 我的业务对象,Episode ,具有类型为 state
我正在测试 Spring Statemachine,特别是我对应用状态机来管理对象的状态感兴趣。 我的状态机类型为StateMachine . 我的业务对象,Episode ,具有类型为 state
我使用 Spring 指南编写了状态机的实现。 但我无法对更改状态做出任何反应,尽管状态本身已成功更改。也许我误解了 Beans 类的目标?我需要实现状态变化时自动执行closeDoor()和star
我是 Spring 状态机的新手。 我已经在配置文件中配置了状态和转换,使用它们能够成功编排我的微服务。 现在我计划在外部存储库 (MYSQL DB) 中保存状态和转换 当我尝试使用 JpaState
有人可以举一个简单的例子来说明如何使用pluginaweek state_machine对于具有事件记录的票证模型? 我不明白文档中的复杂示例。 示例说明: 新 -> 接受、拒绝、反馈 接受 -> 已
我将 Spring Statemachine 引入到现有项目中,希望能够合并和澄清我们的业务逻辑。我们有各种具有互连状态的 JPA 实体,我在将持久状态设置为现有状态机的当前状态时遇到了一些麻烦。 我
使用 Spring 状态机,我们有状态和事件。我找不到任何关于是否可以在配置期间将静态数据附加到状态的文档。 例如,如果有状态S1和S2 public void configure(StateMach
使用 Spring 状态机,我们有状态和事件。我找不到任何关于是否可以在配置期间将静态数据附加到状态的文档。 例如,如果有状态S1和S2 public void configure(StateMach
由于我必须支持对状态机的并发访问,因此我无法使用通常的 Autowired 单例方法。相反,我尝试按照文档中的描述构建状态机,此处: http://docs.spring.io/spring-stat
我有一个 Spring 状态机,使用 EnumStateMachineConfigurerAdapter 配置,并用 @EnableStateMachineFactory 注释 一切顺利,我可以使用工
我有一个基于注释的状态机配置: @Component @Scope(BeanDefinition.SCOPE_PROTOTYPE) @EnableStateMachine(name = "machin
我尝试在项目中使用 Spring Statemachine 框架,但是在编译时遇到构建 bean 定义错误。 2017-07-25 16:37:25.462:WARN:oejd.DeploymentM
我创建了一个 Spring Cloud 数据流 Stream,以 Gemfire 作为源,以 Log 作为接收器,并使用rabbitMQ 来处理消息。我能够成功地将流部署到我们的一台机器上。但是,当我
我觉得我已经很接近完成这项工作了,但似乎无法完成... 我有一个带有传奇/状态机的 .NET Core ASP 应用程序,它似乎在大多数情况下都运行良好。它: 收到请求 发布一个由传送名单拾取的事件
我正在开发一个 SpriteKit 游戏,使用 GKStateMachine 在多个场景之间进行转换。我正在使用一个包含 StateMachine 实例的类,该实例具有多个状态。状态本身可以通过初始值
我正在尝试让 StateMachine 在状态之间执行一些数据库操作。 所以我有一个“开始”状态,它使用 CallExternalMethodActivity 在用 ExternalDataExcha
我对 C++ 中函数指针的概念还很陌生,所以我不知道如何正确地写下我的问题。请耐心等待。 基本上,我想要做的是创建一个 Button 对象,其构造函数接受一个函数指针作为其参数。该函数指针指向将更改状
我是一名优秀的程序员,十分优秀!