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
#include <stdio.h> | |
int main() | |
{ | |
int i,j; | |
char p[28][2] = {"AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"}; | |
for(i=0;i<27;i++){ | |
for(j=0;j<27;j++){ | |
printf(" (%.2s,%.2s),",p[j],p[i]); |
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 | |
.AddControllers() | |
.AddJsonOptions(opts => | |
{ | |
var enumConverter = new JsonStringEnumConverter(); | |
opts.JsonSerializerOptions.Converters.Add(enumConverter); | |
}); |
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
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
modelBuilder.Entity<CLASSNAME>(entity => | |
{ | |
entity.Property(e => e.Guid).HasDefaultValueSql("uuid()"); | |
entity.HasIndex(e => e.Guid).IsUnique(); | |
}); | |
base.OnModelCreating(modelBuilder); | |
} |
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
var something = await queryList | |
.Skip((page - 1) * pageSize) | |
.Take(pageSize) | |
.ToListAsync(); |
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
/// <summary> | |
/// Classe que controla o tratamento de exceções de regras de negócio. | |
/// </summary> | |
[Serializable] | |
public class BusinessException : Exception | |
{ | |
/// <summary> | |
/// Define um código para a exception; | |
/// </summary> | |
public int Code { get; set; } |
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
private readonly IServiceProvider _serviceScopeFactory; | |
public GenericBackgroundTask(IServiceProvider serviceScopeFactory) | |
{ | |
_serviceScopeFactory = serviceScopeFactory; | |
} | |
private async Task RunTaskAsync() | |
{ | |
await Task.Delay(TimeSpan.FromMinutes(1)); |
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 ChatMessageServer.Model; | |
using Microsoft.EntityFrameworkCore; | |
namespace ChatMessageServer.Database | |
{ | |
public class Context : DbContext | |
{ | |
public Context() | |
{ | |
Database.EnsureCreated(); |
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
private readonly IMapper _mapper; | |
public Class(IMapper mapper) | |
{ | |
_mapper = mapper; | |
} |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
namespace todo |
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.SwaggerDoc("v1", new OpenApiInfo { Title = "TodoList API", Version = "v1" }); | |
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, | |
$"{Assembly.GetExecutingAssembly().GetName().Name}.xml")); | |
}); |
OlderNewer