提交 f48d233f 编写于 作者: 麦壳饼's avatar 麦壳饼 提交者: GitHub

Merge pull request #1 from IoTSharp/ag

angular 
......@@ -15,6 +15,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IoTSharp.Hub\IoTSharp.Hub.csproj" />
<ProjectReference Include="..\IoTSharp\IoTSharp.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
using IoTSharp.Hub;
using IoTSharp.Hub.Controllers;
using IoTSharp;
using IoTSharp.Controllers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using static IoTSharp.Hub.Controllers.InstallerController;
using static IoTSharp.Controllers.InstallerController;
using Microsoft.Extensions.DependencyInjection;
namespace IoTSharp.Test
......
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
# IoTSharp.UI
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Run your tests
```
npm run test
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/app'
]
}
此差异已折叠。
{
"name": "IoTSharp.UI",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"vue": "^2.5.17"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.2.0",
"@vue/cli-plugin-eslint": "^3.2.0",
"@vue/cli-service": "^3.2.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0-0",
"vue-template-compiler": "^2.5.17"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>IoTSharp.UI</title>
</head>
<body>
<noscript>
<strong>We're sorry but IoTSharp.UI doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
export default {
name: 'app',
components: {
HelloWorld
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
......@@ -3,17 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2048
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Hub", "IoTSharp.Hub\IoTSharp.Hub.csproj", "{260081B3-E2EA-4BA0-8322-E3894907585E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D5C97089-F896-436D-8E99-27B2E43BC65F}"
ProjectSection(SolutionItems) = preProject
GitVersion.yml = GitVersion.yml
LICENSE = LICENSE
README.md = README.md
roadmap.md = roadmap.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoTSharp.Test", "IoTSharp.Test\IoTSharp.Test.csproj", "{70DFF66F-6791-4713-81F3-DD7A64B59185}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Test", "IoTSharp.Test\IoTSharp.Test.csproj", "{70DFF66F-6791-4713-81F3-DD7A64B59185}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoTSharp", "IoTSharp\IoTSharp.csproj", "{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -21,14 +20,14 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{260081B3-E2EA-4BA0-8322-E3894907585E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{260081B3-E2EA-4BA0-8322-E3894907585E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{260081B3-E2EA-4BA0-8322-E3894907585E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{260081B3-E2EA-4BA0-8322-E3894907585E}.Release|Any CPU.Build.0 = Release|Any CPU
{70DFF66F-6791-4713-81F3-DD7A64B59185}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70DFF66F-6791-4713-81F3-DD7A64B59185}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70DFF66F-6791-4713-81F3-DD7A64B59185}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70DFF66F-6791-4713-81F3-DD7A64B59185}.Release|Any CPU.Build.0 = Release|Any CPU
{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
bin/
Bin/
obj/
Obj/
# Visual Studio 2015 cache/options directory
.vs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Microsoft Azure ApplicationInsights config file
ApplicationInsights.config
# Windows Store app package directory
AppPackages/
BundleArtifacts/
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
orleans.codegen.cs
/node_modules
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
# FAKE - F# Make
.fake/
......@@ -4,7 +4,7 @@ using System.Linq;
using System.Security.Authentication;
using System.Threading.Tasks;
namespace IoTSharp.Hub
namespace IoTSharp
{
public class AppSettings
{
......
......@@ -10,7 +10,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Extensions
namespace IoTSharp.Extensions
{
/// <summary>
/// https://github.com/chkr1011/MQTTnet/blob/master/Source/MQTTnet.Extensions.Rpc/MqttRpcClient.cs
......
using IoTSharp.Hub.Data;
using IoTSharp.Hub.Dtos;
using IoTSharp.Hub.Extensions;
using IoTSharp.Data;
using IoTSharp.Dtos;
using IoTSharp.Extensions;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
......@@ -18,7 +18,7 @@ using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Controllers
namespace IoTSharp.Controllers
{
[ApiController]
[Authorize]
......
......@@ -5,11 +5,11 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.AspNetCore.Authorization;
using IoTSharp.Hub.Dtos;
using IoTSharp.Dtos;
namespace IoTSharp.Hub.Controllers
namespace IoTSharp.Controllers
{
[Route("api/[controller]")]
[Authorize]
......
......@@ -5,18 +5,18 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.AspNetCore.Authorization;
using IoTSharp.Hub.Dtos;
using IoTSharp.Dtos;
using Dic = System.Collections.Generic.Dictionary<string, string>;
using DicKV = System.Collections.Generic.KeyValuePair<string, string>;
using MQTTnet.Client;
using MQTTnet.Extensions.Rpc;
using MQTTnet.Protocol;
using IoTSharp.Hub.Extensions;
using IoTSharp.Extensions;
using MQTTnet.Exceptions;
namespace IoTSharp.Hub.Controllers
namespace IoTSharp.Controllers
{
[Route("api/[controller]")]
[Authorize]
......
using IoTSharp.Hub.Data;
using IoTSharp.Hub.Extensions;
using IoTSharp.Data;
using IoTSharp.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
......@@ -12,7 +12,7 @@ using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Controllers
namespace IoTSharp.Controllers
{
[ApiController]
[Route("api/[controller]/[action]")]
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace IoTSharp.Controllers
{
[Route("api/[controller]")]
public class SampleDataController : Controller
{
private static string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
[HttpGet("[action]")]
public IEnumerable<WeatherForecast> WeatherForecasts()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
DateFormatted = DateTime.Now.AddDays(index).ToString("d"),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
});
}
public class WeatherForecast
{
public string DateFormatted { get; set; }
public int TemperatureC { get; set; }
public string Summary { get; set; }
public int TemperatureF
{
get
{
return 32 + (int)(TemperatureC / 0.5556);
}
}
}
}
}
......@@ -5,16 +5,16 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.AspNetCore.Authorization;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using IoTSharp.Hub.Dtos;
using IoTSharp.Dtos;
using Microsoft.EntityFrameworkCore.ChangeTracking;
namespace IoTSharp.Hub.Controllers
namespace IoTSharp.Controllers
{
[Route("api/[controller]")]
[Authorize]
......
......@@ -7,9 +7,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using static IoTSharp.Hub.Controllers.InstallerController;
using static IoTSharp.Controllers.InstallerController;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class ApplicationDBInitializer
{
......
......@@ -5,7 +5,7 @@ using Microsoft.Extensions.Configuration;
using System;
using System.Linq;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class ApplicationDbContext : IdentityDbContext
{
......
......@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class AttributeData : DataStorage
{
......
......@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class AttributeLatest : DataStorage
{
......
......@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class AuditLog
{
......
......@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class Customer
{
......
using System;
using System.ComponentModel.DataAnnotations;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class DataStorage
{
......
......@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class Device
{
......
......@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class DeviceIdentity
{
......
......@@ -7,7 +7,7 @@ using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public static class IoTSharpClaimTypes
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("00000000000000_CreateIdentitySchema")]
......
......@@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class CreateIdentitySchema : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20190103085249_AddDataTable")]
......@@ -21,7 +21,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -63,7 +63,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<string>("Discriminator").HasValue("AttributeData");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -95,7 +95,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -117,7 +117,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -139,7 +139,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -328,9 +328,9 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.AttributeData");
b.HasBaseType("IoTSharp.Data.AttributeData");
b.Property<Guid?>("DeviceId");
......@@ -339,9 +339,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue("AttributeLatest");
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.AttributeData");
b.HasBaseType("IoTSharp.Data.AttributeData");
b.Property<Guid?>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -351,9 +351,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue("TelemetryData");
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.AttributeData");
b.HasBaseType("IoTSharp.Data.AttributeData");
b.Property<Guid?>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -363,35 +363,35 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue("TelemetryLatest");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId1")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -399,7 +399,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -449,23 +449,23 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device")
b.HasOne("IoTSharp.Data.Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device")
b.HasOne("IoTSharp.Data.Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device")
b.HasOne("IoTSharp.Data.Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId");
});
......
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class AddDataTable : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20190103092505_AddDiscriminator")]
......@@ -21,7 +21,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -53,7 +53,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -94,7 +94,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<int>("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -116,7 +116,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -138,7 +138,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -327,16 +327,16 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid?>("DeviceId");
......@@ -345,9 +345,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid?>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -357,9 +357,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid?>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -369,35 +369,35 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(4);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId1")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -405,7 +405,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -455,23 +455,23 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device")
b.HasOne("IoTSharp.Data.Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device")
b.HasOne("IoTSharp.Data.Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device")
b.HasOne("IoTSharp.Data.Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId");
});
......
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class AddDiscriminator : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20190104081406_ModifyRelationship")]
......@@ -21,7 +21,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -53,7 +53,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -90,7 +90,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<int>("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -112,7 +112,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -134,7 +134,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -323,9 +323,9 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId");
......@@ -334,9 +334,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("AttributeLatest_DeviceId");
......@@ -346,9 +346,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -358,9 +358,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -370,27 +370,27 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(4);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -398,7 +398,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityUserId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -448,33 +448,33 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
......
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class ModifyRelationship : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20190108071914_AddRole")]
......@@ -21,7 +21,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -53,7 +53,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -90,7 +90,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<int>("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -112,7 +112,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -134,7 +134,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -319,9 +319,9 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId");
......@@ -330,9 +330,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("AttributeLatest_DeviceId");
......@@ -342,9 +342,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -354,9 +354,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -366,27 +366,27 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(4);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -394,7 +394,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityUserId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -444,33 +444,33 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
......
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class AddRole : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20190118115805_AddDeviceIdentity")]
......@@ -21,7 +21,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -53,7 +53,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -90,7 +90,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<int>("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -112,7 +112,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -133,7 +133,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("DeviceIdentities");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -155,7 +155,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -340,9 +340,9 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId");
......@@ -351,9 +351,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("AttributeLatest_DeviceId");
......@@ -363,9 +363,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -375,9 +375,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -387,35 +387,35 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(4);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -423,7 +423,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityUserId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -473,33 +473,33 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
......
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class AddDeviceIdentity : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20190129085237_AuditLog")]
......@@ -21,7 +21,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.1-servicing-10028")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.AuditLog", b =>
modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -59,7 +59,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AuditLog");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -91,7 +91,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -130,7 +130,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<int>("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -152,7 +152,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -173,7 +173,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("DeviceIdentities");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -195,7 +195,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -380,9 +380,9 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId");
......@@ -391,9 +391,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("AttributeLatest_DeviceId");
......@@ -403,9 +403,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -415,9 +415,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -427,46 +427,46 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(4);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AuditLog", b =>
modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -474,7 +474,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityUserId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -524,33 +524,33 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
......
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class AuditLog : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20190131022355_Value_DateTime")]
......@@ -21,7 +21,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.1-servicing-10028")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.AuditLog", b =>
modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -59,7 +59,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AuditLog");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -91,7 +91,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -132,7 +132,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<int>("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -154,7 +154,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -175,7 +175,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("DeviceIdentities");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -197,7 +197,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -382,9 +382,9 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId");
......@@ -393,9 +393,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("AttributeLatest_DeviceId");
......@@ -405,9 +405,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -417,9 +417,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -429,46 +429,46 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(4);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AuditLog", b =>
modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -476,7 +476,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityUserId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -526,33 +526,33 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
......
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
public partial class Value_DateTime : Migration
{
......
// <auto-generated />
using System;
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IoTSharp.Hub.Migrations
namespace IoTSharp.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
......@@ -19,7 +19,7 @@ namespace IoTSharp.Hub.Migrations
.HasAnnotation("ProductVersion", "2.2.1-servicing-10028")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("IoTSharp.Hub.Data.AuditLog", b =>
modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -57,7 +57,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AuditLog");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -89,7 +89,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Customer");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DataStorage", b =>
modelBuilder.Entity("IoTSharp.Data.DataStorage", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -130,7 +130,7 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator<int>("Catalog").HasValue(0);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -152,7 +152,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Device");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -173,7 +173,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("DeviceIdentities");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -195,7 +195,7 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("Relationship");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Tenant", b =>
modelBuilder.Entity("IoTSharp.Data.Tenant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
......@@ -380,9 +380,9 @@ namespace IoTSharp.Hub.Migrations
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId");
......@@ -391,9 +391,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(1);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("AttributeLatest_DeviceId");
......@@ -403,9 +403,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(2);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryData_DeviceId");
......@@ -415,9 +415,9 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(3);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasBaseType("IoTSharp.Hub.Data.DataStorage");
b.HasBaseType("IoTSharp.Data.DataStorage");
b.Property<Guid>("DeviceId")
.HasColumnName("TelemetryLatest_DeviceId");
......@@ -427,46 +427,46 @@ namespace IoTSharp.Hub.Migrations
b.HasDiscriminator().HasValue(4);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AuditLog", b =>
modelBuilder.Entity("IoTSharp.Data.AuditLog", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Customer", b =>
modelBuilder.Entity("IoTSharp.Data.Customer", b =>
{
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Customers")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.Device", b =>
modelBuilder.Entity("IoTSharp.Data.Device", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany("Devices")
.HasForeignKey("CustomerId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany("Devices")
.HasForeignKey("TenantId");
});
modelBuilder.Entity("IoTSharp.Hub.Data.DeviceIdentity", b =>
modelBuilder.Entity("IoTSharp.Data.DeviceIdentity", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.Relationship", b =>
modelBuilder.Entity("IoTSharp.Data.Relationship", b =>
{
b.HasOne("IoTSharp.Hub.Data.Customer", "Customer")
b.HasOne("IoTSharp.Data.Customer", "Customer")
.WithMany()
.HasForeignKey("CustomerId");
......@@ -474,7 +474,7 @@ namespace IoTSharp.Hub.Migrations
.WithMany()
.HasForeignKey("IdentityUserId");
b.HasOne("IoTSharp.Hub.Data.Tenant", "Tenant")
b.HasOne("IoTSharp.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId");
});
......@@ -524,33 +524,33 @@ namespace IoTSharp.Hub.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeData", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.AttributeLatest", b =>
modelBuilder.Entity("IoTSharp.Data.AttributeLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("AttributeLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryData", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryData", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryData")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("IoTSharp.Hub.Data.TelemetryLatest", b =>
modelBuilder.Entity("IoTSharp.Data.TelemetryLatest", b =>
{
b.HasOne("IoTSharp.Hub.Data.Device", "Device")
b.HasOne("IoTSharp.Data.Device", "Device")
.WithMany("TelemetryLatest")
.HasForeignKey("DeviceId")
.OnDelete(DeleteBehavior.Cascade);
......
......@@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class Relationship
{
......
......@@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class TelemetryData : DataStorage
......
......@@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class TelemetryLatest : DataStorage
......
......@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Data
namespace IoTSharp.Data
{
public class Tenant
{
......
......@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Dtos
namespace IoTSharp.Dtos
{
public class TokenEntity
{
......
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Dtos
namespace IoTSharp.Dtos
{
public class ApiResult
{
......
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Dtos
namespace IoTSharp.Dtos
{
public class CustomerDto : Customer
{
......
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Dtos
namespace IoTSharp.Dtos
{
public class UserInfoDto
{
......
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Dic = System.Collections.Generic.Dictionary<string, string>;
using DicKV = System.Collections.Generic.KeyValuePair<string, string>;
namespace IoTSharp.Hub.Extensions
namespace IoTSharp.Extensions
{
public static class DataExtension
{
......
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
......@@ -10,14 +10,14 @@ using System.IO;
using System.Linq;
using System.Reflection;
namespace IoTSharp.Hub
namespace IoTSharp
{
public static class IoTSharpExtension
{
public static void AddIoTSharpHub(this IServiceCollection services, IConfiguration configuration)
{
var _DataBase = configuration["DataBase"] ?? "sqlite";
var _ConnectionString = Environment.ExpandEnvironmentVariables(configuration.GetConnectionString(_DataBase) ?? "Data Source=%APPDATA%\\IoTSharp.Hub\\MQTTChat.db;Pooling=true;");
var _ConnectionString = Environment.ExpandEnvironmentVariables(configuration.GetConnectionString(_DataBase) ?? "Data Source=%APPDATA%\\IoTSharp\\MQTTChat.db;Pooling=true;");
switch (_DataBase)
{
case "mssql":
......
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Diagnostics;
using System.Reflection;
using System.Threading.Tasks;
namespace IoTSharp.Hub.Extensions
namespace IoTSharp.Extensions
{
public static class MiscExtension
{
......
......@@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Builder;
using MQTTnet.AspNetCore;
using MQTTnet.Diagnostics;
namespace IoTSharp.Hub
namespace IoTSharp
{
public static class MqttExtension
......
using IoTSharp.Hub.Data;
using IoTSharp.Hub.Dtos;
using IoTSharp.Data;
using IoTSharp.Dtos;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
......@@ -15,7 +15,7 @@ using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
namespace IoTSharp.Hub
namespace IoTSharp
{
public static class TokenExtension
{
......
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<Company>IoT#</Company>
<Product>IoTSharp</Product>
<Authors>IoT#</Authors>
<PackageProjectUrl>https://github.com/IoTSharp/IoTSharp</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/IoTSharp/IoTSharp/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/IoTSharp/IoTSharp</RepositoryUrl>
<PackageReleaseNotes>
Open-source IoT Platform - Device management, data collection, processing and visualization. https://www.iotsharp.net
</PackageReleaseNotes>
<Description>Open-source IoT Platform - Device management, data collection, processing and visualization.</Description>
<PackageId>IoTSharp</PackageId>
<UserSecretsId>18970590-05bf-4a1f-a70b-3c8a120d12cb</UserSecretsId>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\**" />
<Content Remove="Migrations\**" />
<EmbeddedResource Remove="Migrations\**" />
<None Remove="Migrations\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="IoTSharp.X509Extensions" Version="1.3.3" />
<PackageReference Include="LiteDB" Version="4.1.4" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="1.1.6" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.1" />
<PackageReference Include="MQTTnet" Version="2.8.5" />
<PackageReference Include="MQTTnet.AspNetCore" Version="2.8.5" />
<PackageReference Include="MQTTnet.Extensions.Rpc" Version="2.8.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
<PackageReference Include="NSwag.AspNetCore" Version="12.0.13" />
<PackageReference Include="QuartzHostedService" Version="0.0.4" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties appsettings_1Development_1json__JSONSchema="http://json.schemastore.org/bungee-plugin" />
</VisualStudio>
</ProjectExtensions>
<ItemGroup>
<!-- Don't publish the SPA source files, but do show them in the project files list -->
<Content Remove="$(SpaRoot)**" />
<None Remove="$(SpaRoot)**" />
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
</ItemGroup>
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
<!-- Ensure Node.js is installed -->
<Exec Command="node --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
</Target>
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
<DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>
@page
@model ErrorModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace IoTSharp.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
@using IoTSharp
@namespace IoTSharp.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace IoTSharp.Hub
namespace IoTSharp
{
public class Program
{
......@@ -16,4 +23,4 @@ namespace IoTSharp.Hub
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}
\ No newline at end of file
}
......@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace IoTSharp.Hub.Properties {
namespace IoTSharp.Properties {
using System;
......@@ -39,7 +39,7 @@ namespace IoTSharp.Hub.Properties {
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IoTSharp.Hub.Properties.Resources", typeof(Resources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IoTSharp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
......
using IoTSharp.Hub.Data;
using IoTSharp.Data;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
......@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.AngularCli;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
......@@ -20,7 +21,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace IoTSharp.Hub
namespace IoTSharp
{
public class Startup
{
......@@ -74,10 +75,14 @@ namespace IoTSharp.Hub
services.AddIoTSharpMqttServer(AppSettings.MqttBroker);
services.AddMqttClient(AppSettings.MqttClient);
}
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
// In production, the Angular files will be served from this directory
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
......@@ -89,17 +94,12 @@ namespace IoTSharp.Hub
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
// app.UseHsts();
app.UseHsts();
}
app.UseAuthentication();
app.UseMvc();
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseSwagger();
app.UseIoTSharpMqttClient();
......@@ -109,8 +109,29 @@ namespace IoTSharp.Hub
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseSpaStaticFiles();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action=Index}/{id?}");
});
app.UseSpa(spa =>
{
// To learn more about options for serving an Angular SPA from ASP.NET Core,
// see https://go.microsoft.com/fwlink/?linkid=864501
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
}
});
}
}
}
\ No newline at end of file
......@@ -12,5 +12,4 @@
"JwtExpireDays": 1,
"JwtIssuer": "IoTSharp.Hub",
"AllowedHosts": "*"
}
\ No newline at end of file
}
......@@ -3,9 +3,9 @@ Description=IoTSharp running on Linux
[Service]
WorkingDirectory=/var/iotsharp/
ExecStart=/var/iotsharp/IoTSharp.Hub
ExecStart=/var/iotsharp/IoTSharp
Restart=always
# Restart service after 10 seconds if the IoTSharp.Hub service crashes:
# Restart service after 10 seconds if the IoTSharp service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=iotsharp
......
<head>
<title>IoTSharp.Hub</title>
<title>IoTSharp</title>
<meta http-equiv="refresh" content="2;url=/swagger/">
</head>
<body>
......
......@@ -22,7 +22,7 @@ IoTSharp is an open-source IoT platform for data collection, processing, visuali
### Linux
- mkdir /var/iotsharp
- cp ./* /var/iotsharp/
- chmod 777 IoTSharp.Hub
- chmod 777 IoTSharp
- cp iotsharp.service /etc/systemd/system/iotsharp.service
- sudo systemctl enable /etc/systemd/system/iotsharp.service
- sudo systemctl start iotsharp.service
......@@ -30,4 +30,4 @@ IoTSharp is an open-source IoT platform for data collection, processing, visuali
- http://127.0.0.1:5000/
### Windows
- sc create iotsharp binPath= "D:\iotsharp\IoTSharp.Hub.exe" displayname= "IoTSharp" start= auto
- sc create iotsharp binPath= "D:\iotsharp\IoTSharp.exe" displayname= "IoTSharp" start= auto
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册