Skip to content

Instantly share code, notes, and snippets.

View gavilanch's full-sized avatar

Felipe Gavilán gavilanch

  • República Dominicana
View GitHub Profile
@gavilanch
gavilanch / Producto.cs
Created February 10, 2023 22:26
Codigo para algoritmo determina que productos se pueden comprar con un giftcard
[DebuggerDisplay("{Nombre} ({Precio})")]
internal class Producto : IComparable
{
public Producto(string nombre, decimal precio)
{
Nombre = nombre;
Precio = precio;
}
public string Nombre { get; set; }
ALTER PROCEDURE InsertarGeneroPelicula
@peliculaId int,
@generoId int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
BEGIN TRANSACTION;
GO
CREATE TABLE [AspNetRoles] (
[Id] nvarchar(450) NOT NULL,
[Name] nvarchar(256) NULL,
[NormalizedName] nvarchar(256) NULL,
[ConcurrencyStamp] nvarchar(max) NULL,
CONSTRAINT [PK_AspNetRoles] PRIMARY KEY ([Id])
);
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace ConsoleApp4
{
class Program
{
<select class="form-control" @onchange="ChangeMessageFilter">
<option value="---" selected=@(Filter.Message == "---")>---</option>
<option value="Request" selected=@(Filter.Message == "Request")>Request</option>
<option value="Response" selected=@(Filter.Message == "Response")>Response</option>
</select>
"Key": {
"Type": "Store",
"StoreName": "My",
"StoreLocation": "CurrentUser",
"Name": "CN=SUBJECT_NAME"
}
"IdentityServer": {
"Key": {
"Type": "Development"
}
}
USE [master]
GO
/****** Object: Database [ValuesDB] Script Date: 16-Jul-20 10:45:22 PM ******/
CREATE DATABASE [ValuesDB]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'ValuesDB', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\ValuesDB.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
LOG ON
( NAME = N'ValuesDB_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\DATA\ValuesDB_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
GO
peliculasQueryable = peliculasQueryable.OrderByDescending(x => x.VotosPelicula.Average(y => y.Voto));
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddDbContext<ApplicationDbContext>((serviceProvider, dbContextBuilder) =>
{
var connectionStringPlaceHolder = Configuration.GetConnectionString("PlaceHolderConnection");
var httpContextAccessor = serviceProvider.GetRequiredService<IHttpContextAccessor>();
var dbName = httpContextAccessor.HttpContext.Request.Headers["tenantId"].First();
var connectionString = connectionStringPlaceHolder.Replace("{dbName}", dbName);
dbContextBuilder.UseSqlServer(connectionString);
});