tofutim tofutim - 1 month ago 14
C# Question

What does AddTablesWithEntityFramework() vs AddTables(new MobileAppTableConfiguration()?

I have been using

.AddTables(new MobileAppTableConfiguration()
.MapTableControllers()
.AddEntityFramework())


to setup my MobileAppConfiguration, but recently saw in Adrian Hall's book https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter2/custom/

.AddTablesWithEntityFramework()


How are these different? Should I be using the latter?

This call comes in Startup.cs in a standard Azure Mobile App, e.g.,

public static void SetupMobileApp(IAppBuilder app, IKernel kernel)
{
HttpConfiguration config = new HttpConfiguration();

//new MobileAppConfiguration()
// .UseDefaultConfiguration()
// .ApplyTo(config);

new MobileAppConfiguration()
.MapApiControllers()
.AddTables(new MobileAppTableConfiguration()
.MapTableControllers()
.AddEntityFramework())
.AddPushNotifications()
.MapLegacyCrossDomainController()
.ApplyTo(config);

Answer

It's the same thing, it only sets the default settings for EntityFramework with TableController. Source.

Comments