This file contains 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
@using AjaxHelpers.Extensions | |
@model AjaxHelpers.Models.TaskList | |
@{ | |
ViewBag.Title = "Index"; | |
Layout = "~/Views/Shared/_Layout.cshtml"; | |
} | |
<h2>TaskList</h2> | |
@using (Html.BeginForm()) | |
{ | |
<div class="row"> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
.divTotal{ | |
border:1px solid gray; | |
padding: 10px; | |
width: 500px; |
This file contains 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
<h4 class="text-success">Listando tarefas com o Datatables</h4> | |
<div style="width:90%;"> | |
<table id="Jdatatable" class="table table-responsive table-bordered"> | |
<thead> | |
<tr> | |
<th>Id</th> | |
<th>Titulo</th> | |
<th>Criado em:</th> | |
<th>Descrição</th> | |
<th>Fechado ?</th> |
This file contains 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
services.AddSwaggerGen(c => | |
{ | |
c.AddSecurityDefinition( | |
"Bearer", | |
new ApiKeyScheme() | |
{ | |
In = "header", | |
Description = "Please insert JWT with Bearer into field", | |
Name = "Authorization", | |
Type = "apiKey" |
This file contains 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
services.AddDbContext<ApiForBlogContext>(options => | |
options.UseInMemoryDatabase("InMemoryDatabase")); |
This file contains 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
app.UseSwagger(); | |
app.UseSwaggerUI(c => | |
{ | |
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); | |
c.InjectStylesheet("/swagger-ui/custom.css"); | |
c.InjectOnCompleteJavaScript("/swagger-ui/custom.js"); | |
}); | |
app.Run(context => { |
This file contains 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 AutoMapperProfile: Profile | |
{ | |
public AutoMapperProfile() | |
{ | |
CreateMap<User, UserDto>(); | |
CreateMap<UserDto, User>(); | |
CreateMap<Post, PostDto>(); | |
CreateMap<PostDto, Post>(); | |
} |
This file contains 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 UserController: Controller | |
{ | |
private UserService _service; | |
private IMapper _mapper; | |
/// <summary> | |
/// Construtor | |
/// </summary> | |
/// <param name="service"></param> | |
/// <param name="mapper"></param> |
This file contains 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 AlgumController | |
{ | |
public IActionResult GetAll() | |
{ | |
//recupero todas as entidades | |
var users = _service.GetAll(); | |
//transformo uma lista de entidades em uma lista de dtos | |
var userDtos = _mapper.Map<IList<UserDto>>(users); | |
This file contains 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
[Activity(Theme = "@style/Theme.Splash", | |
MainLauncher = true, NoHistory = true)] | |
public class SplashActivity : Activity | |
{ | |
protected override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); | |
} |
OlderNewer