creazione entities e primi repository
This commit is contained in:
1 parent
9036616a59
commit
b7983dae8e
22 files changed
+601
-21
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using MySqlConnector;
|
||||
|
||||
namespace uWine.Core.Domain.Entities
|
||||
{
|
||||
public class Address
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string County { get; set; }
|
||||
public string Province { get; set; }
|
||||
public string City { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string HouseNumber { get; set; }
|
||||
public decimal Latitude { get; set; }
|
||||
public decimal Longitude { get; set; }
|
||||
public bool Active { get; set; }
|
||||
|
||||
public static Address FromRecord(MySqlDataReader reader)
|
||||
{
|
||||
return new Address
|
||||
{
|
||||
Id = reader.GetInt32("id"),
|
||||
Country = reader.GetString("country"),
|
||||
PostalCode = reader.GetString("postal_code"),
|
||||
County = reader.GetString("county"),
|
||||
Province = reader.GetString("province"),
|
||||
City = reader.GetString("city"),
|
||||
Street = reader.GetString("street"),
|
||||
HouseNumber = reader.GetString("house_number"),
|
||||
Latitude = reader.GetDecimal("latitude"),
|
||||
Longitude = reader.GetDecimal("longitude"),
|
||||
Active = reader.GetBoolean("active")
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace uWine.Core.Domain.Entities
|
||||
{
|
||||
public class Contact
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public ContactType ContactType { get; set; }
|
||||
public string Value { get; set; }
|
||||
public int Priority { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public DateTime? UpdatedDate { get; set; }
|
||||
public bool Active { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace uWine.Core.Domain.Entities
|
||||
{
|
||||
public class ContactType
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Type { get; set; }
|
||||
public string Description { get; set; }
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace uWine.Core.Domain.Entities
|
||||
{
|
||||
public class Owner
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Surname { get; set; }
|
||||
public string CompanyName { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public DateTime CreationDate { get; set; }
|
||||
public string Note { get; set; }
|
||||
public List<Contact> Contacts { get; set; }
|
||||
public List<Vineyard> Vineyards { get; set; }
|
||||
public List<Address> Addresses { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace uWine.Core.Domain.Entities
|
||||
{
|
||||
public class Role
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace uWine.Core.Domain.Entities
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public Role Role { get; set; }
|
||||
public bool Active { get; set; }
|
||||
public List<Owner> Owners { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user