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
namespace PuntoTechApp | |
{ | |
public class BaseEntity | |
{ | |
public int Id { get; set; } | |
} | |
} |
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
using System; | |
namespace PuntoTechApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine("隆Os damos la bienvenida a PuntoTechApp!"); | |
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
using System; | |
// Paso 1: Referencia a Linq para poder usarlo en nuestro software | |
using System.Linq; | |
namespace PuntoTechApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
// Paso 1: Operaci贸n CREATE para la BD | |
private int CreatePost(Post newPost) | |
{ | |
int result = 0 | |
if (newPost != null) | |
{ | |
ctx.Posts.Add(newPost); | |
result = ctx.SaveChanges(); | |
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
// Paso 1: Obtener una entidad por ID | |
private Post GetPost(int postToSearchId) | |
{ | |
if (postToSearchId != 0) | |
{ | |
IQueryable<Post> entitiesInSearch = ctx.Posts | |
.Where(p => p.Id == postToSearchId) | |
Post postToSearch = entitiesInSearch.SingleOrDefault() | |
return postToSearch; |
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
using Microsoft.EntityFrameworkCore; | |
namespace PuntoTechApp | |
{ | |
public class MyContext : DbContext | |
{ | |
public DbSet<Posts> Posts { get; set; } | |
// Modificaci贸n: a帽adir colecci贸n de Authors | |
public DbSet<Authors> Authors { get; set; } |
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
provider "azurerm" { | |
version = "=2.40.0" | |
features {} | |
} | |
resource "azurerm_resource_group" "resgroup" { | |
name = "newfunctionapp-rg" | |
location = "West Europe" | |
} |
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
# Task: Terraform init | |
- task: petergroenewegen.PeterGroenewegen-Xpirit-Vsts-Release-Terraform.Xpirit-Vsts-Release-Terraform.Terraform@2 | |
displayName: 'Terraform init' | |
inputs: | |
TemplatePath: '$(System.DefaultWorkingDirectory)/_NombreArtifact/Terraform' | |
Arguments: init | |
InstallTerraform: true | |
UseAzureSub: true | |
ConnectedServiceNameARM: 'Conexi贸n a Azure' |