diff --git a/02_ProjectOrientedSessions/Session04/Session04.md b/02_ProjectOrientedSessions/Session04/Session04.md
index 1c084fb..52baf78 100644
--- a/02_ProjectOrientedSessions/Session04/Session04.md
+++ b/02_ProjectOrientedSessions/Session04/Session04.md
@@ -32,11 +32,11 @@ public class CityDto
```cs
public class TransportationSearchRequestDto
{
- public short? VehicleTypeId { get; init; }
- public int? FromCityId { get; init; }
- public int? ToCityId { get; init; }
- public DateTime? StartDate { get; init; }
- public DateTime? EndDate { get; init; }
+ public short? VehicleTypeId { get; init; }
+ public int? FromCityId { get; init; }
+ public int? ToCityId { get; init; }
+ public DateTime? StartDate { get; init; }
+ public DateTime? EndDate { get; init; }
}
```
@@ -169,7 +169,63 @@ public class MappingProfile : Profile
.
```
-# Result & Result Status (Amin)
+# Result & Result Status
+
+Result is a template to transfer data between services and controllers (in backend), so will use a generic type
+
+```cs
+public class Result
+{
+ public ResultStatus Status { get; set; }
+ public string? ErrorMessage { get; set; }
+ public T? Data { get; set; }
+ public bool IsSuccess => Status == ResultStatus.Success;
+
+ public static Result Success(T data)
+ {
+ return new Result
+ {
+ Status = ResultStatus.Success,
+ Data = data
+ };
+ }
+
+ public static Result Error(T data)
+ {
+ return new Result
+ {
+ Status = ResultStatus.Error,
+ Data = data
+ };
+ }
+
+ public static Result NotFound(T data)
+ {
+ return new Result
+ {
+ Status = ResultStatus.NotFound,
+ Data = data
+ };
+ }
+}
+```
+
+As you can see, there's a property of type ResultStatus, which is a enum for status of request
+
+```cs
+public enum ResultStatus
+{
+ Success,
+ NotFound,
+ ValidationError,
+ Conflict,
+ Unauthorized,
+ Forbidden,
+ Error
+}
+```
+
+You can read more about enums: [W3Schools](https://www.w3schools.com/cs/cs_enums.php)
# IService & Service (Amin)