add: сущность теплицы

This commit is contained in:
mfnefd 2024-11-13 03:31:43 +04:00
parent 49c7d14925
commit fbfde769b1
5 changed files with 32 additions and 0 deletions

View File

@ -6,6 +6,7 @@ public class ApplicationContext : DbContext
{
public DbSet<User> Users { get; set; } = null!;
public DbSet<Farm> Farms { get; set; } = null!;
public DbSet<Greenhouse> Greenhouses { get; set; } = null!;
public ApplicationContext(DbContextOptions<ApplicationContext> options)
: base(options)

View File

@ -7,5 +7,6 @@
public int UserId { get; set; }
public User? User { get; set; }
public string RaspberryIP { get; set; }
List<Greenhouse> Greenhouses { get; set; } = new();
}
}

View File

@ -0,0 +1,14 @@
using Cloud.Models.Support;
namespace Cloud.Models
{
public class Greenhouse
{
public int Id { get; set; }
public int RecomendedTemperature { get; set; }
public WateringMode WateringMode { get; set; }
public HeatingMode HeatingMode { get; set; }
public int FarmId { get; set; }
public Farm? Farm { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace Cloud.Models.Support
{
public enum HeatingMode
{
Manual,
Auto
}
}

View File

@ -0,0 +1,8 @@
namespace Cloud.Models.Support
{
public enum WateringMode
{
Manual,
Auto
}
}