我有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