From a10f89237520272fbccce17d695e06b0a6c7b395 Mon Sep 17 00:00:00 2001 From: Stefan-5422 <32109571+Stefan-5422@users.noreply.github.com> Date: Thu, 26 Jan 2023 16:39:54 +0100 Subject: [PATCH] =?UTF-8?q?Added=20Translation=20Database=20=F0=9F=A6=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeviceManagementDatabaseContext.cs | 10 ++++++++++ .../Elektrifikatsiya/Elektrifikatsiya.csproj | 5 +++++ .../Elektrifikatsiya/Model/Device.cs | 20 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs create mode 100644 src/Elektrifikatsiya/Elektrifikatsiya/Model/Device.cs diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs b/src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs new file mode 100644 index 0000000..f182b24 --- /dev/null +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Database/DeviceManagementDatabaseContext.cs @@ -0,0 +1,10 @@ +using Elektrifikatsiya.Model; +using Microsoft.EntityFrameworkCore; + +namespace Elektrifikatsiya.Database +{ + public class DeviceManagmentDatabaseContext : DbContext + { + public DbSet Devices { get; set; } + } +} diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Elektrifikatsiya.csproj b/src/Elektrifikatsiya/Elektrifikatsiya/Elektrifikatsiya.csproj index 7653e0e..ff8eb7c 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Elektrifikatsiya.csproj +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Elektrifikatsiya.csproj @@ -21,7 +21,12 @@ + + + + + diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Model/Device.cs b/src/Elektrifikatsiya/Elektrifikatsiya/Model/Device.cs new file mode 100644 index 0000000..65cdf34 --- /dev/null +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Model/Device.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; +using System.Net; + +namespace Elektrifikatsiya.Model; + +public class Device +{ + [Key] + public string Key { get; private set; } + [Required] + public string Name { get; private set; } = string.Empty; + [Required] + public IPAddress Address { get; private set; } + + public Device(string key, IPAddress address) + { + Key = key; + Address = address; + } +} \ No newline at end of file