public AnchorRE Insert(AnchorRE entity) { var tracker = Set.Add(entity); _context.SaveChanges(); return(tracker.Entity); }
public AnchorRE Insert(AnchorRE entity) { if (!AnchorRes.ContainsKey(entity.Id)) { AnchorRes.TryAdd(entity.Id, entity); return(entity); } return(null); }
public AnchorRE Update(AnchorRE entity) { if (AnchorRes.ContainsKey(entity.Id)) { AnchorRes[entity.Id] = entity; return(entity); } return(null); }
private Anchor Build(AnchorRE entity) { return(new Anchor() { Id = entity.Id, X = entity.X, Y = entity.Y, Z = entity.Z }); }
public AnchorRE Upsert(AnchorRE entity) { if (AnchorRes.ContainsKey(entity.Id)) { AnchorRes[entity.Id] = entity; } else { AnchorRes.TryAdd(entity.Id, entity); } return(entity); }
public AnchorRE Update(AnchorRE entity) { DbSet <AnchorRE> set = Set; AnchorRE found = set.Find(entity.Id); if (found == null) { return(null); } found = entity; _context.SaveChanges(); return(found); }
public AnchorRE Upsert(AnchorRE entity) { DbSet <AnchorRE> set = Set; AnchorRE found = set.Find(entity.Id); if (found == null) { var tracker = set.Add(entity); _context.SaveChanges(); return(tracker.Entity); } found = entity; _context.SaveChanges(); return(found); }