December 2019
Intermediate to advanced
510 pages
11h 33m
English
Now, let's look at the implementation of some DTOs in practice. The Order entity describes some actions that accept List<string> as input. Let's suppose that the implementation is getting more complex and our service needs to store additional information about our orders:
using System;using System.Collections.Generic;namespace SampleAPI.Models { public class Order { public Guid Id { get; set; } public IEnumerable<string> ItemsIds { get; set; } public string Currency { get; set; } } }
The domain model is a critical part of our application. It is essential to keep it separated from the request/response model. Therefore, we should avoid having the domain model tightly coupled with the request and the response models. ...
Read now
Unlock full access