1234567891011121314151617181920212223 |
- using System.Linq;
- using Luticate2.Auth.Dbo;
- using Luticate2.Auth.Dbo.Fields;
- using Luticate2.Auth.Dbo.Result;
-
- namespace Luticate2.Auth.Business.Fields
- {
- public 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", "");
- }
- }
- }
|