我有entityframework回購,它從sqldb獲取行程信息。我創建了repo,並在構造函數中注入了dbContext並使用該上下文執行數據庫操作。 public class WorldRepository : IWorldRepository
{
private WorldContext _context;
public WorldRepository(
我的類被設計這樣的: public class Video {
public int Id {get; set;}
public string Title {get; set;}
public int PlaylistId {get; set;}
[ForeignKey("PlaylistId")]
public Playlist Playlis
所有, 我想保存多個記錄回數據庫,並想用樂觀併發(數據庫勝)。在我的模型中,我有 public class MySampleTable
{
[Key]
public int ID { get; set; }
public string SomeValue { get; set; }
[Timestamp]
public byte[] RowVer
Visual Studio - Snapshot of Project Structure 的Global.asax.cs文件,我已經把依賴和註冊的WebAPI控制器 using Autofac;
using Autofac.Integration.Mvc;
using Autofac.Integration.WebApi;
using StructureMap;
using System