public PropertyGen SimpleProperty(FieldGen field, string name) { if ((object)field == null) { throw new ArgumentNullException(nameof(field)); } PropertyGen pg = Property(field.GetReturnType(_typeMapper), name); pg.Getter().GetCode().Return(field); pg.Setter().GetCode().Assign(field, pg.Setter().GetCode().PropertyValue()); return(pg); }