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; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using uWine.Core.Domain.Entities;
|
||||
|
||||
namespace uWine.Core.Domain.Repositories
|
||||
{
|
||||
public interface IAddressRepository
|
||||
{
|
||||
void Insert(Address address);
|
||||
List<Address> OwnerAddresses(int OwnerId);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("uWine.Core.Domain")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c1cce144adfdc03c9b6cea5b0475d00d396c5979")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9036616a5922f1fdddd933a21ff41597a22b9d12")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("uWine.Core.Domain")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("uWine.Core.Domain")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
b4f9cdf42bbc6275dce25589f1009521fd28adc8121c348ed306aded774240ff
|
||||
f4881d9a83679f0090798624563523a1b20e755faf7a53ce3f3323358a12e49b
|
||||
Binary file not shown.
@@ -1,11 +1,201 @@
|
||||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
"net8.0": {}
|
||||
"net8.0": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"buildTransitive/net6.0/_._": {}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
|
||||
},
|
||||
"compile": {
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets": {}
|
||||
}
|
||||
},
|
||||
"MySqlConnector/2.4.0": {
|
||||
"type": "package",
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2"
|
||||
},
|
||||
"compile": {
|
||||
"lib/net8.0/MySqlConnector.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/MySqlConnector.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
|
||||
"sha512": "3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==",
|
||||
"type": "package",
|
||||
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"PACKAGE.md",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets",
|
||||
"buildTransitive/net462/_._",
|
||||
"buildTransitive/net6.0/_._",
|
||||
"buildTransitive/netcoreapp2.0/Microsoft.Extensions.DependencyInjection.Abstractions.targets",
|
||||
"lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
|
||||
"lib/net462/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
|
||||
"lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
|
||||
"lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
|
||||
"lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
|
||||
"lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
|
||||
"lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
|
||||
"lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
|
||||
"lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
|
||||
"lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
|
||||
"microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512",
|
||||
"microsoft.extensions.dependencyinjection.abstractions.nuspec",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
|
||||
"sha512": "nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==",
|
||||
"type": "package",
|
||||
"path": "microsoft.extensions.logging.abstractions/8.0.2",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"PACKAGE.md",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"analyzers/dotnet/roslyn3.11/cs/Microsoft.Extensions.Logging.Generators.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn3.11/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/Microsoft.Extensions.Logging.Generators.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.0/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/Microsoft.Extensions.Logging.Generators.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/cs/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/de/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/es/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/fr/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/it/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/ja/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/ko/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/pl/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/pt-BR/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/ru/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/tr/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/zh-Hans/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"analyzers/dotnet/roslyn4.4/cs/zh-Hant/Microsoft.Extensions.Logging.Generators.resources.dll",
|
||||
"buildTransitive/net461/Microsoft.Extensions.Logging.Abstractions.targets",
|
||||
"buildTransitive/net462/Microsoft.Extensions.Logging.Abstractions.targets",
|
||||
"buildTransitive/net6.0/Microsoft.Extensions.Logging.Abstractions.targets",
|
||||
"buildTransitive/netcoreapp2.0/Microsoft.Extensions.Logging.Abstractions.targets",
|
||||
"buildTransitive/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.targets",
|
||||
"lib/net462/Microsoft.Extensions.Logging.Abstractions.dll",
|
||||
"lib/net462/Microsoft.Extensions.Logging.Abstractions.xml",
|
||||
"lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll",
|
||||
"lib/net6.0/Microsoft.Extensions.Logging.Abstractions.xml",
|
||||
"lib/net7.0/Microsoft.Extensions.Logging.Abstractions.dll",
|
||||
"lib/net7.0/Microsoft.Extensions.Logging.Abstractions.xml",
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll",
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.Abstractions.xml",
|
||||
"lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll",
|
||||
"lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.xml",
|
||||
"microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512",
|
||||
"microsoft.extensions.logging.abstractions.nuspec",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
},
|
||||
"MySqlConnector/2.4.0": {
|
||||
"sha512": "78M+gVOjbdZEDIyXQqcA7EYlCGS3tpbUELHvn6638A2w0pkPI625ixnzsa5staAd3N9/xFmPJtkKDYwsXpFi/w==",
|
||||
"type": "package",
|
||||
"path": "mysqlconnector/2.4.0",
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"README.md",
|
||||
"lib/net462/MySqlConnector.dll",
|
||||
"lib/net462/MySqlConnector.xml",
|
||||
"lib/net471/MySqlConnector.dll",
|
||||
"lib/net471/MySqlConnector.xml",
|
||||
"lib/net48/MySqlConnector.dll",
|
||||
"lib/net48/MySqlConnector.xml",
|
||||
"lib/net6.0/MySqlConnector.dll",
|
||||
"lib/net6.0/MySqlConnector.xml",
|
||||
"lib/net8.0/MySqlConnector.dll",
|
||||
"lib/net8.0/MySqlConnector.xml",
|
||||
"lib/net9.0/MySqlConnector.dll",
|
||||
"lib/net9.0/MySqlConnector.xml",
|
||||
"lib/netstandard2.0/MySqlConnector.dll",
|
||||
"lib/netstandard2.0/MySqlConnector.xml",
|
||||
"lib/netstandard2.1/MySqlConnector.dll",
|
||||
"lib/netstandard2.1/MySqlConnector.xml",
|
||||
"logo.png",
|
||||
"mysqlconnector.2.4.0.nupkg.sha512",
|
||||
"mysqlconnector.nuspec"
|
||||
]
|
||||
}
|
||||
},
|
||||
"libraries": {},
|
||||
"projectFileDependencyGroups": {
|
||||
"net8.0": []
|
||||
"net8.0": [
|
||||
"MySqlConnector >= 2.4.0"
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\usardi\\.nuget\\packages\\": {}
|
||||
@@ -51,6 +241,12 @@
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"dependencies": {
|
||||
"MySqlConnector": {
|
||||
"target": "Package",
|
||||
"version": "[2.4.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "7bfu3DyTznk=",
|
||||
"dgSpecHash": "xoU7wD+w/v0=",
|
||||
"success": true,
|
||||
"projectFilePath": "M:\\uv\\uWine\\uWine.Core.Domain\\uWine.Core.Domain.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\usardi\\.nuget\\packages\\microsoft.extensions.dependencyinjection.abstractions\\8.0.2\\microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512",
|
||||
"C:\\Users\\usardi\\.nuget\\packages\\microsoft.extensions.logging.abstractions\\8.0.2\\microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512",
|
||||
"C:\\Users\\usardi\\.nuget\\packages\\mysqlconnector\\2.4.0\\mysqlconnector.2.4.0.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
@@ -45,6 +45,12 @@
|
||||
"frameworks": {
|
||||
"net8.0": {
|
||||
"targetAlias": "net8.0",
|
||||
"dependencies": {
|
||||
"MySqlConnector": {
|
||||
"target": "Package",
|
||||
"version": "[2.4.0, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\8.0.2\buildTransitive\net6.0\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.logging.abstractions\8.0.2\buildTransitive\net6.0\Microsoft.Extensions.Logging.Abstractions.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MySqlConnector" Version="2.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in new issue
Block a user