public TableAdjustment RemoveSelected(LatticeData <CityAtsAttributes, CityATSAttributesRow> latticeData) { var selectedRows = latticeData.Selection().ToArray(); var selectedAttributesIds = selectedRows.Select(x => x.Id); var ids = string.Join(",", selectedAttributesIds); _context.Database.ExecuteSqlCommand($"DELETE FROM CityAtsAttributes WHERE Id IN ({ids})"); return(latticeData.Adjust(x => x .Remove(selectedRows) // .Message(LatticeMessage.AtsUser("success", "Remove", $"{selectedRows.Length} orders removed!")) )); }
public TableAdjustment RemoveSelected(LatticeData <Address, AddressRow> latticeData) { var selectedRows = latticeData.Selection().ToArray(); var selectedAddressIds = selectedRows.Select(row => row.Id); var ids = string.Join(",", selectedAddressIds); _context.Database.ExecuteSqlCommand($"DELETE FROM Addresses WHERE Id IN ({ids})"); return(latticeData.Adjust(wrapper => wrapper .Remove(selectedRows) // .Message(LatticeMessage.AtsUser("success", "Remove", $"{selectedRows.Length} orders removed!")) )); }