上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 164 下一页
摘要: http://blog.csdn.net/try530/article/details/7782704代码顺序为:OnAuthorization-->AuthorizeCore-->HandleUnauthorizedRequest如果AuthorizeCore返回false时,才会走HandleUnauthorizedRequest 方法,并且Request.StausCode会返回401,401错误又对应了Web.config中的 所有,AuthorizeCore==false 时,会跳转到 web.config 中定义的 loginUrl="~/"[csh 阅读全文
posted @ 2013-07-22 16:49 火腿骑士 阅读(306) 评论(0) 推荐(0)
摘要: https://code.google.com/p/mybatisnet/source/checkouthttp://blog.csdn.net/arvinstudy/article/details/7841020(iBatis使用小例)http://www.114xueche.com/video///服务层publicabstractclassBaseService{#region//实现事物处理publicvirtualvoidBeginTransaction(){IBatisNet.DataMapper.Mapper.Instance().BeginTransaction();}publ 阅读全文
posted @ 2013-07-12 10:10 火腿骑士 阅读(366) 评论(0) 推荐(0)
摘要: http://www.piotrwalat.net/basic-http-authentication-in-asp-net-web-api-using-message-handlers/ 阅读全文
posted @ 2013-07-10 18:11 火腿骑士 阅读(159) 评论(0) 推荐(0)
摘要: http://attributerouting.net/#asp-net-web-apihttps://github.com/johnpapa/CodeCamper/blob/master/CodeCamper.Web/App_Start/WebApiConfig.cs(方法二)http://aspnetwebstack.codeplex.com/wikipage?title=Attribute%20routing%20in%20Web%20APIhttps://github.com/ASP-NET-MVC/aspnetwebstack 阅读全文
posted @ 2013-07-10 17:12 火腿骑士 阅读(203) 评论(0) 推荐(0)
摘要: ASP.NET MVC4中调用WEB API的四个方法2012年06月07日00:05it168网站原创 作者:廖煜嵘 编辑:景保玉我要评论(0) 【IT168技术】当今的软件开发中,设计软件的服务并将其通过网络对外发布,让各种客户端去使用服务已经是十分普遍的做法。就.NET而言,目前提供了Remoting,WebService和WCF服务,这都能开发出功能十分强大的服务。然而,越来越多的互联网应用,希望将服务只是通过HTTP发布出去,而不是使用复杂的SOAP协议。为了解决这个问题,ASP.NET WebAPI就出现了。 ASP.NET API简单来说就是对REST协议进行了充分的支持,可.. 阅读全文
posted @ 2013-07-10 17:03 火腿骑士 阅读(859) 评论(0) 推荐(0)
摘要: 当一个web api抛出一个异常后此异常会被转化成一个HTTP响应错误代码为500的服务错误但是如果你不想让客户端看到500的错误码你也可以自定义错误码如下代码当用户输入的ID没有与之相关的数据则返回了错误码为404的错误(页面未找到)public Product GetProduct(int id) { Product item = repository.Get(id); if (item == null) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.... 阅读全文
posted @ 2013-07-10 16:49 火腿骑士 阅读(296) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Web.Http;namespace iAttendance.Controllers{ public class UsersController : ApiController { // GET api/users public IEnumerable GetUserList() { using (iAttendanceDataCon... 阅读全文
posted @ 2013-07-10 16:47 火腿骑士 阅读(505) 评论(0) 推荐(0)
摘要: 调函数(callback Function),顾名思义,用于回调的函数。 回调函数只是一个功能片段,由用户按照回调函数调用约定来实现的一个函数。回调函数是一个工作流的一部分,由工作流来决定函数的调用(回调)时机。回调函数包含下面几个特性:1、 属于工作流的一个部分;2、 必须按照工作流指定的调用约定来申明(定义);3、 他的调用时机由工作流决定,回调函数的实现者不能直接调用回调函数来实现工作流的功能;当通常大家说的回调函数一般就是按照别人的定好的接口规范写的,等待别人调用的函数,在C语言中,回调函数通常通过函数指针来传递;在Java中,通常就是编写另外一个类或类库的人规定一个接口,然后你来实现 阅读全文
posted @ 2013-07-10 16:01 火腿骑士 阅读(206) 评论(0) 推荐(0)
摘要: SELECT sum(a.buycount) buycount,(SELECT c.name from tb_product_type_info c -- 按年WHERE c.id=b.typeid) typename,year(a.createdate)as year from tb_order_detail a,tb_product_pk b where a.productname=b.oldproduct GROUP BY b.typeid,year(a.createdate);SELECT sum(a.buycount) buycount,(SELECT c.name from tb_ 阅读全文
posted @ 2013-07-04 12:00 火腿骑士 阅读(193) 评论(0) 推荐(0)
摘要: update tb_sdd_info a,tb_bnm_evian_info b set a.username=b.username where a.username=b.memberno and year(a.createtime) = 2012 and month(a.createtime)=11; 阅读全文
posted @ 2013-07-03 11:51 火腿骑士 阅读(133) 评论(0) 推荐(0)
上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 164 下一页