博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
存入azure table时忽略某个属性
阅读量:6914 次
发布时间:2019-06-27

本文共 1267 字,大约阅读时间需要 4 分钟。

public class CustomTableEntity : TableEntity    {        public override IDictionary
WriteEntity(Microsoft.WindowsAzure.Storage.OperationContext operationContext) { var entityProperties = base.WriteEntity(operationContext); var objectProperties = GetType().GetProperties(); foreach (var property in from property in objectProperties let nonSerializedAttributes = property.GetCustomAttributes(typeof(NonSerializedOnAzureAttribute), false) where nonSerializedAttributes.Length > 0 select property) { entityProperties.Remove(property.Name); } return entityProperties; } } [AttributeUsage(AttributeTargets.Property)] public class NonSerializedOnAzureAttribute : Attribute { } public class MyEntity : CustomTableEntity { public string MyProperty { get; set; } //[NonSerializedOnAzure] public string MyIgnoredProperty { get; set; } }

 There is an attribute called WindowsAzure.Table.Attributes.IgnoreAttribute can be set on the property you want to exclude.

 

转载于:https://www.cnblogs.com/akingyao/p/4031047.html

你可能感兴趣的文章
一些小功能实现
查看>>
前端学习 -- Css -- 行间距
查看>>
android图像处理(3) 浮雕效果
查看>>
实时视频应用之QoS关键技术分析
查看>>
【Asp.net之旅】--因自己定义控件注冊而引发的思考
查看>>
RAD Studio XE8 技术研讨会讲义与范例程序下载
查看>>
quick-cocos2d-x开发工具sublime text及其强力插件QuickXDev
查看>>
VirtualBox修改现有VDI虚拟磁盘大小
查看>>
mac 10.12 sierra 机械键盘+ratm可编程鼠标记录
查看>>
jmeter用beanshell调用自己写的jar进行MD5加密
查看>>
调用系统相机相冊
查看>>
最简单的视音频播放演示样例7:SDL2播放RGB/YUV
查看>>
vector draw 试用期结束的 激活方法
查看>>
Oracle数据库软件标准版的一个限制:仅仅能用一个rman channel
查看>>
docker官方文档中的dns,link,expose,publish
查看>>
使用 redis “捕捉” “用户登录过期” 事件
查看>>
MyEclipse 8.5安装Aptana
查看>>
C#动态对象(dynamic)示例(实现方法和属性的动态)
查看>>
Objective-C之成魔之路【8-訪问成员变量和属性】
查看>>
支付宝支付-常用支付API详解(查询、退款、提现等)
查看>>