1

I've created a very simple test for Entity Framework, following the Code first samples in the project's page at Microsoft's MSDN.

The Mono compatibility page says that Entity Framework is fully supported, so I installed the NuGET package. It worked flawlessly.

I created a very simple Person class, with its corresponding PersonContest.

    public class Person {
        public Person(string name, string email)
        {
            this.Name = name;
            this.Email = email;
        }

        public string Name { get; set; }
        public string Email { get; set; }

        public override string ToString()
        {
            return string.Format( "{0}, {1}", Name, Email );
        }
    }

    public class PersonsContext: DbContext {
        public DbSet<Person> Persons { get; set; }
    }

It compiles and runs. But when it is time to save the Person objects to the DbContext (PersonsContext), then it complains with a Sytem.NotImplementedException saying "MARS is not implemented".

Can I run Entity Framework on Linux with mono or not?

Baltasarq
  • 12,014
  • 3
  • 38
  • 57
  • MARS is Multiple Active Results Sets (https://msdn.microsoft.com/en-us/library/ms131686.aspx), it may be saying you database doesn't support that which isn't a mono issue. You ought to be able to turn that off in the connection string. – Mant101 Aug 25 '15 at 12:35
  • Related question: [How to disable mars and circumvent mars is not yet implemented exception](http://stackoverflow.com/questions/27069403/how-to-disable-mars-and-circumvent-mars-is-not-yet-implemented-exception) – user957902 Aug 25 '15 at 13:02
  • I haven't set any database for the backend. I guess that's the problem. The database is not configured in the tutorial, either... – Baltasarq Aug 25 '15 at 13:39

0 Answers0