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); }
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); }