Datastax C#Driver - 如何将UDT字段映射到枚举?

时间:2015-08-05 03:01:43

标签: c# cassandra datastax

是否有内置方法使用Datastax C#驱动程序将Cassandra UDT(用户定义类型)映射到带有枚举的C#类?

示例:

public enum Options{
   OptionOne,
   OptionTwo,
   OptionThree
}

public class MyClass
{
   public Options Option { get; set; }
}

session.UserDefinedTypes.Define(
   UdtMap.For<MyClass>()
      .Map(a => a.Option, "option")
);

http://docs.datastax.com/en/developer/csharp-driver/2.1/csharp-driver/reference/21features/mappingUdts.html?scroll=mapping-udts

0 个答案:

没有答案