blogifierdotnet / Blogifier

Blogifier is an open-source publishing platform Written in ASP.NET and Blazor WebAssembly. With Blogifier make a personal blog or a website.
https://blogifier.net
MIT License
1.29k stars 521 forks source link

Can't use Azure SQL #96

Closed curia-damiano closed 6 years ago

curia-damiano commented 6 years ago

Hi, the web application doesn't work with Azure SQL, even with Mars=true. What I had to do, was to modify SettingsController waiting for the writing of each field: _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.Title, model.Title).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.Description, model.Description).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.ProfileLogo, model.Logo).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.ProfileAvatar, model.Avatar).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.ProfileImage, model.Image).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.BlogTheme, model.BlogTheme).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.SendGridApiKey, model.EmailKey).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.HeadCode, model.BlogHead).Wait(); _db.CustomFields.SetCustomField(CustomType.Application, 0, Constants.FooterCode, model.BlogFooter).Wait();

Ugly, but it was the smallest change to make it work with SQL Azure.

bchurchill commented 6 years ago

Hmm, I'm using Azure SQL and didn't have this problem at all. Just had to change UseSqlLite() to UseSqlServer() on line 34 of Blogifier.Web/Startup.cs.

rxtur commented 6 years ago

SQLite and SQL Server should work out of the box, other options may or may not.