35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using MySqlConnector;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection.Metadata.Ecma335;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace uWine.Core.Domain.Entities
|
|
{
|
|
public class Vineyard
|
|
{
|
|
public int Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string Location { get; set; }
|
|
public double Hectares { get; set; }
|
|
public Coordinates Coordinates { get; set; }
|
|
public DateTime CreationDate { get; set; }
|
|
public List<Row>? Rows { get; set; }
|
|
public Dictionary<int, Coordinates> Area { get; set; }
|
|
|
|
public static Vineyard FromRecord(MySqlDataReader reader)
|
|
{
|
|
return new Vineyard
|
|
{
|
|
Id = reader.GetInt32(0),
|
|
Name = reader.GetString(1),
|
|
Location = reader.GetString(2),
|
|
Hectares = reader.GetDouble(3),
|
|
Coordinates = new Coordinates( reader.GetDouble(4),reader.GetDouble(5)),
|
|
};
|
|
}
|
|
}
|
|
}
|