This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ExcelResult : ActionResult | |
| { | |
| public string FileName { get; set; } | |
| public string Path { get;set; } | |
| public override void ExecuteResult(ControllerContext context) | |
| { | |
| context.HttpContext.Response.Buffer = true; | |
| context.HttpContext.Response.Clear(); | |
| context.HttpContext.Response.AddHeader("content-disposition", "attachment; filename=" + FileName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <strong>@TempData["erro"]</strong> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ExcelResult : ActionResult | |
| { | |
| public string FileName { get; set; } | |
| public string Path { get;set; } | |
| public override void ExecuteResult(ControllerContext context) | |
| { | |
| context.HttpContext.Response.Buffer = true; | |
| context.HttpContext.Response.Clear(); | |
| context.HttpContext.Response.AddHeader("content-disposition", "attachment; filename=" + FileName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //action | |
| public class Aluno | |
| { | |
| public int Id { get; set; } | |
| public string Nome { get; set; } | |
| public string Turma { get; set; } | |
| } | |
| //action | |
| var ufs = new List<UF> | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MeuLog : ActionFilterAttribute | |
| { | |
| public override void OnActionExecuting(ActionExecutingContext filterContext) | |
| { | |
| filterContext.HttpContext.Response.Write(Log("OnActionExecuting", filterContext.RouteData)); | |
| } | |
| public override void OnActionExecuted(ActionExecutedContext filterContext) | |
| { | |
| filterContext.HttpContext.Response.Write(Log("OnActionExecuted", filterContext.RouteData)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("WindowsPhone") | |
| { | |
| ContextCondition = ctx => ctx.GetOverriddenUserAgent().Contains("Windows Phone") | |
| }); | |
| DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Mobile") | |
| { | |
| ContextCondition = ctx => ctx.GetOverriddenUserAgent().Contains("Nexus 7") | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MeuFiltro : ActionFilterAttribute | |
| { | |
| public override void OnActionExecuting(HttpActionContext actionContext) | |
| { | |
| Debug.WriteLine("Executei o filtro"); | |
| } | |
| } | |
| //FilterConfig.cs | |
| filters.Add(new MeuFiltro()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MoviesController : ApiController | |
| { | |
| [HttpGet("actors/{actorId}/movies")] | |
| public Movie Get(int actorId) { } | |
| [HttpGet("directors/{directorId}/movies")] | |
| public Movie Get(int directorId) { } | |
| } | |
| [RoutePrefix("api/v1/customers")] | |
| public class CustomersV1Controller : ApiController { ... } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BasicAuthAttribute : ActionFilterAttribute, IAuthenticationFilter | |
| { | |
| public void OnAuthentication(AuthenticationContext filterContext) | |
| { | |
| } | |
| public void OnAuthenticationChallenge(AuthenticationChallengeContext filterContext) | |
| { | |
| var user = filterContext.HttpContext.User; | |
| if (user == null || !user.Identity.IsAuthenticated) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Onde tudo começou: http://alistapart.com/article/responsive-web-design | |
| http://alistapart.com/d/responsive-web-design/ex/ex-site-flexible.html | |
| Comparativo | |
| https://docs.google.com/a/cavalcante.net/spreadsheet/ccc?key=0Al0lI17fOl9DdDgxTFVoRzFpV3VCdHk2NTBmdVI2OXc#gid=0 | |
| Responsive calculator | |
| http://rwdcalc.com/ | |
| Pixel to EM |
OlderNewer