Posts

Showing posts from April, 2019

Entity Framework Core with SQL Server on Mac

Hi All mac and microsoft tech lovers, There was a time where we love to use our macs and microsoft technologies but since there were not quite compatible with each we have to use windows os to work with microsoft technologies. But now microsoft has developed tools and compatibility to do this on any os. So here I would like to show you how to work with SQL Server and Entity Framework Core in your mac. Lets get started... You have to have docker in order to use SQL Server on Mac. So if you are new to this and would like to learn how to do that please read my blog from here and come back to this. Ok.. I think you have set up Docker, SQL Server and Azure Data Studio. I'm going to use Visual Studio for Mac as my IDE. If you like to use that you can download it from: https://visualstudio.microsoft.com/vs/mac/ . Lets continue then.. 1. Open Visual Studio for Mac (VSM) and create a Web API project. I call it MyAPI I'm going to create a project with N-Tier architecture,

Tool to Synchronize email templates between different SendGrid accounts

Hi All, Here I'll directly provide my code where I developed a tool to copy email templates from one SendGrid account to another SendGrid account. It is nice to have a such tool when migrating all of your newly created and modified email templates from develop environment to production servers. So here is the code that I have came up with: public class EmailSyncService : IEmailSyncService { private readonly EmailSyncSettingsModel _emailSyncSettingsModel; public EmailSyncService(IOptions<EmailSyncSettingsModel> emailSyncSettingsModel) { _emailSyncSettingsModel = emailSyncSettingsModel.Value; } public async Task<List<KeyValuePair<string, string>>> SyncSendGridTemplates(string source, string destination) { var newTemplates = new List<KeyValuePair<string, string>>(); var sourceKey = _emailSyncSettingsModel.GetType().GetProperty(source).GetValue(_emailSyn

Work with SQL Server in Mac like in Windows

Image
Hi all Mac and SQL Server lovers, In this blog post I will explain you how to work with SQL Server in your mac like in a windows machine. Lets start. Start SQL Server in Mac  1. Install docker ( https://hub.docker.com/editions/community/docker-ce-desktop-mac ) 2. Increase the memory to 4 GB You can do this by going to docker --> Preferences --> Advanced   3. Open the terminal and type bellow command  docker run --name sql3 -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=sysAdmin@123' -p 1433:1433 mcr.microsoft.com/mssql/server:2017-latest-ubuntu This will download and install SQL Server 2017 for linux If you want different version of SQL Server, then you can find it from here:  https://hub.docker.com/_/microsoft-mssql-server NOTE: When providing a password for  sa (System Admin), it should meet the following criteria:  A t least 8 characters long contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base