using System.Collections.Generic;
using System.Linq.Expressions;
public static void Main()
TypeAdapterConfig config=TypeAdapterConfig.GlobalSettings;
config.ForType<Abc,AbcDto>().IgnoreNullValues(true);
IQueryable<Abc> abcs=DataFaker.AbcFaker().Generate(10).AsQueryable();
test.AbcDtos=abcs.ProjectToType<AbcDto>();
test.Abcs.Take(13).Dump();
public string Name {get;set;}
public int? Age {get;set;}
public string FavoriteColor {get;set;}
public IQueryable<Abc> Abcs {get;set;}=default!;
public IQueryable<AbcDto>? AbcDtos {get;set;}=null;
public static class DataFaker {
public static Faker<Abc> AbcFaker(){
return new Faker<Abc>().RuleFor(c=>c.Name,c=>c.Random.Bool(.5f) ? c.Person.FullName : null).RuleFor(c=>c.Age,c=>c.Random.Bool(.6f) ? c.Random.Int(7,81) : null).RuleFor(c=>c.FavoriteColor, c=>c.Random.Bool(.7f) ? c.Commerce.Color() : null);
public string? Name {get;set;}=default!;
public int? Age {get;set;}
public string? FavoriteColor {get;set;}=default!;