Hello ,
        I have created a plugin which creates table in db. Every time i try to install this plugin i get error that sequence contains no matching element.I have checked and rechecked my code and compared it with the code of the existing plugins and i couldn't find any difference. Here are the code files.

public class EfStartUpTask : IStartupTask
    {
        public void Execute()
        {
            //It's required to set initializer to null (for SQL Server Compact).
            //otherwise, you'll get something like "The model backing the 'your context name' context has changed since the database was created. Consider using Code First Migrations to update the database"
            Database.SetInitializer<MobileLoginObjectContext>(null);
        }

        public int Order
        {
            //ensure that this task is run first
            get { return 0; }
        }
    }

  public partial class MobileLoginRecord : BaseEntity
    {
        /// <summary>
        /// Gets or sets the store identifier
        /// </summary>
        public string MobileNumber { get; set; }
        public int OTP { get; set; }
        public bool IsActive { get; set; }
        public bool IsUsed { get; set; }
        public DateTime ModifyDate { get; set; }
        public DateTime CreatedDate { get; set; }
    }


  public partial class MobileLoginRecordMap : NopEntityTypeConfiguration<MobileLoginRecord>
    {
        public MobileLoginRecordMap()
        {
            ToTable("MobileLogin");
            HasKey(x => x.Id);

            //Property(x => x.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(x => x.MobileNumber).HasMaxLength(10).IsRequired();
            Property(x => x.OTP).IsRequired().HasColumnType("int");
            Property(x => x.IsActive).HasColumnType("bool");
            Property(x => x.IsUsed).HasColumnType("bool").IsRequired();
            Property(x => x.IsActive).IsRequired();
            Property(x => x.ModifyDate);
            Property(x => x.CreatedDate).IsRequired();
        }
    }



