public class CustomTableEntity : TableEntity
{
public override IDictionary<string, EntityProperty> 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 >
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.

存入azure table时忽略某个属性的更多相关文章

  1. Jackson 序列化/反序列化时忽略某属性

    https://www.iteye.com/blog/wwwcomy-2397340 博客分类: Spring jacksonread_onlyjsonignore  基于Spring MVC的RES ...

  2. Mybatis-plus 实体类新增属性,使用实体类执行sql操作时忽略该属性 注解

    @TableField(exist = false) 注解加载bean属性上,表示当前属性不是数据库的字段,但在项目中必须使用,这样在新增等使用bean的时候,mybatis-plus就会忽略这个,不 ...

  3. C# Newtonsoft.Json JObject移除属性,在序列化时忽略

    原文 C# Newtonsoft.Json JObject移除属性,在序列化时忽略 一.针对 单个 对象移除属性,序列化时忽略处理 JObject实例的 Remove() 方法,可以在 指定序列化时移 ...

  4. java对象json序列化时忽略值为null的属性

    环境: jdk: openjdk11 操作系统: windows 10教育版1903 目的: 如题,当一个对象里有些属性值为null 的不想参与json序列化时,可以添加如下注解 import com ...

  5. Azure Table storage 基本用法 -- Azure Storage 之 Table

    Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table,其中的 Table 就是本文的主角 Azure Tabl ...

  6. 自定义 Azure Table storage 查询过滤条件

    本文是在Azure Table storage 基本用法一文的基础上,介绍如何自定义 Azure Table storage 的查询过滤条件.如果您还不太清楚 Azure Table storage ...

  7. FreeSql (七)插入数据时忽略列

    var connstr = "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;" + "Initia ...

  8. FreeSql (十三)更新数据时忽略列

    var connstr = "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;" + "Initia ...

  9. foreach DataTable或Table时要略过第一行。

    昨天有续写一个练习<输入数字动态创建行(二)>http://www.cnblogs.com/insus/p/4916260.html ,最终是需要把数据存入数据库中. 在循环ASP:Tab ...

随机推荐

  1. Android使用图表库简单教程

    经常要用到统计数据这个功能,要直观的显示出来,最好还是用图表.自己弄也麻烦,所以用了Github上的一个非常著名的开源图标库:MpChart. 使用前去网上找它俩的jar包,然后导入就行.资源比较好找 ...

  2. DataReader方式 获取数据

    /// /// 得到一个对象实体 DataReader方式 /// /// /// 成功返回对象模型,失败返回null public DotNet.Model.Base_Department GetM ...

  3. OO设计基本原则

    OO本身就是一种大的设计模式,它是随着软件规模越来越大产生出来帮助人们建模和开发的理念,生来就带着封装.继承.多态等可复用基因.为了充分发挥这些基因的功效,使用者需要遵守一定的原则,就是所谓的面向对象 ...

  4. kibana.yml(中文配置详解)

    # Kibana is served by a back end server. This controls which port to use. # server.port: 5601 # The ...

  5. MYSQL中str_to_date函数的用法

    str_to_date(str,format) 函数的用法 str_to_date函数将str转化为日期型的数据,format表示转化后的格式. format参数格式: 常用: %Y  年 %m  月 ...

  6. fcntl详细说明

    功能描述:根据文件描述词来操作文件的特性. #include <unistd.h>#include <fcntl.h> int fcntl(int fd, int cmd);  ...

  7. SPQuery DateTime 类型查询

    使用SPQuery查询时间,默认查询会忽略 时分秒,只检查日期,如果要检查时间,则必须添加 IncludeTimeValue='TRUE' 格式如下: <Where>    <Gt& ...

  8. Linux 多台虚拟机进行同步时间

    用SecureCRT分别连接多台虚拟机,然后使用交互窗口:

  9. resolve或reject之后还需要return吗

    答案: 需要 今日碰到一个问题, 是我的同事发现的,如果不说的话可能一直没有注意到 这个代码 在reject 后还会执行, 但是谁也没有注意到, 但是不会报错, 因为当一个promise是resolv ...

  10. CF547D Mike and Fish

    欧拉回路,巧妙的解法. 发现每一个点$(x, y)$实际上是把横坐标和$x$和纵坐标$y$连一条线,然后代进去跑欧拉回路,这样里一条边对应了一个点,我们只要按照欧拉回路间隔染色即可. 注意到原图可能并 ...