diff --git a/.vs/uWine/CopilotIndices/0.2.1634.3922/CodeChunks.db b/.vs/uWine/CopilotIndices/0.2.1634.3922/CodeChunks.db index 69b7466..9cdaca6 100644 Binary files a/.vs/uWine/CopilotIndices/0.2.1634.3922/CodeChunks.db and b/.vs/uWine/CopilotIndices/0.2.1634.3922/CodeChunks.db differ diff --git a/.vs/uWine/DesignTimeBuild/.dtbcache.v2 b/.vs/uWine/DesignTimeBuild/.dtbcache.v2 index 67256fe..c2d572d 100644 Binary files a/.vs/uWine/DesignTimeBuild/.dtbcache.v2 and b/.vs/uWine/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/uWine/v17/.suo b/.vs/uWine/v17/.suo index 3159887..2a76947 100644 Binary files a/.vs/uWine/v17/.suo and b/.vs/uWine/v17/.suo differ diff --git a/.vs/uWine/v17/DocumentLayout.backup.json b/.vs/uWine/v17/DocumentLayout.backup.json index d26bad4..a503e9d 100644 --- a/.vs/uWine/v17/DocumentLayout.backup.json +++ b/.vs/uWine/v17/DocumentLayout.backup.json @@ -2,6 +2,30 @@ "Version": 1, "WorkspaceRootPath": "M:\\uv\\uWine\\", "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\repositories\\iaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\repositories\\iaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{50360CEE-B38B-4729-ACA3-ABC3ED3538E9}|uWine.Core.Infrastructure\\uWine.Core.Infrastructure.csproj|m:\\uv\\uwine\\uwine.core.infrastructure\\repository\\mariadbaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{50360CEE-B38B-4729-ACA3-ABC3ED3538E9}|uWine.Core.Infrastructure\\uWine.Core.Infrastructure.csproj|solutionrelative:uwine.core.infrastructure\\repository\\mariadbaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\address.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\address.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\rowwork.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\rowwork.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\productusage.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\productusage.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\warehouseproduct.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\warehouseproduct.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -63,6 +87,84 @@ { "$type": "Document", "DocumentIndex": 0, + "Title": "IAddressRepository.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "RelativeToolTip": "uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAA0AAAAFAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-04T13:30:13.643Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "Address.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Address.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Address.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Address.cs", + "RelativeToolTip": "uWine.Core.Domain\\Entities\\Address.cs", + "ViewState": "AgIAAAoAAAAAAAAAAAAkwAAAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-04T12:44:44.188Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "MariaDbAddressRepository.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "RelativeDocumentMoniker": "uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "RelativeToolTip": "uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-04T12:25:22.151Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "RowWork.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\RowWork.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\RowWork.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\RowWork.cs", + "RelativeToolTip": "uWine.Core.Domain\\Entities\\RowWork.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-03T10:09:09.455Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 5, + "Title": "WarehouseProduct.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\WarehouseProduct.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\WarehouseProduct.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\WarehouseProduct.cs", + "RelativeToolTip": "uWine.Core.Domain\\Entities\\WarehouseProduct.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAA4AAAA0AAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-03T10:07:37.406Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 4, + "Title": "ProductUsage.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\ProductUsage.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\ProductUsage.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\ProductUsage.cs", + "RelativeToolTip": "uWine.Core.Domain\\Entities\\ProductUsage.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-03T10:07:00.42Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 6, "Title": "Worker.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Worker.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Worker.cs", @@ -75,7 +177,7 @@ }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 10, "Title": "PlantVariety.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\PlantVariety.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\PlantVariety.cs", @@ -88,7 +190,7 @@ }, { "$type": "Document", - "DocumentIndex": 3, + "DocumentIndex": 9, "Title": "VinePlant.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\VinePlant.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\VinePlant.cs", @@ -100,7 +202,7 @@ }, { "$type": "Document", - "DocumentIndex": 2, + "DocumentIndex": 8, "Title": "Vineyard.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Vineyard.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Vineyard.cs", @@ -112,7 +214,7 @@ }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 7, "Title": "Row.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Row.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Row.cs", diff --git a/.vs/uWine/v17/DocumentLayout.json b/.vs/uWine/v17/DocumentLayout.json index 6dbc673..c687106 100644 --- a/.vs/uWine/v17/DocumentLayout.json +++ b/.vs/uWine/v17/DocumentLayout.json @@ -3,13 +3,29 @@ "WorkspaceRootPath": "M:\\uv\\uWine\\", "Documents": [ { - "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\warehouseproduct.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\warehouseproduct.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + "AbsoluteMoniker": "D:0:0:{50360CEE-B38B-4729-ACA3-ABC3ED3538E9}|uWine.Core.Infrastructure\\uWine.Core.Infrastructure.csproj|m:\\uv\\uwine\\uwine.core.infrastructure\\repository\\mariadbaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{50360CEE-B38B-4729-ACA3-ABC3ED3538E9}|uWine.Core.Infrastructure\\uWine.Core.Infrastructure.csproj|solutionrelative:uwine.core.infrastructure\\repository\\mariadbaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\repositories\\iaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\repositories\\iaddressrepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\address.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\address.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\rowwork.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\rowwork.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\productusage.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\productusage.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, + { + "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\warehouseproduct.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\warehouseproduct.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|m:\\uv\\uwine\\uwine.core.domain\\entities\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{1DCFCDC3-C4A6-4864-8868-94AAB81C3DBA}|uWine.Core.Domain\\uWine.Core.Domain.csproj|solutionrelative:uwine.core.domain\\entities\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -38,7 +54,7 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 7, + "SelectedChildIndex": 9, "Children": [ { "$type": "Bookmark", @@ -68,9 +84,61 @@ "$type": "Bookmark", "Name": "ST:0:0:{004be353-6879-467c-9d1e-9ac23cdf6d49}" }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "IAddressRepository.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "RelativeToolTip": "uWine.Core.Domain\\Repositories\\IAddressRepository.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-04T13:30:13.643Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "Address.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Address.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Address.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Address.cs", + "RelativeToolTip": "uWine.Core.Domain\\Entities\\Address.cs", + "ViewState": "AgIAAAoAAAAAAAAAAAAkwAAAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-04T12:44:44.188Z", + "EditorCaption": "" + }, { "$type": "Document", "DocumentIndex": 0, + "Title": "MariaDbAddressRepository.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "RelativeDocumentMoniker": "uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "RelativeToolTip": "uWine.Core.Infrastructure\\Repository\\MariaDbAddressRepository.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-04T12:25:22.151Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "RowWork.cs", + "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\RowWork.cs", + "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\RowWork.cs", + "ToolTip": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\RowWork.cs", + "RelativeToolTip": "uWine.Core.Domain\\Entities\\RowWork.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2025-07-03T10:09:09.455Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 5, "Title": "WarehouseProduct.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\WarehouseProduct.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\WarehouseProduct.cs", @@ -83,7 +151,7 @@ }, { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 4, "Title": "ProductUsage.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\ProductUsage.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\ProductUsage.cs", @@ -96,7 +164,7 @@ }, { "$type": "Document", - "DocumentIndex": 2, + "DocumentIndex": 6, "Title": "Worker.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Worker.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Worker.cs", @@ -109,7 +177,7 @@ }, { "$type": "Document", - "DocumentIndex": 6, + "DocumentIndex": 10, "Title": "PlantVariety.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\PlantVariety.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\PlantVariety.cs", @@ -122,7 +190,7 @@ }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 9, "Title": "VinePlant.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\VinePlant.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\VinePlant.cs", @@ -134,7 +202,7 @@ }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 8, "Title": "Vineyard.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Vineyard.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Vineyard.cs", @@ -146,7 +214,7 @@ }, { "$type": "Document", - "DocumentIndex": 3, + "DocumentIndex": 7, "Title": "Row.cs", "DocumentMoniker": "M:\\uv\\uWine\\uWine.Core.Domain\\Entities\\Row.cs", "RelativeDocumentMoniker": "uWine.Core.Domain\\Entities\\Row.cs", diff --git a/uWine.Core.Domain/Entities/Address.cs b/uWine.Core.Domain/Entities/Address.cs new file mode 100644 index 0000000..3c56e83 --- /dev/null +++ b/uWine.Core.Domain/Entities/Address.cs @@ -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") + }; + } + } +} diff --git a/uWine.Core.Domain/Entities/Contact.cs b/uWine.Core.Domain/Entities/Contact.cs new file mode 100644 index 0000000..d6d203c --- /dev/null +++ b/uWine.Core.Domain/Entities/Contact.cs @@ -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; } + + } +} diff --git a/uWine.Core.Domain/Entities/ContactType.cs b/uWine.Core.Domain/Entities/ContactType.cs new file mode 100644 index 0000000..341715b --- /dev/null +++ b/uWine.Core.Domain/Entities/ContactType.cs @@ -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; } + } +} diff --git a/uWine.Core.Domain/Entities/Owner.cs b/uWine.Core.Domain/Entities/Owner.cs new file mode 100644 index 0000000..87c2788 --- /dev/null +++ b/uWine.Core.Domain/Entities/Owner.cs @@ -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 Contacts { get; set; } + public List Vineyards { get; set; } + public List
Addresses { get; set; } + } +} diff --git a/uWine.Core.Domain/Entities/Role.cs b/uWine.Core.Domain/Entities/Role.cs new file mode 100644 index 0000000..2061674 --- /dev/null +++ b/uWine.Core.Domain/Entities/Role.cs @@ -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; } + } +} diff --git a/uWine.Core.Domain/Entities/User.cs b/uWine.Core.Domain/Entities/User.cs new file mode 100644 index 0000000..7e7fa49 --- /dev/null +++ b/uWine.Core.Domain/Entities/User.cs @@ -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 Owners { get; set; } + } + } diff --git a/uWine.Core.Domain/Repositories/IAddressRepository.cs b/uWine.Core.Domain/Repositories/IAddressRepository.cs new file mode 100644 index 0000000..ae67d28 --- /dev/null +++ b/uWine.Core.Domain/Repositories/IAddressRepository.cs @@ -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
OwnerAddresses(int OwnerId); + } +} diff --git a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs index 6bc204c..ac94dba 100644 --- a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs +++ b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfo.cs @@ -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")] diff --git a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache index afcfeec..4fcf865 100644 --- a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache +++ b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.AssemblyInfoInputs.cache @@ -1 +1 @@ -b4f9cdf42bbc6275dce25589f1009521fd28adc8121c348ed306aded774240ff +f4881d9a83679f0090798624563523a1b20e755faf7a53ce3f3323358a12e49b diff --git a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.assets.cache b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.assets.cache index a12e8b9..28249a3 100644 Binary files a/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.assets.cache and b/uWine.Core.Domain/obj/Debug/net8.0/uWine.Core.Domain.assets.cache differ diff --git a/uWine.Core.Domain/obj/project.assets.json b/uWine.Core.Domain/obj/project.assets.json index 109a5f1..ec9622b 100644 --- a/uWine.Core.Domain/obj/project.assets.json +++ b/uWine.Core.Domain/obj/project.assets.json @@ -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", diff --git a/uWine.Core.Domain/obj/project.nuget.cache b/uWine.Core.Domain/obj/project.nuget.cache index 47761b5..42f1b24 100644 --- a/uWine.Core.Domain/obj/project.nuget.cache +++ b/uWine.Core.Domain/obj/project.nuget.cache @@ -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": [] } \ No newline at end of file diff --git a/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.dgspec.json b/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.dgspec.json index 1ccc10a..cb03b6a 100644 --- a/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.dgspec.json +++ b/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.dgspec.json @@ -45,6 +45,12 @@ "frameworks": { "net8.0": { "targetAlias": "net8.0", + "dependencies": { + "MySqlConnector": { + "target": "Package", + "version": "[2.4.0, )" + } + }, "imports": [ "net461", "net462", diff --git a/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.g.targets b/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.g.targets index 3dc06ef..2e661a6 100644 --- a/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.g.targets +++ b/uWine.Core.Domain/obj/uWine.Core.Domain.csproj.nuget.g.targets @@ -1,2 +1,6 @@  - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/uWine.Core.Domain/uWine.Core.Domain.csproj b/uWine.Core.Domain/uWine.Core.Domain.csproj index fa71b7a..61bc29a 100644 --- a/uWine.Core.Domain/uWine.Core.Domain.csproj +++ b/uWine.Core.Domain/uWine.Core.Domain.csproj @@ -6,4 +6,8 @@ enable + + + + diff --git a/uWine.Core.Infrastructure/Repository/MariaDbAddressRepository.cs b/uWine.Core.Infrastructure/Repository/MariaDbAddressRepository.cs new file mode 100644 index 0000000..941aa9a --- /dev/null +++ b/uWine.Core.Infrastructure/Repository/MariaDbAddressRepository.cs @@ -0,0 +1,78 @@ +using Microsoft.Extensions.Configuration; +using uWine.Core.Domain.Entities; +using uWine.Core.Domain.Repositories; + +namespace uWine.Core.Infrastructure.Repository +{ + public class MariaDbAddressRepository : MariaDbServerRepository, IAddressRepository + { + public MariaDbAddressRepository(IConfiguration configuration) : base(configuration) + { + } + + public void Insert(Address address) + { + using (var connection = Connection()) + { + connection.Open(); + var command = connection.CreateCommand(); + command.CommandText = $@"INSERT INTO t_addresses ( + country, + postal_code, + county, + province, + city, + street, + house_number, + latitude, + longitude, + active + ) VALUES ( + @country, + @postal_code, + @county, + @province, + @city, + @street, + @house_number, + @latitude, + @longitude, + @active + )"; + command.Parameters.AddWithValue("@country", address.Country); + command.Parameters.AddWithValue("@postal_code", address.PostalCode); + command.Parameters.AddWithValue("@county", address.County); + command.Parameters.AddWithValue("@province", address.Province); + command.Parameters.AddWithValue("@city", address.City); + command.Parameters.AddWithValue("@street", address.Street); + command.Parameters.AddWithValue("@house_number", address.HouseNumber); + command.Parameters.AddWithValue("@latitude", address.Latitude); + command.Parameters.AddWithValue("@longitude", address.Longitude); + command.Parameters.AddWithValue("@active", address.Active ? 1 : 0); + command.ExecuteNonQuery(); + } + } + + public List
OwnerAddresses(int OwnerId) + { + var addresses = new List
(); + using (var connection = Connection()) + { + connection.Open(); + var command = connection.CreateCommand(); + command.CommandText = $@"SELECT a.* FROM t_addresses a + JOIN t_owners_addresses oa ON a.id = oa.address_id + WHERE oa.owner_id = @OwnerId"; + command.Parameters.AddWithValue("@OwnerId", OwnerId); + using (var reader = command.ExecuteReader()) + { + while (reader.Read()) + { + addresses.Add(Address.FromRecord(reader)); + } + } + } + return addresses; + } + } +} \ No newline at end of file diff --git a/uWine.Core.Infrastructure/uWine.Core.Infrastructure.csproj b/uWine.Core.Infrastructure/uWine.Core.Infrastructure.csproj index a6c3d6f..821dca6 100644 --- a/uWine.Core.Infrastructure/uWine.Core.Infrastructure.csproj +++ b/uWine.Core.Infrastructure/uWine.Core.Infrastructure.csproj @@ -12,4 +12,8 @@ + + + +