123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using Luticate2.Utils.Utils;
- using TestUtils.DataAccess.Models;
- using TestUtils.Dbo.FkPkGuid;
- using TestUtils.Dbo.PkBigSerial;
- using TestUtils.Dbo.PkGuid;
-
- namespace TestUtils.DataAccess
- {
- public static class ModelsToDbo
- {
- public static PkGuidDbo ToDbo(this pk_guid model)
- {
- if (model == null)
- {
- return null;
- }
- return new PkGuidDbo
- {
- CreatedAt = model.created_at,
- UpdatedAt = model.updated_at,
- Id = model.id.ToString(),
- SomeInt = model.some_int,
- SomeText = model.some_text
- };
- }
-
- public static FkPkGuidDbo ToDbo(this fk_pk_guids model)
- {
- if (model == null)
- {
- return null;
- }
- return new FkPkGuidDbo
- {
- Id = model.id.ToString(),
- Name = model.name,
- PkGuid = model.fk_pk_guid.ToDbo(),
- PkGuidId = model.pk_guid_id.ToDbo()
- };
- }
-
- public static PkBigSerialDbo ToDbo(this pk_bigserial model)
- {
- if (model == null)
- {
- return null;
- }
- return new PkBigSerialDbo
- {
- CreatedAt = model.created_at,
- Id = model.id,
- SomeInt = model.some_int,
- SomeText = model.some_text
- };
- }
- }
- }
|