how to use to kentico with entity framework

Unal UN asked on January 18, 2018 13:00

How to use to kentico with entity framework

Recent Answers


Trevor Fayas answered on January 18, 2018 14:54

You don't really use Kentico with Entity Framework.

Kentico has it's own built in "Entity Framework," each class usually has an ____Info class and ____InfoProvider, these provide the strongly typed representation of the classes with CRUD methods in them, along with the ____InfoProvider class has Linq-to-SQL like syntax.

For example,

RoleInfoProvider.GetRoles().WhereIn("RoleName", MyListOfRoleNames).Select(x => ((RoleInfo)x).RoleDisplayName).ToList();

RoleInfo MyNewRole = New RoleInfo();
MyNewRole.RoleName = "TempRole";
MyNewRole.RoleDisplayName = "Temp Role";
MyNewRole.Insert(); // Or RoleInfoProvider.Update(MyNewRole);
0 votesVote for this answer Mark as a Correct answer

Unal UN answered on January 19, 2018 11:44

Thank you Trevor

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.