This question is locked. New answers and comments are not allowed.
Hello Telerik,
when evaluating ORM, I found this issue:
I define diagram with four entitites, three of them pointing to one, I create the DB with ORM. Then, when inserting the object referencint to three other types of objects, I get exception complaining about foreign key constraints. When removing the constraints, the values are entered into wrong columns:(
This code should illustrate it:
EntitiesModel model = new EntitiesModel();
Industry industry1 = new Industry() { Name = "Industry 1" };
ProjectType projectType1 = new ProjectType() { Name = "Project Type 1" };
ProjectType projectType2 = new ProjectType() { Name = "Project Type 2" };
Customer customer1 = new Customer() { Name = "Customer 1" };
Customer customer2 = new Customer() { Name = "Customer 2" };
Customer customer3 = new Customer() { Name = "Customer 3" };
model.Add(industry1);
model.Add(projectType1);
model.Add(projectType2);
model.Add(customer1);
model.Add(customer2);
model.Add(customer3);
model.SaveChanges();
Project project = new Project() { Name = "Test Project", Industry = industry1, ProjectType = projectType2, Customer = customer3 };
model.Add(project);
model.SaveChanges();//THIS IS WHERE PROBLEM OCCURS
model.Delete(industry1);
model.Delete(projectType1);
model.Delete(projectType2);
model.Delete(customer1);
model.Delete(customer2);
model.Delete(customer3);
model.SaveChanges();
I have created an example project illustrating this issue and can send it.
Please help, this seems to be a serious issue.
Thank you
Best Regards
Ondrej
when evaluating ORM, I found this issue:
I define diagram with four entitites, three of them pointing to one, I create the DB with ORM. Then, when inserting the object referencint to three other types of objects, I get exception complaining about foreign key constraints. When removing the constraints, the values are entered into wrong columns:(
This code should illustrate it:
EntitiesModel model = new EntitiesModel();
Industry industry1 = new Industry() { Name = "Industry 1" };
ProjectType projectType1 = new ProjectType() { Name = "Project Type 1" };
ProjectType projectType2 = new ProjectType() { Name = "Project Type 2" };
Customer customer1 = new Customer() { Name = "Customer 1" };
Customer customer2 = new Customer() { Name = "Customer 2" };
Customer customer3 = new Customer() { Name = "Customer 3" };
model.Add(industry1);
model.Add(projectType1);
model.Add(projectType2);
model.Add(customer1);
model.Add(customer2);
model.Add(customer3);
model.SaveChanges();
Project project = new Project() { Name = "Test Project", Industry = industry1, ProjectType = projectType2, Customer = customer3 };
model.Add(project);
model.SaveChanges();//THIS IS WHERE PROBLEM OCCURS
model.Delete(industry1);
model.Delete(projectType1);
model.Delete(projectType2);
model.Delete(customer1);
model.Delete(customer2);
model.Delete(customer3);
model.SaveChanges();
I have created an example project illustrating this issue and can send it.
Please help, this seems to be a serious issue.
Thank you
Best Regards
Ondrej