Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(string id)
        {
            var ids    = id.Split(',', StringSplitOptions.RemoveEmptyEntries).ToArray();
            var result = await _devices.DeleteOneAsync(a => ids.Contains(a.Id));

            if (result.DeletedCount == 0)
            {
                return(NotFound());
            }

            return(Ok(new { Deleted = result.DeletedCount }));
        }