public class MobileLoginObjectContext : DbContext, IDbContext
    {
        #region Ctor

        public MobileLoginObjectContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {
            //((IObjectContextAdapter) this).ObjectContext.ContextOptions.LazyLoadingEnabled = true;
        }

        #endregion

        #region Utilities

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new MobileLoginRecordMap());

            //disable EdmMetadata generation
            //modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
         base.OnModelCreating(modelBuilder);
        }

        #endregion

        #region Methods

        public string CreateDatabaseScript()
        {
            return ((IObjectContextAdapter)this).ObjectContext.CreateDatabaseScript();
        }

        public new IDbSet<TEntity> Set<TEntity>() where TEntity : BaseEntity
        {
            return base.Set<TEntity>();
        }

        /// <summary>
        /// Install
        /// </summary>
        public void Install()
        {
            //create the table
            var dbScript = CreateDatabaseScript();
            Database.ExecuteSqlCommand(dbScript);
            SaveChanges();
        }

        /// <summary>
        /// Uninstall
        /// </summary>
        public void Uninstall()
        {
            //drop the table
            var tableName = this.GetTableName<MobileLoginRecord>();
            this.DropPluginTable(tableName);
        }

        /// <summary>
        /// Execute stores procedure and load a list of entities at the end
        /// </summary>
        /// <typeparam name="TEntity">Entity type</typeparam>
        /// <param name="commandText">Command text</param>
        /// <param name="parameters">Parameters</param>
        /// <returns>Entities</returns>
        public IList<TEntity> ExecuteStoredProcedureList<TEntity>(string commandText, params object[] parameters) where TEntity : BaseEntity, new()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Creates a raw SQL query that will return elements of the given generic type.  The type can be any type that has properties that match the names of the columns returned from the query, or can be a simple primitive type. The type does not have to be an entity type. The results of this query are never tracked by the context even if the type of object returned is an entity type.
        /// </summary>
        /// <typeparam name="TElement">The type of object returned by the query.</typeparam>
        /// <param name="sql">The SQL query string.</param>
        /// <param name="parameters">The parameters to apply to the SQL query string.</param>
        /// <returns>Result</returns>
        public IEnumerable<TElement> SqlQuery<TElement>(string sql, params object[] parameters)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Executes the given DDL/DML command against the database.
        /// </summary>
        /// <param name="sql">The command string</param>
        /// <param name="doNotEnsureTransaction">false - the transaction creation is not ensured; true - the transaction creation is ensured.</param>
        /// <param name="timeout">Timeout value, in seconds. A null value indicates that the default value of the underlying provider will be used</param>
        /// <param name="parameters">The parameters to apply to the command string.</param>
        /// <returns>The result returned by the database after executing the command.</returns>
        public int ExecuteSqlCommand(string sql, bool doNotEnsureTransaction = false, int? timeout = null, params object[] parameters)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Detach an entity
        /// </summary>
        /// <param name="entity">Entity</param>
        public void Detach(object entity)
        {
            if (entity == null)
                throw new ArgumentNullException("entity");

            ((IObjectContextAdapter)this).ObjectContext.Detach(entity);
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets a value indicating whether proxy creation setting is enabled (used in EF)
        /// </summary>
        public virtual bool ProxyCreationEnabled
        {
            get
            {
                return this.Configuration.ProxyCreationEnabled;
            }
            set
            {
                this.Configuration.ProxyCreationEnabled = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether auto detect changes setting is enabled (used in EF)
        /// </summary>
        public virtual bool AutoDetectChangesEnabled
        {
            get
            {
                return this.Configuration.AutoDetectChangesEnabled;
            }
            set
            {
                this.Configuration.AutoDetectChangesEnabled = value;
            }
        }

        #endregion
}



  public class DependencyRegistrar : IDependencyRegistrar
    {
        /// <summary>
        /// Register services and interfaces
        /// </summary>
        /// <param name="builder">Container builder</param>
        /// <param name="typeFinder">Type finder</param>
        /// <param name="config">Config</param>
        public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config)
        {
            builder.RegisterType<MobileLoginService>().As<IMobileLoginService>().InstancePerLifetimeScope();

            //data context
            this.RegisterPluginDataContext<MobileLoginObjectContext>(builder, "nop_object_context_OTP_Login");

            //override required repository with our custom context
            builder.RegisterType<EfRepository<MobileLoginRecord>>()
                .As<IRepository<MobileLoginRecord>>()
                .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_OTP_Login"))
                .InstancePerLifetimeScope();
        }

        /// <summary>
        /// Order of this dependency registrar implementation
        /// </summary>
        public int Order
        {
            get { return 1; }
        }
    }



public class OTPLoginPlugin : BasePlugin, IMiscPlugin
    {

        #region Fields

        private MobileLoginObjectContext _context;
        //private IRepository<MobileLoginRecord> _mobileRepo;

        #endregion

        #region Ctor

         //public OTPLoginPlugin(MobileLoginObjectContext context, IRepository<MobileLoginRecord> mobileRepo)
        public OTPLoginPlugin(MobileLoginObjectContext context)
        {
            this._context = context;
            //this._mobileRepo = mobileRepo;
        }

        #endregion

        public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
        {
            throw new NotImplementedException();
        }

        public override void Install()
        {

            _context.Install();
            this.AddOrUpdatePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.MobileNo", "Enter Mobile No");
            this.AddOrUpdatePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.SendOTP", "Send OTP");
            this.AddOrUpdatePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.VerifyOTP", "Verify OTP");
            this.AddOrUpdatePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.WrongOTP", "Wrong OTP");
            this.AddOrUpdatePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.ResendOTP", "Resend OTP");

            base.Install();
        }

        /// <summary>
        /// Uninstall plugin
        /// </summary>
        public override void Uninstall()
        {
            _context.Uninstall();
            this.DeletePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.MobileNo");
            this.DeletePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.SendOTP");
            this.DeletePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.VerifyOTP");
            this.DeletePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.WrongOTP");
            this.DeletePluginLocaleResource("Plugins.Misc.LoginUsingMobileNo.ResendOTP");

            base.Uninstall();
        }
    }