C# EWS 更改扩展的 MapiPropertyType 属性
C# EWS Change the MapiPropertyType of an extended property
我想知道我是否更改了 EWS Extended 属性 的数据类型,是否有任何我需要做的类似于在使用它之前更改数据库中的 table?
目前我只是声明一个自定义扩展 属性 并开始使用它,但现在我想将它从 MapiPropertyType.Integer
更改为 MapiPropertyType.Long
。
以下是一个 属性 定义示例,与我当前的定义类似:
<pre>static class MyAppSchema {
private static readonly Guid property_set = Guid.Parse("{my guid value}");
public static ExtendedPropertyDefinition ItemId = new ExtendedPropertyDefinition(
propertySetId: property_set,
name: "ItemId",
mapiType: MapiPropertyType.Integer
);
}</pre>
我目前是这样使用的:
item.SetProperty<int>(MyAppSchema.ItemId, item_from_another_db.ItemId);
我想开始使用以下 属性 定义:
<pre>static class MyAppSchema {
private static readonly Guid property_set = Guid.Parse("{my guid value}");
public static ExtendedPropertyDefinition ItemId = new ExtendedPropertyDefinition(
propertySetId: property_set,
name: "ItemId",
mapiType: MapiPropertyType.Long
);
}</pre>
我会像这样开始使用它:
item.SetProperty<long>(MyAppSchema.ItemId, item_from_another_db.ItemId);
相关邮箱中已有数据,我仍然希望能够使用 SearchFilter.IsEqualTo
等搜索过滤器。我担心如果我更改数据类型,我以后会遇到问题。
不能这样做 - 一旦您在特定邮箱中使用了自定义 属性,您将永远受困于该 属性 及其定义。如果您想要不同的类型,则需要创建一个具有不同名称的 属性。
我想知道我是否更改了 EWS Extended 属性 的数据类型,是否有任何我需要做的类似于在使用它之前更改数据库中的 table?
目前我只是声明一个自定义扩展 属性 并开始使用它,但现在我想将它从 MapiPropertyType.Integer
更改为 MapiPropertyType.Long
。
以下是一个 属性 定义示例,与我当前的定义类似:
<pre>static class MyAppSchema {
private static readonly Guid property_set = Guid.Parse("{my guid value}");
public static ExtendedPropertyDefinition ItemId = new ExtendedPropertyDefinition(
propertySetId: property_set,
name: "ItemId",
mapiType: MapiPropertyType.Integer
);
}</pre>
我目前是这样使用的:
item.SetProperty<int>(MyAppSchema.ItemId, item_from_another_db.ItemId);
我想开始使用以下 属性 定义:
<pre>static class MyAppSchema {
private static readonly Guid property_set = Guid.Parse("{my guid value}");
public static ExtendedPropertyDefinition ItemId = new ExtendedPropertyDefinition(
propertySetId: property_set,
name: "ItemId",
mapiType: MapiPropertyType.Long
);
}</pre>
我会像这样开始使用它:
item.SetProperty<long>(MyAppSchema.ItemId, item_from_another_db.ItemId);
相关邮箱中已有数据,我仍然希望能够使用 SearchFilter.IsEqualTo
等搜索过滤器。我担心如果我更改数据类型,我以后会遇到问题。
不能这样做 - 一旦您在特定邮箱中使用了自定义 属性,您将永远受困于该 属性 及其定义。如果您想要不同的类型,则需要创建一个具有不同名称的 属性。