public override void Delete(ILocation entity) { using (Context = new SysInventoryLinqSqlContextDataContext()) { Context.GetTable <Location>().DeleteOnSubmit(Context.GetTable <Location>().First(x => x.Id == entity.Id)); Context.SubmitChanges(); } }
public override void Delete(ILogEntry entity) { using (Context = new SysInventoryLinqSqlContextDataContext()) { Context.Logs.DeleteOnSubmit(Context.Logs.First(l => l.LogId == entity.Id)); Context.SubmitChanges(); } }
public override void Add(ILocation entity) { using (Context = new SysInventoryLinqSqlContextDataContext()) { entity.Id = Guid.NewGuid(); Context.GetTable <Location>().InsertOnSubmit((Location)entity); Context.SubmitChanges(); } }
public override void Update(ILocation entity) { using (Context = new SysInventoryLinqSqlContextDataContext()) { var found = Context.GetTable <Location>().First(e => e.Id == entity.Id); found.ParentId = entity.ParentId; found.PoDId = entity.PoDId; found.Name = entity.Name; Context.SubmitChanges(); } }