摘要:
/* - - - - - - - - - - - - - - - - - - - - - - - - * Stream 和 byte[] 之间的转换 * - - - - - - - - - - - - - - - - - - - - - - - */ /// <summary> /// 将 Stream 转成 byte[] /// </summary> public byte[] StreamToBytes(Stream stream) { byte[] bytes = new byte[stream.Length]; stream.Read(bytes, 0, byt 阅读全文
posted @ 2011-09-20 17:10
焦涛
阅读(169)
评论(0)
推荐(0)
摘要:
前面一节,我们学习了怎样处理POCO实体含有复杂类型,但是对于增删改会出错,我们还要继续处理,要添加[Composition]特殊属性标识符。// "Master" domain entity class.public class Parameter { [Key] public long Id { get; set; } public string Name { get; set; } [Include] [Composition] [Association("Parameter_Options", "Id", "Para 阅读全文
posted @ 2011-09-20 15:23
焦涛
阅读(397)
评论(0)
推荐(0)
摘要:
在有些情况下,我们需要在POCO实体中定义一个复杂的类型,像下面的场景// "Master" domain entity class.public class Parameter { [Key] public long Id { get; set; } public string Name { get; set; } public List<Option> Options { get; set; }}// "Details" domain entity class.public class Option { [Key] public long 阅读全文
posted @ 2011-09-20 15:11
焦涛
阅读(350)
评论(0)
推荐(0)
摘要:
定义一个让POCO实体在WCF RIA Service的客户端暴露出来.POCO实体很有用,有时我们需要去数据库中某表中的部分字段,在WCF RIA Service中就可以定义一个POCO实体。来减小数据的传输量。 (1)首先如何定义POCO实体 public class UploadFileInf 阅读全文
posted @ 2011-09-20 14:40
焦涛
阅读(653)
评论(0)
推荐(0)
浙公网安备 33010602011771号