只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2016-04-29 22:33 绥山潇洒哥 阅读(137) 评论(3) 推荐(1) 编辑
摘要: 1.模型建立,在模型上类上添加System.ComponentModel.DataAnnotations验证属性 ~~~C public class Product { public int Id { get; set; } [Required] public string Name { get; 阅读全文
posted @ 2016-04-07 22:34 绥山潇洒哥 阅读(805) 评论(0) 推荐(0) 编辑
摘要: ProductController.cs 可以根据用户类型分别显示商品价格,可以在类中修改 C \ region 商品价格 public virtual ActionResult GetDetailInfo(int id = 1, string viewName = "Detail") { YSWL 阅读全文
posted @ 2016-03-31 22:11 绥山潇洒哥 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 客户端在请求Web Api时可以有以下两种方式提供API key 基于Querystring提供Api key http://localhost:57967/Api/Values?key=12345 基于Request header体统API key 编写ApiKeyHandler 配置到特定的路由 阅读全文
posted @ 2016-03-31 16:50 绥山潇洒哥 阅读(3688) 评论(1) 推荐(1) 编辑
摘要: 在项目中,采用code first时建立的模型对象不能直接用于数据传输,需要从新根据需求建立Dto对象 为什么需要建立Dto对象呢? 那么在项目中需要将Model转换成DTO,为了快速方便的转换,可以采用Lambda Expression快速实现, 例如,建立了领域模型Book 建立DTO对象 建立 阅读全文
posted @ 2016-03-27 13:35 绥山潇洒哥 阅读(3877) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2016-03-25 09:27 绥山潇洒哥 阅读(40) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2016-03-24 14:02 绥山潇洒哥 阅读(15) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2016-03-22 17:16 绥山潇洒哥 阅读(12) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2016-03-21 17:11 绥山潇洒哥 阅读(16) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2016-03-21 14:44 绥山潇洒哥 阅读(22) 评论(0) 推荐(0) 编辑