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; }
public static JobAdListEntity Map(this JobAdList list) { var entity = new JobAdListEntity { id = list.Id }; list.MapTo(entity); return(entity); }
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, }); }