Robin Thoni преди 7 години
родител
ревизия
b366a30060
променени са 1 файла, в които са добавени 23 реда и са изтрити 8 реда
  1. 23
    8
      backend/WebSem/WebApiWebSem/Business/ArticlesBusiness.cs

+ 23
- 8
backend/WebSem/WebApiWebSem/Business/ArticlesBusiness.cs Целия файл

@@ -1,10 +1,12 @@
1
-using Luticate2.Utils.Business;
1
+using System.Linq;
2
+using Luticate2.Utils.Business;
2 3
 using Luticate2.Utils.Dbo.Basic;
3 4
 using Luticate2.Utils.Dbo.PaginatedRequest;
4 5
 using Luticate2.Utils.Dbo.Result;
5 6
 using Luticate2.Utils.Interfaces;
6 7
 using WebApiWebSem.DataAccess;
7 8
 using WebApiWebSem.Dbo.Articles;
9
+using WebApiWebSem.Dbo.ArticlesFields;
8 10
 
9 11
 namespace WebApiWebSem.Business
10 12
 {
@@ -20,13 +22,26 @@ namespace WebApiWebSem.Business
20 22
 
21 23
         public override LuResult<LuPaginatedDbo<ArticlesDbo>> GetMultiple(LuPaginatedRequestDbo request)
22 24
         {
23
-            return _dbPediaDataAccess.GetMultiple(request);
24
-//            var result = _dbPediaDataAccess.GetMultiple(request);
25
-//            if (result.Status == LuStatus.BackendError)
26
-//            {
27
-//                return base.GetMultiple(request);
28
-//            }
29
-//            return result;
25
+            var result = _dbPediaDataAccess.GetMultiple(request);
26
+            if (result.Status == LuStatus.BackendError)
27
+            {
28
+                return base.GetMultiple(request);
29
+            }
30
+            DataAccess.AddDbo(result.Data.Data.Select(dbo => new ArticlesAddDbo
31
+            {
32
+                Fields = dbo.Fields.Select(fieldsDbo => new ArticlesFieldsAddDbo
33
+                {
34
+                    Property = fieldsDbo.Property,
35
+                    Type = fieldsDbo.Type,
36
+                    Value = fieldsDbo.Value
37
+                }).ToList(),
38
+                Id = dbo.Id,
39
+                PictureCaption = dbo.PictureCaption,
40
+                PictureUrl = dbo.PictureUrl,
41
+                Text = dbo.Text,
42
+                Type = dbo.Type
43
+            }));
44
+            return result;
30 45
         }
31 46
     }
32 47
 }

Loading…
Отказ
Запис