Ejemplo n.º 1
0
        public async Task DeactivateAsync(EnvironmentEdge record)
        {
            Ensure.NotNull(record, nameof(record));

            await db.EnvironmentEdges.PatchAsync((record.EnvironmentId, record.LocationId), new[] {
                Change.Remove("activated")
            });
        }
Ejemplo n.º 2
0
        public async Task DeleteAsync(EnvironmentEdge record)
        {
            Ensure.NotNull(record, nameof(record));

            await db.EnvironmentEdges.PatchAsync((record.EnvironmentId, record.LocationId), new[] {
                Change.Replace("deleted", Expression.Func("NOW"))
            });
        }
Ejemplo n.º 3
0
        // TODO: Batch insert

        public async Task <EnvironmentEdge> CreateAsync(CreateEnvironmentEdgeRequest request)
        {
            Ensure.NotNull(request, nameof(request));

            var edge = new EnvironmentEdge(
                environmentId: request.EnvironmentId,
                locationId: request.LocationId,
                distributionId: request.DistributionId
                );

            await db.EnvironmentEdges.InsertAsync(edge);

            return(edge);
        }