public async Task <AUser> Login(string email, string password) { AUser user = await ModelDbSets.AsNoTracking() .SingleOrDefaultAsync ( e => e.Email.ToLower().Equals(email.ToLower()) ); if (user == null) { return(null); } else { //If user exists check password // TODO : Send this to a service if (user.Password == password) { return(user); } else { return(null); }; } }
public Customer GetCustomerByEmail(string email) { var customerDetail = ModelDbSets.AsNoTracking().Where(e => e.Email.Equals(email)).FirstOrDefault(); if (customerDetail != null) { return(customerDetail); } throw new NotFoundException($"Customer with email {email} was not found"); }
public async Task <bool> EmailExistAsync(string email) { return(await ModelDbSets.AsNoTracking().AnyAsync(e => e.Email.Equals(email, StringComparison.CurrentCultureIgnoreCase))); }
public async Task <bool> UserIdExistAsync(string userId) { return(await ModelDbSets.AsNoTracking().AnyAsync(e => e.UserId.Equals(userId))); }
public async Task <bool> EmailExistAsync(string email) { return(await ModelDbSets.AsNoTracking().AnyAsync(e => e.Email.Equals(email))); }
public async Task <IEnumerable <ARole> > GetRolesFromUser(int userId) { return(await ModelDbSets.AsNoTracking().ToListAsync()); }