Example #1
0
 public static Validation <Error, TodoItem> FromDto(TodoItemDto dto)
 => TodoItem.New(dto.Id, dto.IsDone, dto.Content);
Example #2
0
 private EitherAsync <TodoFailure, Unit> PersistAsync(TodoItem item) =>
 TodoItemDto.FromDomain(item).Apply(_todoItemDataSource.Add)
 .MapLeft(TodoFailureCon.Database);