Beispiel #1
0
 public static void MapTo(this JobAdList list, JobAdListEntity entity)
 {
     entity.name        = list.Name;
     entity.ownerId     = list.OwnerId;
     entity.isDeleted   = list.IsDeleted;
     entity.createdTime = list.CreatedTime;
     entity.listType    = list.ListType;
 }
Beispiel #2
0
        public static JobAdListEntity Map(this JobAdList list)
        {
            var entity = new JobAdListEntity {
                id = list.Id
            };

            list.MapTo(entity);
            return(entity);
        }
Beispiel #3
0
        public static T MapTo <T>(this JobAdListEntity entity)
            where T : JobAdList, new()
        {
            if (entity == null)
            {
                return(null);
            }

            return(new T
            {
                Id = entity.id,
                Name = entity.name,
                OwnerId = entity.ownerId,
                IsDeleted = entity.isDeleted,
                CreatedTime = entity.createdTime,
                ListType = entity.listType,
            });
        }