「CodeFluent.Runtime.CodeFluentDuplicateException」の取得に問題があり、おそらく何か基本的なものがありません。CodeFluentDuplicateException私が紛失しているもの
しかし、私はまずServicestackとコードフルーツを使用してこのブログをフォローし、自分自身でtemplateを作成しました。 エンティティを取得するのに問題はありませんが、putを実行すると例外が表示されます。
多分テンプレートで何か間違ってしまったので、私は答えを探して別のアプローチをとったので、Webapiとテンプレートを使って、 "完全な"プロジェクトを見つけました。 Generate ASP .NET Web API Controllers using Templates。
これはすべてのコントローラを生成し、動作するようです。しかし、私は "置く"を使用すると同じexeptionを持っています。
public HttpResponseMessage Put([FromBody]Country value)
{
if (value == null || !value.Save())
{
return Request.CreateResponse(HttpStatusCode.BadRequest);
}
return Request.CreateResponse(HttpStatusCode.OK, value);
}
を置くため
これは、これは私がXamarin.Forms溶液内部の上方制御装置を使用する方法で生成された制御コードの一例です。
public async Task UpdateAsync(Country update, bool isNewItem=false)
{
HttpClient client = new HttpClient();
// RestUrl = http://developer.xamarin.com:8081/api/todoitems{0}
var uri = new Uri(string.Format(Constants.RestUrl2, update.Id));
try
{
var json = JsonConvert.SerializeObject(update);
var content = new StringContent(json, Encoding.UTF8, "application/json");
HttpResponseMessage response = null;
if (isNewItem)
{
response = await client.PostAsync(uri, content);
}
else
{
response = await client.PutAsync(uri, content);
}
if (response.IsSuccessStatusCode)
{
Debug.WriteLine(@" TodoItem successfully saved.");
}
}
catch (Exception ex)
{
Debug.WriteLine(@" ERROR {0}", ex.Message);
}
}
私には何が欠けていますか?任意の助け
おかげ //グレッグ
私はあなたがオプティミスティック同時実行や、インスタンスのRowVersionを有効にすると、重複した例外のもう一つのケースがあるsoftfluentサポート」.. からの回答を得ました