Example #1
0
        public AnchorRE Insert(AnchorRE entity)
        {
            var tracker = Set.Add(entity);

            _context.SaveChanges();
            return(tracker.Entity);
        }
Example #2
0
        public AnchorRE Insert(AnchorRE entity)
        {
            if (!AnchorRes.ContainsKey(entity.Id))
            {
                AnchorRes.TryAdd(entity.Id, entity);
                return(entity);
            }

            return(null);
        }
Example #3
0
        public AnchorRE Update(AnchorRE entity)
        {
            if (AnchorRes.ContainsKey(entity.Id))
            {
                AnchorRes[entity.Id] = entity;
                return(entity);
            }

            return(null);
        }
Example #4
0
 private Anchor Build(AnchorRE entity)
 {
     return(new Anchor()
     {
         Id = entity.Id,
         X = entity.X,
         Y = entity.Y,
         Z = entity.Z
     });
 }
Example #5
0
        public AnchorRE Upsert(AnchorRE entity)
        {
            if (AnchorRes.ContainsKey(entity.Id))
            {
                AnchorRes[entity.Id] = entity;
            }
            else
            {
                AnchorRes.TryAdd(entity.Id, entity);
            }

            return(entity);
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }