C
C#2y ago
M B V R K

❔ A request for a Microservices Architecture Help

Hi friends, Lets say that I'm implementing a Microservices architecture project, I have 3 main services ( CustomerService, ProductService and OrderService). All these services are ASP.NET 7 API projects, they use the EF Core and SQL Server. Each service has its own database and its own Entities. The Issue: In the OrderService service, II have this Entitiy:
public class Order
{
public int Id { get; set; }
public DateTime OrderDate { get; set; }
public string CustomerId { get; set; }
public string ProductId { get; set; }
public int Quantity { get; set; }
public decimal Price { get; set; }
public decimal Total { get; set; }
}
public class Order
{
public int Id { get; set; }
public DateTime OrderDate { get; set; }
public string CustomerId { get; set; }
public string ProductId { get; set; }
public int Quantity { get; set; }
public decimal Price { get; set; }
public decimal Total { get; set; }
}
As you will notiice that every Order will require CustomerId and ProductId, I can handle that by getting them from the Front-end. Is this a good practice, or is I missed something? Note: The Order entity is in OrderService and the Customer entity in the CustomerService, the Product entity is in the ProductService, this means they are not knowing each other. Pease if you have any notes, suggestions and/or experience share, just share it with me. To watch the project I'm talking about to get a general idea you can find it here (https://github.com/MbarkT3STO/MicroservicesExample) Massive thanks in advance. @Architecture @AspNetCore
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server