예제 #1
0
        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.
        }
예제 #2
0
        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);
            }
        }