1234567891011121314151617181920212223 |
- using System.Linq;
- using Luticate2.Auth.Utils.Dbo;
- using Luticate2.Auth.Utils.Dbo.Fields;
- using Luticate2.Auth.Utils.Dbo.Result;
-
- namespace Luticate2.Auth.Utils.Business.Fields
- {
- public static class LuPartialFieldsParser
- {
- public static LuResult<LuPartialFieldsDbo> Parse(string fields)
- {
- if (PartialResponse.Core.Fields.TryParse(fields, out var tempFields))
- {
- var partialFieldsDbo = new LuPartialFieldsDbo
- {
- Fields = tempFields.Values.Select(x => new LuFieldDbo {Parts = x.Parts.ToList()}).ToList()
- };
- return LuResult<LuPartialFieldsDbo>.Ok(partialFieldsDbo);
- }
- return LuResult<LuPartialFieldsDbo>.Error(LuStatus.InputError.ToInt(), "Failed to parse partial fields", "");
- }
- }
- }
|