code generation strategy to "default" in visual studio 2013

c# entity-framework-6

Question

How can I change code generation strategy to "Default" while creating ADO.net entity model class? When .edmx file is generated, it contains .tt files. I deleted those and want to regenerate using default code generation strategy. I was able to do this in Visual Studio 2012 but can't do this anymore in Visual Studio 2013. Code generation strategy is set to T4 and I can't regenerate the files. Any help?

1
5
1/25/2015 9:04:51 AM

Popular Answer

I'm working with asp.net webform so I'm not sure my answer would be helpful to u or not...However This is my solution...

1.remove the last edmx file.

2.remove the last connection string.

3.add ado.net entity model again and set options like before.

4.DO NOT remove .tt files and DO NOT try to change code strategy generation.

5.rebuild solution.

6.I believe now you would see a lot of errors about AddObject and DeleteObject...Just change This two to Add and Remove (note that for deleteObject you may not have had to write table name before but for remove you should do that).

for example: db.News.AddObject(N); changes to db.News.Add(N); and db.News.DeleteObject(N); changes to db.News.Remove(N); and db.DeleteObject(N); changes to db.News.Remove(N);

2
3/4/2015 8:27:53 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow