This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hello World Entity Framework Core! | |
| Current database content | |
| Persona 5 - PS4 | |
| Steins's Gate - PSVita | |
| PS4 Games | |
| Persona 5 - PS4 | |
| Deleting PS4 Games | |
| Current database content | |
| Steins's Gate - PSVita |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using Microsoft.EntityFrameworkCore; | |
| namespace efcore_tuto_1 { | |
| class Program { | |
| static void Main (string[] args) { | |
| Console.WriteLine ("Hello World Entity Framework Core!"); | |
| using (var context = new VideoGamesDatabaseContext ()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.ComponentModel.DataAnnotations; | |
| namespace efcore_tuto_1 { | |
| public class VideoGame { | |
| [Key] | |
| public int Id { get; set; } | |
| public string Title { get; set; } | |
| public string Platform { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>Exe</OutputType> | |
| <TargetFramework>netcoreapp1.1</TargetFramework> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.2" /> | |
| <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" /> | |
| <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Current database content | |
| Persona 5 - PS4 | |
| Steins's Gate - PSVita | |
| PS4 Games | |
| Persona 5 - PS4 | |
| Deleting PS4 Games | |
| Current database content | |
| Steins's Gate - PSVita |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| namespace efcore_tuto_1 { | |
| class Program { | |
| static void Main (string[] args) { | |
| Console.WriteLine ("Hello World Entity Framework Core!"); | |
| using (var context = new VideoGamesDatabaseContext ()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.EntityFrameworkCore; | |
| namespace efcore_tuto_1 | |
| { | |
| /// <summary> | |
| /// This class handles the sqlite database | |
| /// </summary> | |
| public class VideoGamesDatabaseContext : DbContext | |
| { | |
| /// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.ComponentModel.DataAnnotations; | |
| namespace efcore_tuto_1 { | |
| public class VideoGame { | |
| [Key] | |
| public int Id { get; set; } | |
| public string Title { get; set; } | |
| public int Platform { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ItemGroup> | |
| <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.2"/> | |
| </ItemGroup> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func read(){ | |
| //read a value from the characteristic | |
| let readFuture = self.dataCharacteristic?.read(timeout: 5) | |
| readFuture?.onSuccess { (_) in | |
| //the value is in the dataValue property | |
| let s = String(data:(self.dataCharacteristic?.dataValue)!, encoding: .utf8) | |
| DispatchQueue.main.async { | |
| self.valueLabel.text = "Read value is \(s)" | |
| print(self.valueLabel.text!) | |
| } |