Exemplo n.º 1
0
        public IAgentEntity Add(IAgentEntity entity)
        {
            var collection = _ds.GetCollection <Agent>();

            entity.Id = collection.AsQueryable().Max(a => a.Id) + 1;

            collection.InsertOne((Agent)entity);

            return(entity);
        }
Exemplo n.º 2
0
        public bool Update(IAgentEntity entity)
        {
            var collection = _ds.GetCollection <Agent>();

            return(collection.UpdateOne(entity.Id, (Agent)entity));
        }