protected override void Seed(DataAccess.ApplicationDB context) { // This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method // to avoid creating duplicate seed data. }
public override string GetUserNameByEmail(string email) { using (ApplicationDB dbContext = new DataAccess.ApplicationDB()) { string username = (from u in dbContext.Users where string.Compare(email, u.Email) == 0 select u.Username).FirstOrDefault(); return(!string.IsNullOrEmpty(username) ? username : string.Empty); } }