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