public CostumerController(TokaContext context, IMapper mapper)
 {
     _mapper  = mapper;
     _context = context;
 }
 public UsuariosController(TokaContext Contexto)
 {
     _Contexto = Contexto;
 }
示例#3
0
        public static async Task SeedData(TokaContext context, UserManager <AppUser> userManager)
        {
            if (!context.Costumers.Any())
            {
                var costumers = new List <Costumer>
                {
                    new Costumer
                    {
                        FirstName = "Memo",
                        LastName  = "Herdez",
                        Cellphone = "352458448",
                        Adress    = "Esta #2344",
                        BirthDate = DateTime.Now.Date.AddMonths(-2).ToShortDateString()
                    },
                    new Costumer
                    {
                        FirstName = "Nick",
                        LastName  = "Gerz",
                        Cellphone = "551323221",
                        Adress    = "White brow #244",
                        BirthDate = DateTime.Now.Date.AddMonths(-3).ToShortDateString(),
                        Status    = true
                    },
                    new Costumer
                    {
                        FirstName = "Larry",
                        LastName  = "Atota",
                        Cellphone = "952417881",
                        Adress    = "Canionga #144",
                        BirthDate = DateTime.Now.Date.AddMonths(-4).ToShortDateString()
                    }
                };
                context.Costumers.AddRange(costumers);
                context.SaveChanges();
            }

            if (!userManager.Users.Any())
            {
                var users = new List <AppUser>
                {
                    new AppUser
                    {
                        UserName = "******",
                        Email    = "*****@*****.**"
                    },

                    new AppUser
                    {
                        UserName = "******",
                        Email    = "*****@*****.**"
                    },
                    new AppUser
                    {
                        UserName = "******",
                        Email    = "*****@*****.**"
                    }
                };
                foreach (var user in users)
                {
                    await userManager.CreateAsync(user, "Pa$$w0rd");
                }
            }
        }
示例#4
0
 public PersonasFisicasController(TokaContext Contexto, IConfiguration Configuracion)
 {
     _Contexto      = Contexto;
     _Configuracion = Configuracion;
 }
示例#5
0
 public LoginController(TokaContext context, IConfiguration configuration)
 {
     _context      = context;
     Configuration = configuration;
 }