public AutentifikacijaProvjeraVM Provjera(string email, string lozinka)
        {
            AutentifikacijaProvjeraVM model = ctx.Kupci.Where(x => x.Email == email && x.Lozinka == lozinka)
                                              .Select(x => new AutentifikacijaProvjeraVM
            {
                Kupci   = x.KupacID,
                Email   = x.Email,
                Lozinka = x.Lozinka,
            }).FirstOrDefault();

            return(model);
        }
Exemplo n.º 2
0
        public AutentifikacijaProvjeraVM Provjera(string korisnickoIme, string lozinka)
        {
            Context ctx = new Context();

            AutentifikacijaProvjeraVM model = ctx.Korisnik.Where(x => x.KorisnickoIme == korisnickoIme && x.Lozinka == lozinka)
                                              .Select(x => new AutentifikacijaProvjeraVM
            {
                KorisnikId    = x.KorisnikId,
                Id            = x.KorisnikId.ToString(),
                Ime           = x.Ime,
                Prezime       = x.Prezime,
                KorisnickoIme = x.KorisnickoIme
            }).SingleOrDefault();

            return(model);
        }