我想在2个表之间使用外键,所以我像往常一样尝试它.现在我遇到的问题是他无法创建,并且由于它的外观它无法创建,因为已经有一个键但是没有.
- Unable to create relationship
'FK_tbl_Paramed_RegistratieBehandelingen_Users'.
The ALTER TABLE statement conflicted with the
FOREIGN KEY constraint "FK_tbl_Paramed_RegistratieBehandelingen_Users".
The conflict occurred in database "Nestor_Server",
table "dbo.Users", column 'UserID'.
Run Code Online (Sandbox Code Playgroud)
我检查过他们是否有相同的类型,他们做(bigint)所以不明白为什么他不会创建它
sql-server constraints foreign-keys foreign-key-relationship
由于NDA我无法共享任何代码,所以希望有人可以在这里帮助我.
我正在尝试对客户端的后台进行SOAP调用,直到我要求结果为止.现在我的项目分为3个独立的项目文件
执行异步任务时,会发生以下错误.
System.String,System.Private.CoreLib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 7cec85d7bea7798e不能从System.String [],System.Private.CoreLib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken分配= 7cec85d7bea7798e
关于这个调用我可以说的是我将一个字符串分配给一个包含一个属性(字符串)的类.所以我不确定这里有什么问题.
希望以前有人遇到过这个问题并且可以指出我的问题!
TX
好的,奇怪的事情再次发生在我身上.今天早上,当我启动我的ASP.NET应用程序时,对它进行了一些处理,现在当我尝试发布它时.我收到一个错误,我似乎无法找到任何文档
Error 1 Unable to apply a change while debugging. Source file '\Properties\AssemblyInfo.cs' was reloaded. You must restart the debugging session.
Run Code Online (Sandbox Code Playgroud)
谁知道该怎么办?
我正在构建一个测试项目来摆弄.net核心,我正在遇到一些障碍.玩弄的基本思想是将产品添加到上下文中,没有大的权利.错了.因为我是一名优秀的程序员,所以我总是从TDD的方式开始.所以我尝试了以下测试.
[Fact]
public async Task AddProduct_ReturnCreatedWithProduct()
{
Product testProduct = ProductHelpers.GenerateTestProduct();
var mockRepo = new Mock<IRepository<Product>>();
mockRepo.Setup(repo => repo.Get(testProduct.ProductID)).Returns(Task.FromResult(testProduct));
var controller = new ProductController(mockRepo.Object);
var result = await controller.Post(new ProductViewModel() { ProductID = 1, ProductShortDesc = PRODUCT_SHORTDESC, ProductDescription = PRODUCT_DESC });
var okResult = Assert.IsType<OkObjectResult>(result);
var returnProduct = Assert.IsType<Product>(okResult.Value);
Assert.Equal(testProduct.ProductShortDesc, returnProduct.ProductShortDesc);
Assert.Equal(testProduct.ProductDescription, returnProduct.ProductDescription);
}
public static Product GenerateTestProduct()
{
return new Product()
{
ProductID = 1,
ProductShortDesc = "FRI",
ProductDescription = "Fristi"
};
}
Run Code Online (Sandbox Code Playgroud)
哪个应该回报得体OkObjectResult.好吧不,不.所以我深深地潜入控制器,给了我这个.
[HttpPost]
public async …Run Code Online (Sandbox Code Playgroud) 在我的应用程序上,我将DateTime.Now分配给新的DateTime.然后我将它分配给一个值并将其写入数据库.但是当我从数据库中取回它并将变量与先前分配的新日期时间进行比较时,它会相差几毫秒.
任何人都知道为什么会这样?
例如
DateTime var1 = DateTime.Now;
Object1.DateTime = var1;
Database.SaveObject = var1
Object2 = Database.FindObjectById(objectId);
Assert.AreEqual(var1, Object2.DateTime);
Run Code Online (Sandbox Code Playgroud) 我现在这个问题是一个很大的谜,现在好几天,我试着搜索互联网,但我找不到解释.
在问题出现之前,我的代码看起来像这样:

但是现在每次添加的东西都是这样的
我在{}之间按下输入后执行此操作.所以,我的问题,我无法搞清楚..我打了一个keycombo,devexpress或resharper打破了它,我不知道.所以有人知道如何解决这个问题
我正在尝试设置一个RoR API,但是我正在沿着一些道路暴击.经过繁琐的编码以使数据库设置正确后,我遇到了一个对我来说没有意义的错误(我是RoR的新手)
Unable to autoload constant Api::V1::SubmissionsController, expected ./app/controllers/api/v1/submissions_controller.rb to define it
我不太清楚这个错误意味着什么,我的互联网搜索在一个明确的答案上是空的.我希望你们中的任何人都可以帮助我.
路线
Rails.application.routes.draw do
namespace :api, :defaults => {:format => :json} do
namespace :v1 do
get "/submissions", to: "submissions#index"
end
end
end
Run Code Online (Sandbox Code Playgroud)
submission.rb
class Submission < ActiveRecord::Base
end
Run Code Online (Sandbox Code Playgroud)
submissions_controller.rb
class API::V1::SubmissionsController < ApplicationController
def index
@submissions = Submission.all
render json: @submissions, status: :ok
end
end
Run Code Online (Sandbox Code Playgroud) 我有这个linq foreach
public Func<List<string>, Foobar, List<string>> ExtractClassName = (lines, foo)
=>
{
temp = lines.FindAll(_FooRege.IsMatch);
temp.ForEach(t => { lines.Remove(t); });
lines.ForEach(
lin =>
{
if (foo.FooRege.IsMatch(lin))
{
docsText.AppendLine(TrimSlashes(lin));
lines.Remove(lin);
}
else if(_FooRege.IsMatch(lin))
{
_foo.ClassName = lin.Split(' ').Last();
lines.Remove(lin);
}
});
return lines;
};
Run Code Online (Sandbox Code Playgroud)
测试数据
/// <summary>
/// Summary <- skips this one
/// </summary>
Run Code Online (Sandbox Code Playgroud)
如果一切都没问题,他会在第一场比赛中击中第一场比赛,但如果一条线被跳过则第二场击中第一场比赛.不知道为什么会发生这种情况.
#contentwrapper {
background: #111;
background: url('~/img/bg-black.png');
width: 100%;
}
#content {
width: 340px;
height: 165px;
margin: 240px auto;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
这是HTML:
<div id="content-wrapper">
<div id="content">
<h1 style="text-align: center">Test</h1>
<div style="clear:both"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我的问题是我试图将contentwrapper的背景图像设置为给定的链接,但是当我运行它时,它不会显示.我尝试过重写,重新加载,读取等等.什么都行不通
有任何想法吗?
我正在尝试使用XSL样式表转换XML字符串.但出于某种原因,他只接受我的根元素,而不是其余部分.有些东西可以摇摆不定的wimey probs,但我看不出这个问题..
我将在下面附上我的代码.
XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://foo.com/foo" xmlns:ns1="http://foo.com/foo" exclude-result-prefixes="ns1">
<xsl:template match="/">
<ns0:ProductionOrderRequests>
<xsl:apply-templates select="ns1:ProductionOrderRequest" />
</ns0:ProductionOrderRequests>
</xsl:template>
<xsl:template match="ns1:ProductionOrderRequest">
<xsl:apply-templates select="ns1:ProductionOrderRequest" />
</xsl:template>
<xsl:template match="ns1:ProductionOrderRequest">
<ProductionOrderRequest>
<MESKey><xsl:value-of select="@MESKey" /></MESKey>
<Material><xsl:value-of select="@Material" /></Material>
<ProductionVersion><xsl:value-of select="@ProductionVersion" /></ProductionVersion>
<Resource><xsl:value-of select="@Resource" /></Resource>
<Plant><xsl:value-of select="@Plant" /></Plant>
<OrderType><xsl:value-of select="@OrderType" /></OrderType>
<StartDate><xsl:value-of select="@StartDate" /></StartDate>
<StartTime><xsl:value-of select="@StartTime" /></StartTime>
<EndDate></EndDate>
<EndTime></EndTime>
<TotalOrderQty><xsl:value-of select="@TotalOrderQty" /></TotalOrderQty>
</ProductionOrderRequest>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
要转换的XML
<?xml version="1.0" encoding="utf-8"?>
<ProductionOrderRequests xmlns:ns0="http://foo.com/foo">
<ProductionOrderRequest>
<MESKey>TblDatProduction_4017</MESKey>
<Material>11596</Material>
<ProductionVersion>0001</ProductionVersion>
<Resource>60200001</Resource>
<Plant>BE01</Plant>
<OrderType>ZP76</OrderType>
<StartDate>24-10-2008</StartDate>
<StartTime>06:00:00</StartTime>
<EndDate></EndDate>
<EndTime></EndTime>
<TotalOrderQty>1.00</TotalOrderQty> …Run Code Online (Sandbox Code Playgroud) c# ×6
.net ×1
.net-core ×1
api ×1
asp.net ×1
asp.net-core ×1
constraints ×1
css ×1
datetime ×1
debugging ×1
foreach ×1
foreign-keys ×1
html ×1
linq ×1
moq ×1
regex ×1
ruby ×1
soap ×1
sql-server ×1
time ×1
unit-testing ×1
xml ×1
xslt ×1
xunit ×1