Example #1
0
        public async Task Insert(Build item)
        {
            item.Id                   = Guid.NewGuid();
            item.LabUrl               = item.GenerateLabUrl();
            item.FullBuildString      = item.GenerateFullBuildString();
            item.AlternateBuildString = item.GenerateAlternateBuildString();

            await _buildCollection.InsertOneAsync(item);
        }
Example #2
0
        public async Task Update(Build item)
        {
            Build old = await SelectById(item.Id);

            item.Added                = old.Added;
            item.Modified             = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
            item.LabUrl               = item.GenerateLabUrl();
            item.FullBuildString      = item.GenerateFullBuildString();
            item.AlternateBuildString = item.GenerateAlternateBuildString();

            await _buildCollection.ReplaceOneAsync(Builders <Build> .Filter.Eq(b => b.Id, item.Id), item);
        }