dev #9
@ -6,6 +6,7 @@ public class ApplicationContext : DbContext
|
|||||||
{
|
{
|
||||||
public DbSet<User> Users { get; set; } = null!;
|
public DbSet<User> Users { get; set; } = null!;
|
||||||
public DbSet<Farm> Farms { get; set; } = null!;
|
public DbSet<Farm> Farms { get; set; } = null!;
|
||||||
|
public DbSet<Greenhouse> Greenhouses { get; set; } = null!;
|
||||||
|
|
||||||
public ApplicationContext(DbContextOptions<ApplicationContext> options)
|
public ApplicationContext(DbContextOptions<ApplicationContext> options)
|
||||||
: base(options)
|
: base(options)
|
||||||
|
@ -7,5 +7,6 @@
|
|||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public User? User { get; set; }
|
public User? User { get; set; }
|
||||||
public string RaspberryIP { get; set; }
|
public string RaspberryIP { get; set; }
|
||||||
|
List<Greenhouse> Greenhouses { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
14
Cloud/Models/Greenhouse.cs
Normal file
14
Cloud/Models/Greenhouse.cs
Normal 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; }
|
||||||
|
}
|
||||||
|
}
|
8
Cloud/Models/Support/HeatingMode.cs
Normal file
8
Cloud/Models/Support/HeatingMode.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace Cloud.Models.Support
|
||||||
|
{
|
||||||
|
public enum HeatingMode
|
||||||
|
{
|
||||||
|
Manual,
|
||||||
|
Auto
|
||||||
|
}
|
||||||
|
}
|
8
Cloud/Models/Support/WateringMode.cs
Normal file
8
Cloud/Models/Support/WateringMode.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace Cloud.Models.Support
|
||||||
|
{
|
||||||
|
public enum WateringMode
|
||||||
|
{
|
||||||
|
Manual,
|
||||||
|
Auto
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user