using System; using Luticate2.Auth.Auth.DataAccess.Models; using Luticate2.Auth.Auth.Dbo; using Luticate2.Auth.Utils.Business.PartialObjectCopier; using Luticate2.Auth.Utils.Dbo.Fields; using Luticate2.Auth.Utils.Dbo.PartialObjectCopier; using Luticate2.Auth.Utils.Dbo.Result; namespace Luticate2.Auth.Auth.Business.PartialObjectCopier { public class LuPOCObjectsMetadataToDbo : LuPartialObjectCopier { public LuPOCObjectsMetadataToDbo(IServiceProvider serviceProvider) : base(serviceProvider) { } public override LuResult Copy(LuFieldDbo path, LuPartialFieldsDbo fields, LuObjectsMetadata modelFrom, LuObjectsMetadataDbo dboTo, LuPartialObjectCopierOptions options) { MayCopy(path, fields, dboTo, dbo => dbo.Id, () => modelFrom.Id); MayCopy(path, fields, dboTo, dbo => dbo.CreatedAt, () => modelFrom.CreatedAt); MayCopy(path, fields, dboTo, dbo => dbo.UpdatedAt, () => modelFrom.UpdatedAt); return LuResult.Ok(dboTo); } } }