Platform Independent Full Stack Development

Slides:



Advertisements
Similar presentations
SQL Server 2008 Basmah AlQadheeb-213 MIS What is a Database ? A database is a collection of Data that is organized so that it can easily be accessed,
Advertisements

Microsoft Azure Introduction ISYS 512. Microsoft Azure Microsoft Azure is a cloud.
DATABASE DEVELOPMENT WITH VSTS DATABASE EDITION By Chris Dahlberg ©2009 Aspect Software, Inc. All rights reserved. 1.
DATABASE DEVELOPMENT WITH VISUAL STUDIO 2010 Chris Dahlberg 1.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Data in Windows 10 UWP Andy Wigley XML, JSON, SQLite or EF Core ?
ASP.NET Core* Shahed Chowdhuri Sr. Technical WakeUpAndCode.com Deploying Your Web Apps * aka ASP.NET 5 before RC1.
Get your Oracle data into SQL Server faster!
Eric Flamm Flamm Consulting, Inc.
Top 10 Entity Framework Features Every Developer Should Know
Introduction ITEC 420.
DevOps with ASP.NET Core and Entity Framework Core
ASP.NET Programming with C# and SQL Server First Edition
4/24/ :07 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Introduction to ASP.NET Core
Getting started with .NET Core
Visual Studio Database Tools (aka SQL Server Data Tools)
5/15/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
SQL Server deployments
Cassandra for SQL Server Professionals
Docker Birthday #3.
Easily manage SQL everywhere from anywhere with SQL tools
Introduction to .NET Core
Building a Continuous Delivery Pipeline for ASP.NET Core Apps
Azure CLI Deep Dive Neil Peterson Content Developer Microsoft.
SQL Server + PHP: What’s New
SQL Server Data Tools for Visual Studio Part I: Core SQL Server Tools
Andrew Pruski SQL Server & Containers
Microsoft Azure Service Fabric Overview
Relational databases, and more …
Download Exam - Valid Question Answers - Dumps4download.us
Azure Automation and Logic Apps:
Intro to SQL Operations Studio
Git Version Control for Everyone
Intro to SQL Operations Studio
Microsoft Ignite NZ October 2016 SKYCITY, Auckland
Cloudy with a Chance of Data
An Introduction to Entity Framework
COP5725 DATABASE MANAGEMENT POSTGRESQL TUTORIAL
ORMs and the DBA How to Make Both Happy.
Getting started with SharePoint Framework
Docker Workflows with Visual Studio
Visual Studio Database Tools (aka SQL Server Data Tools)
Microsoft Connect /1/2018 2:36 AM
The Mac DBA, using Docker and SQL Operations Studio
Entity Framework Core (EF Core)
ORMs and the DBA How to Make Both Happy.
SQLOpsStudio Vs SSMS - There can be only one
Patrick Flynn | Link Group Australia
Serverless Architecture in the Cloud
Visual Studio Code for PowerShell
ORMs and the DBA How to Make Both Happy.
SQLOpsStudio Vs SSMS - There can be only one
Implementing Entity Framework with MVC Jump Start
C# - EF Core Intro IT College, Andres Käver, , Fall semester
C# - Razor Pages Db/Scaffolding/Async
Rich Benner SQL Server Performance Richbenner.com.
Windows Azure Hybrid Architectures and Patterns
1. Azure Data Explorer Azure Data Explorer enables rich data exploration over raw, structured, and semi-structured data delivering fast time to insight.
SQLOpsStudio Vs SSMS - There can be only one
SSDT, Docker, and (Azure) DevOps
Michelle Haarhues Keeping up with SSMS.
SSDT, Docker, and (Azure) DevOps
Johan Lindberg, inRiver
Secure SQL Server Design
SSDT, Docker, and (Azure) DevOps
ASP.NET Core 2.0 The Future of Web Apps Shahed Chowdhuri
SSDT, Docker, and (Azure) DevOps
SQL Server on Containers
Presentation transcript:

Platform Independent Full Stack Development New Frontiers Platform Independent Full Stack Development

Thanks to our GOLD Sponsor

Thanks to our SILVER Sponsors

What’s On Deck? Quick Introduction to Our Toolset Creating the Database Server Defining Our Database Shape Creating the Service Layer Testing It! VS Code vs. Visual Studio Community/Professional/Enterprise Azure Data Studio vs. SQL Server Management Studio Question Time

Our Toolset for Today 1. iTerm2 2. Docker w/ SQL Server 2017 Linux https://www.iterm2.com 2. Docker w/ SQL Server 2017 Linux https://www.docker.com/community-edition https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-linux-2017 3. SQL Ops Studio Azure Data Studio https://docs.microsoft.com/en-us/sql/azure-data-studio/download?view=sql-server-2017 4. dotnet Command Line https://docs.microsoft.com/en-us/dotnet/core/tools/?tabs=netcore2x 5. Visual Studio Code https://code.visualstudio.com 6. Postman https://www.getpostman.com

Creating the Database Server

Create a New Docker Volume docker volume create --name sql_saturday_madison

Create a SQL Server Instance sudo docker pull microsoft/mssql-server-linux:2017-latest docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password123!' -p 1433:1433 -v sql_saturday_madison:/var/opt/mssql --name sql_saturday_madison -d microsoft/mssql-server-linux:2017-latest

Azure Data Studio

Creating the Database Shape

Create User and Database CREATE LOGIN [Sql_Saturday_User] WITH PASSWORD = 'password123!'; GO CREATE DATABASE [Sql_Saturday]; USE [Sql_Saturday]; CREATE USER [Sql_Saturday_User] FOR LOGIN [Sql_Saturday_User]; EXEC sp_addrolemember 'db_owner’, Sql_Saturday_User';

Create the Song Table CREATE TABLE dbo.Song ( SongId UNIQUEIDENTIFIER NOT NULL CONSTRAINT PK_Song PRIMARY KEY CLUSTERED, SongName VARCHAR(150) NOT NULL, Composer VARCHAR(150) NOT NULL ) ON [PRIMARY]; GO

Fill It INSERT INTO dbo.Song (SongId, SongName, Composer) SELECT NEWID(), 'Two Step', 'Dave Matthews Band' UNION SELECT NEWID(), 'Crush', 'Dave Matthews Band' SELECT NEWID(), 'One Sweet World', 'Dave Matthews Band' SELECT NEWID(), 'All Along the Watchtower', 'Bob Dylan' SELECT NEWID(), 'Minarets', 'Dave Matthews Band' SELECT NEWID(), 'Why I Am', 'Dave Matthews Band' SELECT NEWID(), 'Warehouse', 'Dave Matthews Band' SELECT NEWID(), 'Grey Street', 'Dave Matthews Band'; GO

Create the Concert Table CREATE TABLE dbo.Concert ( ConcertId UNIQUEIDENTIFIER NOT NULL CONSTRAINT PK_Concert PRIMARY KEY CLUSTERED, ConcertDate DATE NOT NULL, ConcertLocation VARCHAR(150) NOT NULL ) ON [PRIMARY]; GO

Fill It INSERT INTO dbo.Concert (ConcertId, ConcertLocation, ConcertDate) SELECT NEWID(), 'Keybank Pavilion, Burgettstown, PA', '20160709' UNION SELECT NEWID(), 'Alpine Valley Music Center, Elkhorn, WI', '20160701' SELECT NEWID(), 'Alpine Valley Music Center, Elkhorn, WI', '20160702' SELECT NEWID(), 'Riverbend Music Center, Cincinnati, OH', '20130712'; GO

dotnet Command Line

Create a New WebAPI Project cd ./code mkdir new-frontiers cd ./new-frontiers dotnet new webapi --name NewFrontiers -o ./new-frontiers code .

Visual Studio Code

Coding in VS Code

Install Entity Framework Core dotnet add package Microsoft.EntityFrameworkCore.SqlServer dotnet add package Microsoft.CodeAnalysis

Update Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); var connectionString = @"Server=localhost;Database=Sql_Saturday;User=Sql_Saturday_User;Password=password123!"; services.AddDbContext<ConcertDbContext>(options => options.UseSqlServer(connectionString)); }

Add a Song Model public class Song { public Guid SongId {get;set;} public string SongName {get;set;} public string Composer {get;set;} }

Add a Concert Model public class Concert { public Guid ConcertId {get;set;} public string ConcertLocation {get;set;} public DateTime ConcertDate {get;set;} }

Create Out DbContext public class ConcertDbContext : DbContext { public ConcertDbContext(DbContextOptions<ConcertDbContext> options) :base (options) } public DbSet<Song> Songs {get;set;} public DbSet<Concert> Concerts {get;set;} protected override void OnModelCreating(ModelBuilder builder) builder.Entity<Song>(s => { s.ToTable("Song", "dbo"); s.HasKey(c => c.SongId); s.Property(sid => sid.SongId).ValueGeneratedOnAdd(); s.Property(c => c.Composer).IsRequired().HasMaxLength(150); s.Property(sn => sn.SongName).IsRequired().HasMaxLength(150); }); builder.Entity<Concert>(c => { c.ToTable("Concert", "dbo"); c.HasKey(cid => cid.ConcertId); c.Property(cid => cid.ConcertId).ValueGeneratedOnAdd(); c.Property(cl => cl.ConcertLocation).IsRequired().HasMaxLength(150); c.Property(cd => cd.ConcertDate).IsRequired().HasColumnType("date");

Add a Song Controller [Route("api/[controller]")] [ApiController] public class SongController : Controller { private ConcertDbContext _context; public SongController(ConcertDbContext context) this._context = context; } [HttpGet("")] public async Task<ActionResult<IEnumerable<Song>>> GetAllSongs() var data = await this._context.Songs.ToListAsync(); return Ok(data); [HttpPost("")] public async Task<ActionResult<Song>> CreateSong(Song song) var result = await this._context.AddAsync(song); await this._context.SaveChangesAsync(); return song;

Add a Concert Controller [Route("api/[controller]")] [ApiController] public class ConcertController : Controller { private ConcertDbContext _context; public ConcertController(ConcertDbContext context) this._context = context; } [HttpGet("")] public async Task<ActionResult<IEnumerable<Concert>>> GetAllConcert() var data = await this._context.Concerts.ToListAsync(); return Ok(data); [HttpPost("")] public async Task<ActionResult<Concert>> CreateConcert(Concert concert) var result = await this._context.AddAsync(concert); await this._context.SaveChangesAsync(); return concert;

Test It Out dotnet run

Tool Comparisons

Visual Studio Code vs. Visual Studio Cross-platform – versions available for Windows, Mac, and several flavors of Linux Rich Plugin Environment Lightweight Installation and Run Requirements Limited Scaffolding Support Within IDE No Integrated Test Runner (dotnet test only) Visual Studio Windows-only (Visual Studio for Mac does not provide a full experience) Rich Plugin Environment Heavyweight Installation and Run Requirements Full Scaffolding Support Within IDE Full Integrated Test Runner

Azure Data Studio vs. SQL Server Management Studio Recently Out of Beta Cross Platform – versions available for Windows, Mac, and several flavors of Linux Limited Plugin Environment, but Install from Within the IDE Still May Encounter Areas of Limited Functionality Designed to be Cloud-first SQL Server Management Studio On Version 17 (Version 18 is currently in RC1) Windows-only Limited Plugin Environment (and most are 3rd Party Installations) Fully Functional Designed to be On-premise-first

Questions?

Who am I? Dan Mallott Twitter: @DanielMallott Github: https://github.com/danielmallott LinkedIn: http://lnked.in/danmallott Principal for West Monroe Partners In the industry since 2011 Primary experience with SQL Server, starting with SQL Server 2005 Also worked with Oracle, PostgreSQL, and Cassandra Been both a DBA and a developer Have a couple Microsoft certifications DataStax Certified Professional