System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Ticket Hash: 2607b91f208d1ec738f637780bbe138d2b0cdc03
Title: Views is not detected
Status: Closed Type: Incident
Severity: Important Priority: Medium
Subsystem: LINQ Resolution: Need_More_Info
Last Modified: 2015-06-26 03:10:46
Version Found In: 1.0.96
User Comments:
anonymous added on 2015-05-25 13:08:31: (text/x-fossil-plain)
I have created a view "xDTO" in sqlite database , Have created a similar poco class on my application with the same columns names, create an extra class for configuration 
    public class xDTOConfiguration : EntityTypeConfiguration<xDTO>
    {
        public xDTOConfiguration()
        {
            this.HasKey(t => t.xId);
            this.ToTable("xDTO");
        }
    }
add the configuration to context class 
modelBuilder.Configurations.Add(new xDTOConfiguration());

while trying to load the view am getting the following error 
sql logic error or missing database r no such table

PS: the application is working fine with the other tables, the only problem in dealing with the views

anonymous added on 2015-05-25 13:37:51: (text/x-fossil-plain)
I have created a view "xDTO" in sqlite database , Have created a similar poco class on my application with the same columns names, create an extra class for configuration 
    public class xDTOConfiguration : EntityTypeConfiguration<xDTO>
    {
        public xDTOConfiguration()
        {
            this.HasKey(t => t.xId);
            this.ToTable("xDTO");
        }
    }
add the configuration to context class 
modelBuilder.Configurations.Add(new xDTOConfiguration());

while trying to load the view am getting the following error 
sql logic error or missing database r no such table

PS: the application is working fine with the other tables, the only problem in dealing with the views

mistachkin added on 2015-05-25 16:43:54: (text/x-fossil-plain)
Does this issue involve some kind of Entity Framework integration?

mistachkin added on 2015-05-25 16:44:51: (text/x-fossil-plain)
Can you provide the schema for the database and some example code that
demonstrates the issue?

anonymous added on 2015-05-26 10:13:53: (text/x-fossil-plain)
About the EF integration, am not sure what do you mean by that, am using the following packages from nuget 
  <package id="System.Data.SQLite" version="1.0.96.0" targetFramework="net452" />
  <package id="System.Data.SQLite.Core" version="1.0.96.0" targetFramework="net452" />
  <package id="System.Data.SQLite.EF6" version="1.0.96.0" targetFramework="net452" />
  <package id="System.Data.SQLite.Linq" version="1.0.96.0" targetFramework="net452" />

Simulation is easy, i have a status table with the following details 
statisid -- numeric 
name - text 


then i have a view called StatusDTO 
create view StatusDTO as select * from status 

In my application 
I have a class represent the same structure like the view 
 public class StatusDTO 
{
        public int StatusId { get; set; }
        public string Name { get; set; }
}

In my context here is whats been added 
 public class DBContext : DbContext
    {
        public DBContext()
        {
            // Turn off the Migrations, (NOT a code first Db)
            Database.SetInitializer<SchedulerContext>(null);
        }

        public DbSet<StatusDTO> ScheduleDTO { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            // Database does not pluralize table names
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

            modelBuilder.Entity<StatusDTO>().HasKey<int>(l => l.StatusId);
            modelBuilder.Entity<StatusDTO>().ToTable("StatusDTO");
        }
    }

mistachkin added on 2015-05-26 18:12:49: (text/x-fossil-plain)
So, the error being seen has to do with the view not actually getting created?

Is the Entity Framework code supposed to create it or was that done manually at
some point?

anonymous added on 2015-05-28 07:41:55: (text/x-fossil-plain)
No the view is being created manually as i mentioned earlier, entity framework is only playing the role to map it only  as u see from the initialization on the context class 
 Database.SetInitializer<SchedulerContext>(null);

mistachkin added on 2015-05-29 17:34:45: (text/x-fossil-plain)
I'm not sure how Entity Framework handles views.  Is the Entity Framework
calling GetSchema with "VIEWS" as the collectionName?

anonymous added on 2015-06-01 08:01:35: (text/x-fossil-plain)
Am not sure whats happening in the background of calling the views but am using linq to call it in the following way 
var query = from a in context.ScheduleDTO
                       where a.From <= dateFrom
              select a;