You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuPOCGroupsToDbo.cs 1.0KB

123456789101112131415161718192021222324252627
  1. using System;
  2. using Luticate2.Auth.Auth.DataAccess.Models;
  3. using Luticate2.Auth.Auth.Dbo;
  4. using Luticate2.Auth.Utils.Business.PartialObjectCopier;
  5. using Luticate2.Auth.Utils.Dbo.Fields;
  6. using Luticate2.Auth.Utils.Dbo.PartialObjectCopier;
  7. using Luticate2.Auth.Utils.Dbo.Result;
  8. namespace Luticate2.Auth.Auth.Business.PartialObjectCopier
  9. {
  10. public class LuPOCGroupsToDbo : LuPartialObjectCopier<LuGroups, LuGroupDbo>
  11. {
  12. public LuPOCGroupsToDbo(IServiceProvider serviceProvider) : base(serviceProvider)
  13. {
  14. }
  15. public override LuResult<LuGroupDbo> Copy(LuFieldDbo path, LuPartialFieldsDbo fields, LuGroups modelFrom,
  16. LuGroupDbo dboTo, LuPartialObjectCopierOptions options)
  17. {
  18. MayCopy(path, fields, dboTo, dbo => dbo.Id, () => modelFrom.Id);
  19. MayCopySubProperty(path, fields, modelFrom, dboTo, x => x.IdNavigation, x => x.Metadata, options);
  20. MayCopy(path, fields, dboTo, dbo => dbo.Name, () => modelFrom.Name);
  21. return LuResult<LuGroupDbo>.Ok(dboTo);
  22. }
  23. }
  24. }