我最近对金融棋盘游戏感兴趣,并看到它们如何在教育儿童某些概念方面非常有用.
它让我思考是否也可以通过桌面游戏来表示执行软件项目的某些方面并使其变得有趣.
以下是我到目前为止提出的一些事项:
人力资源和工具/技术被表示为卡片.
要求也表示为卡片,它们平均分配给每个玩家,目标是通过"SDLC"板(每个玩家一个)移动所有需求卡,代表按照阶段分组的一系列正方形(一路设计)部署)
时间的流逝在一个像垄断这样的主方板中表现出来,并完成一次绕行(通过"Go")允许玩家根据能力的不同,通过SDLC板移动每个要求卡的步骤.资源卡(高级程序员允许一个要求在开发阶段移动两个方格,初级程序员只有一个,等等)
玩家将从代表项目预算的游戏钱开始,并且每次传递"Go"都是发薪日.如果资金耗尽,玩家将退出游戏.
主板还有"机会"/"风险"牌,代表可能搞乱项目的事情.在模具的滚动处应用损坏,并且机会修改器取决于用户是否"购买"了工具/技术.
我还没有实现这个想法,因为我仍然在寻找更多可以让游戏更具吸引力的游戏元素,以及征求更多想法.
我打算在知识共享许可下发布这个,但还没有确定确切的许可.
欢迎任何更多的游戏建议.
更新:这是在BoardGameGeek上发布的,现在有一个活跃的讨论主题.http://www.boardgamegeek.com/article/4436694
我有以下登录代码,以及在另一个调用中检索用户 ID 的另一种方法。
// POST: /api/Account/Login
[HttpPost]
[AllowAnonymous]
public async Task<IActionResult> Login([FromBody]LoginViewModel model)
{
if (ModelState.IsValid)
{
var user = await _userManager.FindByEmailAsync(model.Email);
if (user != null)
{
if (!await _userManager.IsEmailConfirmedAsync(user))
{
ModelState.AddModelError(string.Empty,
"You must have a confirmed email to log in.");
return BadRequest(Errors.AddErrorToModelState("Email", "You must have a confirmed email to log in.", ModelState));
}
}
var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false);
if (result.Succeeded)
{
// IS THIS NEEDED? --> // HttpContext.User = await _userClaimsPrincipalFactory.CreateAsync(user);
var tokens = …Run Code Online (Sandbox Code Playgroud) 我希望能够存储UITextView的滚动位置.我想将它绑定到AppController属性,以便其他标签页可以使用它.
我可以设置并获取ContentOffset值,但我认为需要通知滚动事件以更新属性.我该怎么做呢?
我在设置依赖关系解析器时收到此错误.
码:
GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);
错误:
通过方法'System.Web.Http.GlobalConfiguration..cctor()'尝试访问字段'System.Web.Http.GlobalConfiguration.CS $ <> 9__CachedAnonymousMethodDelegate2'失败.
我在这里错过了什么?
发布的所有解决方案都涉及安装最新版本的Microsoft.AspNet.WebApi.
安装包Microsoft.AspNet.WebApi -IncludePrerelease
但是,我已经拥有了所有必需程序集的最新版本,而且我仍然遇到此错误.
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
<dependentAssembly> …Run Code Online (Sandbox Code Playgroud) 这两个设置似乎在做相同的事情。构建操作=无,并且复制到输出目录=不复制。
在哪些情况下:
生成操作为“无”,但是复制到输出目录还有其他内容吗?
复制到输出目录是不复制,但是生成操作还有别的吗?
嵌入的 Imgur 图像不会出现。有时,它会短暂出现,然后消失。
此页面不包含图像。它只显示一个空白。
查看源代码,它遵循相同的 Imgur 代码。它还在页面底部有 embed.js。
<blockquote class="imgur-embed-pub" lang="en" data-id="a/lKOEEdd" data-context="false"><br>
<a href="https://imgur.com/a/lKOEEdd">View on Imgur</a>
</blockquote>
Run Code Online (Sandbox Code Playgroud)
当我将相同的 HTML 粘贴到另一个站点(如 CodePen)时,它会正确显示。
我已经设置了一个带有 JWT 身份验证的 SignalR Blazor WebAssembly 应用程序,配置为通过查询字段 access_token 发送令牌。
在服务器上,我看到它正在从此值分配 context.Token。
但是,对于使用 [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] 注释的集线器,我得到 401。
为什么不授权?
这是集线器的代码:https : //github.com/jonasarcangel/SignalRAuthTest/blob/master/SignalRAuthTest/Server/SignalR/MessagesHub.cs
这是我在 Startup.cs 中的内容:https : //github.com/jonasarcangel/SignalRAuthTest/blob/master/SignalRAuthTest/Server/Startup.cs
这是客户端:https : //github.com/jonasarcangel/SignalRAuthTest/blob/master/SignalRAuthTest/Client/Pages/SignalR.razor.cs
这是我的graphql查询/突变。
我收到错误消息:GraphQLError:语法错误:Expected:,found {
我不知道其中哪一个是错误的。
import gql from 'graphql-tag';
export const CategoriesQuery = gql`
query categoriesQuery(
$id: ID!,
$country: String!,
$name: String!
) {
sections(
id: $id,
country: $country,
name: $description
) {
id,
createdBy,
createdDate,
lastUpdate,
name
}
}
`;
export const ItemsQuery = gql`
query itemsQuery(
$id: ID!,
$category: String!,
$url: String!,
$alias: String!,
$name: String!
) {
items(
input {
id: $id,
category: $category,
url: $url,
alias: $alias,
name: $name
}
) {
id,
createdBy,
createdDate,
lastUpdate,
name, …Run Code Online (Sandbox Code Playgroud) 我在Fluent NHibernate中遇到了映射错误.当我明确指定列时,为什么还在寻找_id?
Invalid column name 'Account_id'.
[GenericADOException: could not initialize a collection: [ProtoStack.Business.Entities.Account.LedgerEntries#1][SQL: SELECT ***ledgerentr0_.Account_id*** as Account5_1_, ledgerentr0_.Id as Id1_, ledgerentr0_.Id as Id43_0_, ledgerentr0_.LedgerEntryDate as LedgerEn2_43_0_, ledgerentr0_.Amount as Amount43_0_, ledgerentr0_.AccountId as AccountId43_0_ FROM dbo.LedgerEntry ledgerentr0_ WHERE ledgerentr0_.Account_id=?]]
Run Code Online (Sandbox Code Playgroud)
我已明确指定该列为"AccountId".
public class AccountMap : ClassMap<Account>
{
public AccountMap()
{
Table("dbo.Account");
Id(x => x.Id)
.Column("Id");
Map(x => x.Code);
Map(x => x.Name);
Map(x => x.Description);
Map(x => x.Category);
References(x => x.Group)
.Column("AccountGroupId");
HasMany(x => x.LedgerEntries)
.Inverse()
.Cascade.All();
}
}
public class LedgerEntryMap : ClassMap<LedgerEntry> …Run Code Online (Sandbox Code Playgroud) 新项目无法找到新区域的视图.
它试图在父视图文件夹中找到它.
建议的解决方案是.DataTokens.Add("area", "AREANAME")将该RegisterArea方法付诸实践.
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Test_default",
"Test/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
).DataTokens.Add("area", "Test");
}
Run Code Online (Sandbox Code Playgroud)
但是,有了这个,我得到一个" 已添加相同密钥的项目. "错误.
更新1:我没有对控制器做任何想象.
public ActionResult Index()
{
return View();
}
Run Code Online (Sandbox Code Playgroud)
更新2:我只想补充一点,我也在将组件注册到Unity容器中.但是,我不认为这会导致问题,因为它明确指出没有必要注册我的控制器.
选项模式使我能够创建包含配置值的选项对象,如下所述:https : //docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/options?view=aspnetcore-2.1
我需要IDesignTimeDbContextFactory实现中一个选项对象的值,以供EF在创建模型时使用。(该配置部分中的值将用于数据播种,因此我向数据库上下文构造函数中添加了IOptions。)
由于我无权访问IServiceCollection(因为它是设计时间,就像运行“ dotnet ef迁移添加”时一样),所以我需要有另一种方法可以将IConfigurationSection(代表我感兴趣的部分)转换为自定义Options类。
我可以知道如何在没有依赖注入的情况下做到这一点吗?
单击“登录”链接时,带有预渲染功能的 Blazor WASM 会出错。
我在 Startup.cs 中添加了以下内容:
services.AddScoped<AuthenticationStateProvider, ServerAuthenticationStateProvider>();
services.AddScoped<SignOutSessionStateManager>();
Run Code Online (Sandbox Code Playgroud)
https://github.com/jonasarcangel/PrenderWithAuth/blob/master/PrerenderWithAuth/Server/Startup.cs
这是在https://github.com/dotnet/aspnetcore/issues/15253中提出的。其他更改也来自https://jonhilton.net/blazor-wasm-prerendering/。
这是错误:
System.InvalidCastException:无法将“Microsoft.AspNetCore.Components.Server.ServerAuthenticationStateProvider”类型的对象转换为“Microsoft.AspNetCore.Components.WebAssembly.Authentication.IRemoteAuthenticationService`1[Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState]” '。
更新:我正在尝试这个,但我不知道在每个实现中放什么。
public class HybridAuthenticationStateProvider : ServerAuthenticationStateProvider, IRemoteAuthenticationService<RemoteAuthenticationState>
{
public async Task<RemoteAuthenticationResult<RemoteAuthenticationState>> CompleteSignInAsync(RemoteAuthenticationContext<RemoteAuthenticationState> context)
{
throw new NotImplementedException();
}
public async Task<RemoteAuthenticationResult<RemoteAuthenticationState>> CompleteSignOutAsync(RemoteAuthenticationContext<RemoteAuthenticationState> context)
{
throw new NotImplementedException();
}
public async Task<RemoteAuthenticationResult<RemoteAuthenticationState>> SignInAsync(RemoteAuthenticationContext<RemoteAuthenticationState> context)
{
throw new NotImplementedException();
}
public async Task<RemoteAuthenticationResult<RemoteAuthenticationState>> SignOutAsync(RemoteAuthenticationContext<RemoteAuthenticationState> context)
{
throw new NotImplementedException();
}
}
Run Code Online (Sandbox Code Playgroud) c# ×4
asp.net-core ×3
blazor ×2
.net ×1
angular ×1
apollo ×1
asp.net ×1
cocoa-touch ×1
graphql ×1
imgur ×1
ios ×1
jwt ×1
scrollview ×1
signalr ×1
uikit ×1
uiscrollview ×1