Пример #1
0
        public async Task <AgentBuildEntity> Update(AgentBuild agent)
        {
            var updater = Builders <AgentBuildEntity> .Update.Set(a => a.Abilities, agent.Abilities).Set(a => a.LastUpTime, agent.LastUpTime).Set(a => a.Availability, agent.Availability);

            var entity = await buildCollection.FindOneAndUpdateAsync(a => a.Url == agent.Url, updater);

            return(entity);
        }
Пример #2
0
        public async Task <AgentBuildEntity> Add(AgentBuild agent)
        {
            var entity = new AgentBuildEntity
            {
                Availability = agent.Availability,
                Abilities    = agent.Abilities,
                LastUpTime   = agent.LastUpTime,
                Url          = agent.Url
            };

            await buildCollection.InsertOneAsync(entity);

            return(entity);
        }