使用 React Admin 可以将过滤器添加到列表组件中。演示中可以看到这样的示例:https ://marmelab.com/react-admin-demo/#/commands
此特定组件的代码:https://github.com/marmelab/react-admin/blob/master/examples/demo/src/orders/OrderList.js
const OrderFilter = withStyles(filterStyles)(({ classes, ...props }) => (
<Filter {...props}>
<SearchInput source="q" alwaysOn />
<ReferenceInput source="customer_id" reference="customers">
<AutocompleteInput
optionText={choice =>
`${choice.first_name} ${choice.last_name}`
}
/>
</ReferenceInput>
<DateInput source="date_gte" />
<DateInput source="date_lte" />
<TextInput source="total_gte" />
<NullableBooleanInput source="returned" />
</Filter>));
...
const OrderList = ({ classes, ...props }) => (
<List
{...props}
filterDefaultValues={{ status: 'ordered' }}
sort={{ field: 'date', order: 'DESC' }}
perPage={25}
filters={<OrderFilter />}
>
<StyledTabbedDatagrid />
</List>
);
Run Code Online (Sandbox Code Playgroud)
但是,我无法弄清楚将相同的功能添加到ReferenceManyField。例如,在演示网站中,这将是客户编辑组件的“订单”选项卡。有没有办法为 …
如何从SQL Server 2016中的列中删除加密属性?
我已使用SQL Server Management Studio 2016中的始终加密向导启用了此功能,但我想从之前添加的某些列中删除加密。
我想知道以下两件事是否可能(如果可以,怎么办?):
使用Entity Framework 5,可以在Linq查询中使用SQL Server Spatial过程.
例如,使用DbGeography对象,您可以使用"Buffer()"方法,该方法将转换为SQL Server中的STBuffer.同样,Intersects()将转换为STIntersects.
这是一个有效的示例查询:
var point = DbGeography.FromText(string.Format("POINT({1} {0})", latitude, longitude), 4326);
var query = from person in persons
let region = point.Buffer(radius)
where person.Location.Intersects(region)
select person;
Run Code Online (Sandbox Code Playgroud)
我想使用过滤器的可能性(因为这可以加快您的查询,如果准确性不是您主要关注的问题,请参阅:http://www.pauldmendoza.com/post/SQL-Server-Filter-vs-STInterects. aspx)但是,我似乎无法在EF5中找到如何做到这一点.这可能吗?如果是的话:怎么样?
我正在使用SQL Server 2008 R2.